-
I spent last night commiserating with my friend Denny Boynton and a couple of Computer Science students who are attending the Mix conference in Las Vegas. The discussion eventually came around to a critical evaluation of computer science curriculum available to students in our colleges and universities. The conclusion we came to is that we’re just not paying enough attention to instilling good software engineering principles in our future developers.
Most students aspiring to have a career in software development are going to end up slugging line of business code for their employer some day. A few others will be the developers of our future operating systems, compilers and server software. Why is it then that we teach them all the same way? You might argue that the average student doesn’t know where they will end up post-graduation and that we should take the opportunity to create well-rounded students who have a depth of knowledge about low level computing semantics as well as high level languages and abstract design concepts.
I believe the problem with that logic is we’re missing the boat on instilling good software engineering practices in our future developers before they get into the bad habits most of us in the field have struggled to overcome. Kids coming out of school today study compiler theory and operating systems. They know how to create a database schema and they might even have some experience writing PHP code or building RIA’s with Flash. What they are lacking is the knowledge they need to to apply patterns to their work or to create new patterns for others to apply. They don’t think about bullet-proofing their systems before they start writing business logic. These are skills that they learn on the job – mostly through trial and error. I’m pretty sure that I don’t want the developers at my bank figuring it out as they go.
There are a million ways to solve this problem and I wrote this post more for awareness than anything else. This is probably the most ignored issue in our industry and it’s something we as the stewards of the craft need to start discussing.
-
I was playing around with a WPF app I'm writing for a friend and discovered a need for a single user control to exhibit two distinct sets of behaviors. In practical terms I wanted the user control to display contact data for an individual and a business even though these two entities have unique sets of properties.
I've seen some posts in the WPF forums where people have tried, with varying levels of success, a variation on WinForms forms inheritance using XAML. Having little patience and an aversion to complexity I avoided that approach and jumped into the code-behind for my user control. What if I simply created a new class for each of my entities that simply subclasses the user control? It worked like a charm.
This is a simple matter of exploiting the WPF type system. When I create an instance of my user control in XAML I specify that I want the control to be an instance of one of the derived classes; in this case OwnerContact. WPF understands that OwnerContact is just a class that is derived from ContactInfo, which is the implementation associated with the markup found in ContactInfo.xaml. WPF is able to reach into the base class to extract the information necessary to render the control.
This capability leads to all kinds of possibilities for manipulating the behavior of visual elements in an application. I haven't had a lot of time to play around with this discovery, but I'll follow up this post with some tips and tricks for exploiting this feature in cool and interesting ways.
Technorati Tags:
WPF,
XAML,
Inheritance
-

There's nothing like a congregation of geeks to get the emotions stirring. I sometimes get so caught up in my real job that I forget how much fun it is to be a developer. The Day of .NET events taking place next month in Ann Arbor and Grand Rapids are all about reminding us that it's cool to write software.

We have been honored with not one, but two learning events for .NET geeks, fanatiacs and militants. Even the mildly curious are welcome to attend. Come hear from local .NET luminaries such as Josh Holmes, Keith Elder and our own 'Dancing' Drew Robbins.
See you there!
Ann Arbor Day of .NET Registration
Grand Rapids Day of .NET Registration