Friday, November 16, 2007
Sogeti Logo

I'm thrilled to announce that business is so very good at the moment that Sogeti is once again looking to increase the ranks of their Microsoft Practice.  Sogeti has been my employer since August of 2006, and I must say that I've been thrilled with my experience there.  The team that we have in Dallas are some of the brightest folks I know.  Of course, platitudes are not a reason to work for a company, but enjoying what you do is key. In case you are not aware, Sogeti is a division of Capgemini which focuses on regional IT services delivery.  What does that mean?  It means our consultants don't travel (for the most part) and are placed at positions within their home cities. 

We have at Sogeti one of the best work/life balance benefit packages I've ever encountered in the industry, here are some details:

  • All full-time employee consultants are salaried, W2 employees.  We are a consultancy, not a contracting body shop.  Rolling off a project with a client results in bench time at the office while sales places you at the next client, not the end of your time at Sogeti.
  • Medical and Dental Insurance paid for the consultant, plus the option of a Health Savings Account which allows you to save money towards any sort of "out of pocket" medical expenses, even over the counter drugs, with pre-tax dollars.  If you don't use the money, it rolls over year to year, and becomes yours to do with as you wish at retirement age.
  • Comp-Time for every billable hour over 40 worked in a week.  We've all had that nasty 60 hour a week project, they for the most part cannot be avoided, but with this plan you would earn 20 hours of Comp-Time per week to use to spend time with your family when work was less crazy.  They reward time with time, not money, and that is key.
  • Three weeks of PTO for the first two years, four weeks after that (it goes up again but I forget when).  Also twice per year you can purchase a week of PTO, meaning you could have as much as 5 weeks of PTO in your first year and that is not factoring in Comp-Time.

What sort of folks are we looking for you ask?  .NET Developers of all levels but if you have experience with any of the following technologies that would definitely help:

  • BizTalk Server - We've got the premiere BizTalk practice in the area and would love to welcome more talented developers into the fold.
  • Microsoft Office Sharepoint Server 2007 aka MOSS 2007 - A hot technology at the moment and the emerging enterprise web technology.  If you've work with Sharepoint, drop me a line.

So are you interested?  Drop me a line at Tim@TimRayburn.net with your resume attached and I'll get you in touch with the right people to start the process.  Remember, life is to short to do something you don't enjoy completely.

Friday, November 16, 2007 6:55:42 AM (Central Standard Time, UTC-06:00)
 Thursday, November 15, 2007

Scott Watermasysk, of .Text and Community Server fame, has a post on his new blog which talks about the start of his current project at Telligent called Graffiti.  In it he discusses his opinion that if a first version of your project cannot be accomplished in under 1,000 lines of code, then it probably is being over-engineered from the get go.

Key to this premise though is the idea that you re-use pieces produced by others in order to avoid writing your own code.  He discusses a large variety of other libraries which Graffiti uses, or used in the first few releases.  Some have been replaced, some are still used, but the point is something that is discussed in "agile" circles quite a bit and circles around lots of catch phrases like "Release Often", "Keep It Simple", "YAGNI" and the like.  What I particularly like about Scott's example is that it is a stand against "Not Created Here" which is a horrific airborne virus that many corporate IT departments have caught.

How many things that you've written code for do you know for a fact have been solved before and you're re-writing simply yo re-write?  Data Access, yup.  ORM, yup. Security, yup. Nearly every problem has been solved before, and using an existing library does not diminish the value of your project in fact it increases it because your "Time to Market" will be much higher.

Go read Scott's post, and when your done riddle me this dear reader : What is the biggest piece of code have you personally written that you know you shouldn't have?  Mine is easy, I've re-engineered an entire Rules Engine when BizTalk Server's Rules Engine was available to me.  That was a big piece of code, like 3 developers for 4 months kind-of big.  Live and learn.

Thursday, November 15, 2007 3:19:35 PM (Central Standard Time, UTC-06:00)
 Wednesday, November 14, 2007

