Wednesday, September 12, 2007

Maybe we CS guys are getting a little too cute?

It's been around a while, but the term "duck-typing" in the rhelm of dynamic types leaves me a bit uneasy for some reason.

Who the hell am I?

I was reading my good friend's blog and he had taken a personality test at the request of one of his friends.

During a bit of down-time at work today, I thought I'd take it as a lark. I also tried as hard as I possibly could to honestly access the questions and give the most honest answer I could. In several instances, I was a bit embarrassed with myself. I've always considered myself as not very "touchy-feely", it seems I "feel" through things a bit more than I wanted to admit. Seriously though, I thought I'd have more than 0% on the feeling side of the "Thinking-Feeling" scale.

Shit, I could be Dexter.

Click to view my Personality Profile page

Of course, an organization measuring your personality won't tell you that you have the same personality as some total douche bag but it does say that I have the same personality type (INTJ - Strategist) as Hannibal Lecter.

That's two serial killers mentioned wtih my personality type post...

Perhaps my family and friends should be a bit more wary of me.

Wednesday, August 29, 2007

So, it ain't "technical"...

...it's a gripe.

I recently ran into a situation where I needed to interface to a Win32 API style dynamic link library (DLL). Since most of the work I do is in a managed environment, I had to write a way to "thunk" into this older library.

I first wrote an Active Template Library (ATL) COM wrapper for the library but because of even more aggravating reasons, I had to abandon that project. I've written literally dozens of these ActiveX server wrappers for calling older code from .NET so I assure you, the aggravation factor was high.

So, the next best thing is to access this older DLL using the platform invoke (P/Invoke) mechanism of the .NET runtime. Being a typical programmer and laziness being truly a virtue in our profession, I didn't want to write all the P/Invoke function signatures by hand. Not to mention all the constants and enumeration declarations.

So, I finally decided to drop $60 on a tool that I'd seen a while back called the "P/Invoke Wizard". Since I have all the source to the target DLL, it'd be easy, right?

WRONG!

I go ahead and do the online purchase (from another software professional) and expect to be emailed my registration key. Only to discover, at the end of the purchase that they will email my registration code in 1 to 2 days after some one verifies the purchase.

Are you fucking kidding me? How hard is it to do online credit validation these days? So, I get to wait until "whomever" at that office decides to send an email.

The tool itself is very useful, I'm certainly not bitching about that. I'm not even bitching that it could take 1 to 2 days to get my registration code (although, that is a bit of an annoyance). What I am bitching about is the fact that I didn't know about the 1 to 2 day delay until after the purchase was completed.

Bitch fest off now... Just needed to vent a bit.

Uh... What's this blog thingy?

OK, you've got me. I've been a total slacker on this blogging shit.

I read the blogs of friends and continuously marvel at the amount of creativity and thought they put into those blogs. Me, on the other hand... Nada, zip, nothing.

I have no excuses, I don't have to be creative - most of my content is technical. I do have new things to post, I've been working with Windows Communication Foundation of late and have learned considerably more about the Microsoft patterns & practices Enterprise Library. My development project has upgraded to the Enterprise Library 3.1 (previously we were using 2.0).

Stay tuned, I'll eventually say something interesting.

Friday, March 30, 2007

Excuses

Here I am over a month into my blogging experience and I'm already slacking off. I still owe a few colleagues an article on using XsdObjectGen with the XmlSerializer and the common problems that arise with non-trivial schemas.

Work is just consuming all my time but I promise to get new posts up soon!

Thursday, March 15, 2007

Busy, busy, busy...

I know I promised to post a couple times a week but the new project at work is consuming huge amounts of time on the front end. I've spent the last 3 days in the bowels of the System.Xml.Serialization.XmlSerializer and an object model that I "auto-generated" with XsdObjectGen.

The whole XmlSerializer ordeal has provided me with enough information for another post but it will be a few days before I can get that edited and put up for all to see.

