Saturday, July 03, 2010

We Reap What We Sew

...and I have sewn the seeds of a marriage to a tool that no longer provides adequate functionality.  All throughout DataClass, I coupled directly to Microsoft's CodeDom framework.

The following were my excuses for not encapsulating this stuff:

  • What a convenient way to model the code I want to generate.
  • It's just data.
  • It's part of the framework, I can trust it.
  • It will be easy to add support for Java because this is a language-independent format.
Bull...

...shit.

All of it.

Microsoft screwed us all over by getting rid of the J# code provider.  The C# code provider ought to work just fine with some small extensions but it is almost impossible to extend.  Bottom line, I'm having to write a working code modeling library; albeit one that only meets my needs.

They also gave .net eventing - a bastardized, incomplete, attempt at generically implementing the Observer pattern - a "little overhaul."  Translation: the way that you depended on these things working (crappy though it was) is no more.  Fortunately, I avoid those like the goddamn plague.

The bottom line, here, is this: If you didn't write it, don't trust it.  I'm not saying that Microsoft is likely to deprecate System.Int32 any time soon but you cannot count on them not changing something about how it works.  Encapsulate, encapsulate, encapsulate.

...or you will be sorry.