My friend Chris Koenig recently put up a post called "Microsoft Central Region - Who (and where) are you?" in which he shared the above image which I thought was worth re-sharing here.  So what does this image show?  It shows the "sub areas" within Microsoft's Central Region where the Evangelism teams focus.  Chris, our Developer Evangelist from Dallas, covers Texas, Oklahoma, Arkansas, and Louisiana.  Recently they've added some help for him in the geographically vast area via J Sawyer based in Houston.  Both Houston and Dallas are huge markets for Microsoft and as such having a DE based in each of these cities will help run Chris a little less ragged.

Now, many of my readers are based in the Dallas/Fort Worth area, and we're spoiled because we see Chris on a regular basis because he is based here.  But it is important to remember that he's just as responsible for the Little Rock, or Northwest Arkansas groups (not to mention Lubbock group) as he is for those in D/FW.

I was reviewing this map and realized that in the last several week's I've hit most of these areas, in fact all but the "Midwest Area".  I've covered:

  • North Central
    • Minneapolis BizTalk 2006 R2 Launch
    • Heartland Developer Conference
  • Heartland Area
    • Memphis Day of .NET
  • South Central
    • Little Rock .NET User Group
    • VSLive! Austin
    • Houston BizTalk 2006 R2 Launch

Here is what I can tell you after all traveling:

  • My favorite Marriott hotel chain is the Fairfield Inn chain.  Good breakfast (unlike Courtyards) and bright, happy rooms.
  • My wife believes I've forgotten how to get home.
  • My boss believes I've forgotten I'm a billable consultant.
  • I believe that I'm seriously looking forward to vacation next week.
Wednesday, November 14, 2007 2:00:51 AM (Central Standard Time, UTC-06:00)
 Friday, October 19, 2007

Mocking frameworks are growing more and more in popularity these days, because to some degree Unit Testing, via TDD or otherwise, has been growing in popularity.  This week at the Heartland Developer Conference I gave a talk on what I call "practical" TDD.  The talk goes over the basics of TDD quickly, but is really targeted at those who have tried to do TDD but found it difficult because they are not working on a team that has adopted the practice, or they are not working a project that was built to be testable.  I spent a good bit of time working no what is the easiest path to help such people adopt TDD, because adoption of such good practices is far more important to me than perfection in them.  As has been said many times, Good Enough is by definition, Good Enough.

After a good bit of research on the subject of mocking frameworks, I have come to the simple conclusion that:

  1. This is an area that is growing still, as nearly every major framework differs on the coding approach.  This is in stark contrast to testing frameworks which, to a one in .NET, all have settled on the NUnit 2.0 model of using attributes.
  2. That if you're not using TypeMock then you're just working to damned hard.

Now, I'm sure my friends (and there are many) who use Rhino Mocks will believe that I must be over-stating the issue, but I tell you clearly I am not.  TypeMock is not built like any other mocking framework currently available, it uses the profiling APIs and not polymorphism or encapsulation in order to intercept calls and provide return values.  Let me give you just a few examples of things which TypeMock can do in a few short lines of code which Rhino Mocks simply cannot do at all.

Mocking Static Methods

Take the following code, and assume that we wish to mock MessageBox.Show which is a static method:

        private void MyCoolMethod(string msg)
        {
            if (MessageBox.Show(msg) == DialogResult.OK)
                Console.WriteLine("OK");
            else
                Console.WriteLine("Not OK! Not OK!");
        }

The following test will work perfectly to mock this call.  No other hidden setup, nothing more than a reference to TypeMock.dll and the following code:

        [Test]
        public void MockMessageBoxShow()
        {
            MockManager.Init();

            Mock mbMock = MockManager.Mock(typeof(MessageBox));
            mbMock.ExpectAndReturn("Show", DialogResult.OK);

            MyCoolMethod("Here we go again.");

            // Ensure that all expectations were met.
            MockManager.Verify();
        }

And with just that little code, just 4 lines dedicated to the mock, 2 of which should be refactored to Setup and TearDown methods, we can mock a static method.

Not cool enough for you? Ok, fine.

Mocking Events