On a positive note, I got email from Brian Button and I might be able to get some great help on the ENTLIB part of my work project.

Friday, March 2, 2007

Microsoft Enterprise Library

(This post is a work in progress... I just needed to get an answer up quickly for several friends.)

Finally, something of moderate substance.

At work, I am actively promoting the Microsoft Enterprise Library (ENTLIB) for the project I am currently working on. I've now been asked, "What is the ENTLIB?", enough times that I decided to answer that question here as it's not a "quick answer". If the link I've provided is too much, here's my attempt at a simple description.
The Microsoft Enterprise Library is a pool of source code written by Microsoft and made freely available to developers. The source in the ENTLIB represents the collected "best practices" recommended by Microsoft for using the .NET Framework to implement enterprise solutions.
That's the short answer most people want.

It's technically correct. It's also totally useless. It's not informative enough to really let you know what you are in for if you use the ENTLIB. So, I'll pick the description apart and explain. Examine this diagram from the ENTLIB documentation:

  • "pool of source code" - Actually, several pools logically organized into Application Blocks in ENTLIB terminology. The application blocks that are part of the ENTLIB are depicted in the diagram.
  • "written by Microsoft" - While this may not mean anything to you, it is significant to me. These guys probably have more development expertise in .NET than I do. I know they have more development budget than I do and probably anyone I'm ever going to work for.
  • "freely available" - Yes, Virginia, Microsoft does engage in open-source development.
  • "best practices" - Unknown to many developers, Microsoft tracks good work and tries to capture best of breed projects and implementations. Many of these best practices' artifacts are freely available at the Microsoft patterns & practices Development Center website.

But just getting started can be daunting! Where do you start the learning process? I'm not an ENTLIB expert but have formed an opinion on where to start.

  1. Understand the ENTLIB configuration system. I can't over stress the importance of configuration and meta-configuration data in the ENTLIB. This used to be an application block prior to the .NET 2.0 Framework release. The System.Configuration namespace now subsumes much of what was previously in the ENTLIB configuration application block. Many books and articles still refer to this core system as an application block.
  2. Understand the ENTLIB configuration system - Damn it!
  3. Understand the object injection model. The "core contains the ObjectBuilder", this is a configurable (everything in ENTLIB is configurable - see step 1) object creation pipeline. In my opinion, you don't need to know every detail of the ObjectBuilder but an understanding of your object instantiation is essential.
  4. Finally, concentrate on the specific application block of most use to your application. Perhaps data access is most important to you, or cryptography, or logging and exception handling.

Clearly, everyone learns differently and your mileage will certainly vary. The steps I outlined just worked best for me.

Related P&P Projects

To the best of my understanding, the ObjectBuilder was actually designed and implemented during the Composite User Interface (UI) Application Block project (referred to as the CAB) . The ObjectBuilder was so useful, it was refactored into the ENTLIB.

Why is that interesting? Because the CAB is sometimes mistaken as part of the ENTLIB. It's actually a custom application block written using the ENTLIB. Since the ENTLIB and the CAB are both Microsoft projects, the refactoring of ObjectBuilder into the ENTLIB was logical.

ObjectBuilder, while shown as part of the core is actually an application block. The ENTLIB documentation notes:

ObjectBuilder is a patterns & practices Application Block, but because of its highly specific audience and its recent inception, it is not yet fully documented as a stand-alone asset like the Enterprise Library application blocks are.