So you have something which expects an object to return certain events.  This example does require a professional license of TypeMock, it will not work under the Community Edition, but if you need this functionality then really pay the nice folks their money.

    public class GUI
    {
        public string LovingCSharp { get; set; }

        public void Initialize()
        {
            this.LovingCSharp = string.Empty;
            Button button = new Button();
            button.Click += new EventHandler(button_Click);
        }

        private void button_Click(object sender, EventArgs e)
        {
            this.LovingCSharp += "LOVE!";
        }
    }

Now let's mock this up, call that event three times, and assert that our property is set correctly. 

        [Test]
        public void MockFormWithEvents()
        {
            MockManager.Init();

            // Mock button so that we can...
            Mock btnMock = MockManager.MockAll(typeof(Button));

            // Handle all calls to add an event handler.
            MockedEvent evntMock = btnMock.ExpectAddEventAlways("Click");

            GUI frm = new GUI();
            frm.Initialize();
            evntMock.Fire(this, EventArgs.Empty);
            evntMock.Fire(this, EventArgs.Empty);
            evntMock.Fire(this, EventArgs.Empty);

            Assert.AreEqual("LOVE!LOVE!LOVE!", frm.LovingCSharp);

            // Ensure that all expectations were met.
            MockManager.Verify();
        }
    }

Summary

These are just two examples, and don't even delve into the whole "Natural Mocks" portion of TypeMock.  Do yourself a favor, download the evaluation, they'll give you 30 days of all the features (which you can make any individual 30 days you'd like BTW) and ask yourself why you're jumping through all those hoops just to  be able to mock dependencies.  With this project, you don't have to create dependency injection constructors just to make your classes testable.

Friday, October 19, 2007 10:25:41 PM (Central Standard Time, UTC-06:00)
 Thursday, July 19, 2007

I've just had my first article ever published on ASP Alliance, it covers System.Diagnostics.Debug and methods within it which can improve your code today.  Please go check it out, great content here!

.NET | CSharp
Thursday, July 19, 2007 1:30:46 PM (Central Standard Time, UTC-06:00)
 Sunday, July 08, 2007

To complete my Arkansas trip, on July 3rd I spoke to the Northwest Arkansas .NET User Group and presented my talk "Introduction to C# 3.0".  While there are not any downloads I can offer for that talk, it is all code made up on the spot in reaction to questions about the features, I would like to take a moment to thank them for having me out to speak.  Jay Smith, President of the NWADNUG, was an excellent host and I enjoyed both speaking and hanging out with many of the members at Applebee's after the meeting. If you find yourself in Fayetteville AR, or are ever invited to come speak to this group, you should definitely visit them. 

Furthermore Fayetteville itself is a very pretty town, the trip in up I-540 reminds me what I miss about living somewhere that elevation happens, and there are plenty of great little shops in the area including one of the better board games shops I've run into in a long while.

Sunday, July 08, 2007 1:01:11 PM (Central Standard Time, UTC-06:00)
 Sunday, July 01, 2007

mvplogo.pngI've been visiting Arkansas this weekend, but while reviewing my spam folder I noticed something got caught that shouldn't have.  Specifically the email that informed me I've been selected as an MVP for BizTalk Server.  I'm honored, and appreciate the support of everyone who has made this possible by opening their groups to me to speak.

Sunday, July 01, 2007 9:04:52 PM (Central Standard Time, UTC-06:00)
 Saturday, June 30, 2007

Sonu Arora, who I had the pleasure of meeting at TechEd this year, has just posted on her blog that her team has released an RC (Release Candidate) of the WCF Line of Business Adapter SDK to Microsoft Connect.  In case you don't know, this is the framework upon which Microsoft is building their next generation adapters to systems such as Siebel, SAP, and Oracle Financials.  It is based around extracting meta-data from the LOB application, and works entirely consistently with the WCF channel extensibility model.

If you read my blog and do BizTalk, and even more relevantly do BizTalk and SAP, Siebel, Oracle Financials or other LOB applications, then you'll want to look at this.  Post R2 this would be the recommended route to take if you had a LOB application you needed to integrate with, rather than writing a Custom Adapter.  You'd simply write an LOB Adapter in .NET using this SDK, and then implement with the WCF Adapter for BizTalk.  The benefit there is that the work in the Adapter would be re-usable to other WCF .NET applications and not tied exclusively to the BizTalk object model.

Saturday, June 30, 2007 5:40:49 AM (Central Standard Time, UTC-06:00)

Sometimes the weirdest things come up when testing.  I was helping with some Integration Testing recently, and we needed to submit a new valid postal address with every request to this system.  That's a hefty load to bear, and certainly if I were doing Unit Testing I'd be mocking away that system just to not have to deal with that problem, but for Integration Tests there was no way around it.  My answer?  Public data my good friends.

The quest started with Google, as most do, and a search criteria like this :

City State Zip filetype:csv

Which after browsing for several pages I modified to:

City State Zip filetype:csv site:usps.com

That resulted in the CSV which is the source of the data we're using, a list of Post Offices across the nation.  The list is very long, a total of 19,931 addresses.  Now, it wouldn't be fair to just list the Google queries here, after all this is a technical blog.  I took the CSV apart, removed the irrelevant fields and parsed it into an object to hold address data, specifically this object.

[Serializable]
public class AddressData
{
    private string _Name;
    public string Name
    {
        get { return _Name; }
        set
        {
            _Name = value;
        }
    }
    private string _StreetLine1;
    public string StreetLine1
    {
        get { return _StreetLine1; }
        set
        {
            _StreetLine1 = value;
        }
    }
    private string _StreetLine2;
    public string StreetLine2
    {
        get { return _StreetLine2; }
        set
        {
            _StreetLine2 = value;
        }
    }
    private string _City;
    public string City
    {
        get { return _City; }
        set
        {
            _City = value;
        }
    }
    private string _State;
    public string State
    {
        get { return _State; }
        set
        {
            _State = value;
        }
    }
    private string _Zip;
    public string Zip
    {
        get { return _Zip; }
        set
        {
            _Zip = value;
        }
    }
}

Now if you compile your own version of that code, and create a List<AddressData> you should be able to Deserialize this file of all the addresses for your own use.

.NET | CSharp
Saturday, June 30, 2007 5:20:51 AM (Central Standard Time, UTC-06:00)
 Sunday, June 24, 2007

With my current client I've had a chance to work with the SAP adapter for the first time, which is a treat since most of my work with BizTalk has revolved around HIPAA and EDI.  So I've been working with it for several weeks, and I very much like the delivery of the adapter with one, glaring gotcha which I'll discuss.

The way the adapter works is that you can access any iDoc or RFC from SAP by creating a port configured with identity you will connect with, and then selecting to add items to your solution and select Add Generated Items... and finally select "Add Adapter Metadata".  You can then walk through the process of selecting your port and searching for your RFC or iDoc.  When you've completed the wizard you will have a newly generated XSD schema added to your project.  Happy days, and off you go, until deployment time.

You see, when the wizard walked through that process, for an RFC, it generated an assembly, quietly, in a directory which on most boxes will be : C:\Program Files\Microsoft BizTalk Adapter v2.0 for mySAP Business Suite\Bin.  That assembly is required for the Adapter to work at runtime, and as such must be included in your deployments.  Add to this pickle that the assembly is not strongly named, so you can't put it in the GAC like everything else and life get's really interesting. 

This one caught me completely off guard, and personally I consider this a major flaw in the design of the adapter.  I've now added two new items to my "To Do" list.  First, implement Scott Colestock's deployment framework on my project so I don't have to deal with external resources and the BizTalk "Export MSI" functionality.  Second, learn more about the Line of Business Adapter SDK and the new WCF adapters to systems like SAP that I attended a talk about at TechEd this year.

Sunday, June 24, 2007 4:56:31 PM (Central Standard Time, UTC-06:00)
 Friday, June 08, 2007

I've never been able to get myself motivated to pursue the Microsoft certifications in the past, the value proposition for me as a BizTalk Server developer was never there.  First, for a long time there were no BizTalk certifications, and even once they created such certifications I was never asked about them when pursuing positions.

PearsonVue_logo But some of that has changed, first I now work for a Microsoft Gold Partner and the more certified people they have on staff, the easier it is for them to maintain that status.  Secondly I'm currently engaged in some internal planning and as part of that it was going to be very helpful if I knew just exactly what was required to achieve the BizTalk certification.  Enter TechEd and PearsonVue...

MCTS-BizTalk-Logo On Monday and Tuesday at TechEd 2007 I had some free-time, some by choice because none of the tracks interested me, some because the sessions I wanted to attend were canceled.  PearsonVue had a testing center setup at TechEd and had lowered the exam cost to $50 per test.  That was well within the area at which I could "risk" the money on not passing, so I decided to take 70-235 “Developing Business Process and Integration Solutions by Using Microsoft BizTalk Server 2006”.  I've been working with BizTalk Server since 1999 when I was part of an organization doing Alpha and Beta adoption of BizTalk Server 2000.  I know the product very well, but I still expected to fail because I have always had the impression that the certification exams covered minutia that you would not encounter in your day to day work with the product.  Apparently I was wrong, I passed the exam and in so doing earned the "MCTS: BizTalk Server 2006" certification.

MCTS-Distributed-Logo So since I was pleasantly surprised by what was expected for that exam, I decided to take TS: Microsoft .NET Framework 2.0 – Application Development Foundation, which I also passed.  That exam had allot of asynchronous questions on it, but I did well enough.  So since I was now officially on a streak I went and took TS: Microsoft .NET Framework 2.0 – Distributed Application Development, which I also passed.  That means I've also met the qualifications for "MCTS: .NET Framework 2.0 Distributed Applications".

Finally I did take, but not pass, the Web exam as well.  It contains two question areas that I was weak on, and that was my undoing.  Specifically it contains questions on Mobile web development, and "Deployment Scenarios" which are all about which Wizard/Tool you would use.  Since almost all my deployment scenarios for Web are done manually because I understand what each of the files in the solutions do, I was weak on the tools which publish/copy your site for you.

All in all, it was a good week, and I'm pleased with the quality of the certifications from Microsoft.  It's not going to guarantee you an guru, but it will ensure you've got someone competent at the technologies.

Friday, June 08, 2007 8:30:29 AM (Central Standard Time, UTC-06:00)
 Sunday, June 03, 2007

So I'm wiped.... my first day of TechEd behind me and Party with Palermo complete.

It was a great day, particularly the Pre-Conference training I attended by Jon Flanders of Pluralsight and Richard B. of DevelopMentor.

I learned quite a bit, I already had alot of the basics down, but the more advanced look into what WF could do was great.  In particular I hadn't learned anything about Dynamic Change or custom services prior to this class.

Jon and Richard did a great job, and I'm glad I've planned to attend most of Jon's session for the rest of the week.

Sunday, June 03, 2007 9:40:18 PM (Central Standard Time, UTC-06:00)
 Friday, June 01, 2007

Alright, I'm in final preparations mode for TechEd 2007, if you're looking  to chat or just want to tell me that I'm all wrong about something, then you should be able to find me at one of the following locals/events:

  • Saturday
    • (tentative) INETA Leadership Summit (Only third and fourth sessions due to flight times)
  • Sunday
  • Monday
    • Lots of Connected Systems track classes
    • Moderating the Birds of a Feather : "BizTalk, WCF and WF" at 3pm
  • Tuesday - Friday
    • Lots of Connected Systems track classes

I may also make appearances at other less publicized events ... if you've got a party going on ... let me know.  If you've got a party going on and some good vodka? Definitely let me know.

As usual, Tim@TimRayburn.net will buzz my blackberry throughout TechEd.  Or you can send me a Direct Message via Twitter.

Friday, June 01, 2007 4:56:55 PM (Central Standard Time, UTC-06:00)
 Tuesday, March 20, 2007

I've had a chance over the last few days to play some more with the March CTP of Visual Studio Codename "Orcas" and with the features being added as a part of C# 3.0.  Even while feeling utterly handicap in Visual Studio without CodeRush and Refactor! Pro, I've managed turn out an interesting little assembly that I intend to grow as time goes with the namespace TimRayburn.Extensions.  As you might guess this assembly contains Extension methods to classes within the Framework.

In case you don't know what extension methods are, they are static methods in static classes which use a special syntax to indicate that they extend an existing class or interface.  For instance you might write some code like:

   1: public static string ToStringNullSafe(this object inStr)
   2: {
   3:     if (inStr == null) return string.Empty;
   4:     else
   5:     {
   6:         string lStr = inStr.ToString();
   7:         if (lStr == null) return string.Empty;
   8:         else return lStr;
   9:     }
  10: }

Which extends the class System.Object to contain a new method called ToStringNullSafe which, as you can see, returns String.Empty instead of throwing Exceptions when a the object being called is null or it's ToString value is null.  The intellisense for this looks like the image to the right.

I intend to use TimRayburn.Extensions to contain extension methods which I've written and find useful.  Version 0.1 addresses very simple problems, but over time I'm sure more complex functions will be added.  For now there are two classes in the project FrameworkExtensions and EnsureExtensions.

Framework Extensions contains three methods today.  ToStringNullSafe (as seen above) extends System.Object to provide a ToString method which will not throw exceptions on null.  ToInt32 extends System.String to provide the ability to convert to a System.Int32 inline.  Likewise ToDouble extends System.String for conversion to System.Double.  These extensions are simple and without a unifying purpose other than that I thought they would come in handy.  Nothing being done here, or in EnsureExtensions, that can't be done without extension methods, just easier and more reader friendly code.

EnsureExtensions contains many methods which extend either System.Object, System.String or objects which implement IComparable<T>.  Every method in this class follows the naming convention EnsureX where X is something you would want to confirm about the datatype before using it in code.  The first of these is EnsureNotNull, an extension to System.Object, which checks if the object being used is null, and if it is throws an ArgumentException but if not it simply returns the object.  This allows for interesting pieces of code like:

   1: public void MyExampleMethod(string inputData)
   2: {
   3:     inputData.EnsureNotNull().EnsureGreaterThan("Bravo").EnsureLessThan("Charlie");
   4:  
   5:     // Real code here now that arguments have been checked.
   6: }

The observant among you might notice that this sort of methodology could also be extended to handle NUnit Assert's, and I assure you that has not gone unnoticed by me.  Extension methods may very well provide some interesting Syntactic Glue for many things in the future.  Not rocket science, but very cool, and in my opinion very readable.

You can download the code for this below, though you will need the CTP of Orcas to compile this code.

Download TimRayburn.Extensions

.NET | CSharp
Tuesday, March 20, 2007 10:13:16 PM (Central Standard Time, UTC-06:00)
 Friday, March 16, 2007

The Patterns & Practices division over at Microsoft is starting a Wiki on Team System best practices and guidance and they're using CodePlex to do it.  If your thing is Team System this is a great way to interact with the team by both learning and offering suggestions in their discussion area. (Hat Tip Larkware)

Friday, March 16, 2007 11:56:14 PM (Central Standard Time, UTC-06:00)

So after many hours of downloading I've acquired the March CTP for Orcas and have it running both at home and at work under Virtual PC 2007.  I decided to jump into LINQ as I'm entirely jazzed about this but one of my first few experiments with it, while a little unorthodox, has me scratching my head a bit.

Consider if you will the following code, which retrieves a list of all files in the root folder of the C drive and then, using LINQ, selects a set of them at random using the FlipACoin method.  Then I iterate through the list, outputting the contents of the results of my query ... or so I thought.

   1: using System;
   2: using System.Linq;
   3: using System.Collections.Generic;
   4: using System.Text;
   5:  
   6: namespace TestConsole07
   7: {
   8:     class Program
   9:     {
  10:         static Random rnd = new Random();
  11:  
  12:         static void Main(string[] args)
  13:         {
  14:             var myList =
  15:                 from f in System.IO.Directory.GetFiles(@"C:\")
  16:                 where FlipACoin()
  17:                 select System.IO.Path.GetFileName(f);
  18:  
  19:             Console.WriteLine();
  20:             Console.WriteLine("First Loop");