The CAB seems like a perfect candidate to have that classic Visual Studio "wizardry" in order to add new CAB "thingies" (Since, this article is about the ENTLIB, the full description of the CAB is left for another time, for now, "thingies" is all I'm willing to say.). That leads us to the Smart Client Software Factory.

The Smart Client Software Factory, is a collection of code-generators, how-to examples, Guidance Automation Toolkit (or GAT), and documentation for creating "smart clients".

What's the GAT??? It's a toolkit to let software development kit (SDK) developers like me add guidance toolkits to Visual Studio using the Guidance Automation Extensions (GAX).

What the hell is the GAX?!?!??!?

It really does take a bit of commitment on your part to go learn the ENTLIB and the related projects that spring up around it. My advice is to download the ENTLIB, play with the quick starts and guidance, read the documentation, buy a book, and just dig in and write a client or your own application block. In my opinion, it's certainly worth the effort.

One last question... Who is John Galt?

Wednesday, February 28, 2007

"That's elegant."

More often than not, it isn't.

E=mc2, that's elegant.
F=ma, that's elegant.

In science and engineering, elegant generally means "simple, obvious and effective".

Last night, I was reading the book Essential Windows Workflow Foundation and began to think, "I need to understand this... Boy, I hope they don't use the phrase 'elegant solution' in reference to their own work. I need to know this and if they go there... I won't be able to finish the book."

Granted that's a pretty drastic reaction to a pretty simple phrase. Windows Workflow Foundation (WF) is a great idea and a much needed step in the right direction of software development, but it's pretty complex.
Before my non-Microsoft development brethren pounce on me, I know it's not a novel idea either.
So, why my vehement stance?

Easy. The word "elegant" is horribly overused in science and engineering. Going back to around 410 BC the word elegant can be applied to maybe 20 solutions. While we can debate the number of insights, inventions, theories, and solutions that warrant the word elegant, what is not up for debate is that we (scientists and engineers) have lost sight of what constitutes elegance.

I know I'm going a long way to rant about the subjective use of a single word. Perhaps my immature idealism gets the better of me sometimes.

Start! No, really... start.

One of my long time friends made the comment that he and I may be in a contest to see who "fizzles out first". Being a person who knows me pretty well, his comment was more of an observation.

Most of the people I know, also know that I have a great history of ideas that get explosive starts but lousy finishes. In my own defense, it's not that I'm lazy, it's because once the initial problems are all solved, I'm pretty much satisfied that the remainder of the execution is an "exercise for the reader".

I'm going to make a committed effort here to maintain this blog on, at least, a semiweekly basis (2-5 posts per week). Given the way I work (my friends also know I have the attention span of a meth-addicted ferret) I could easily have 2-3 posts one day and go silent for a week.

Because I'm a computer programmer, much of what I post will be software related. It's the only thing I can talk about and seem intelligent. I won't limit my blogs to the topic of software development though. On rare occasion, I do have things to say on other topics.

So, as a classic fast starter, slow finisher, I accept the gauntlet thrown down by one of the best software developers I've ever met. Thanks, man. Maybe I'll stay motivated.

Wouldn't it be funny if you're reading this 8 months after I post it... And it was my last post?
(NOTE: I'm also officially pissed that he thought of the name "Tardy Pessimist" and I didn't.)

Tuesday, February 27, 2007

Big things I miss...

I'm sure that all my developer buddies have been using the Class Diagramming feature of Visual Studio 2005 since, well... 2005. Somehow this really cool feature totally eluded my notice. I discovered it almost 90 seconds ago. Gee, thanks guys for pointing it out.

Monday, February 26, 2007

Blogging?

You know, these used to be called "journals".

No matter what they were called, I'm yet the next Johnny-come-lately, to make the statement - "I'm late to the blogging game". Since so many people are certain that the rest of us are interested in the minutiae of their lives, I'm certain you are interested in the minutiae of mine.

Before I really get started, let me point out that it's not a question of "if" you will find objectionable content in my blog but "when" you will find it. Like all other forms of media, you're welcome to change the channel.

I've actually been blogging for years about the one subject matter that I actually have any expertise on - software development. I just used a horribly antiquated technology called email. Therefore there's no nice, pretty, discussion-style record of it. Of course that assumes any of it was ever worthwhile which is a totally incorrect assumption.

Anyway... I'll be trying to log the progress I make on various projects I'm working on and technology topics that I'm interested in. On occasion, I'll get someone to check my grammar.