posted on Monday, June 06, 2005 9:29 PM by roydictus

Sessions at Tech-Ed today: Exception handling, Mobile Development, Software Factories and Smart Client Architecture

I went to a number of Tech-Ed sessions today of course, some more interesting than others. DEV320, about Exception Handling Best Practices, I found really rather basic (of course it was a level-300), talking about the obvious practices of avoiding having to throw and catch exceptions when they're not really necessary, the cost of exceptions, rethrowing exceptions etc. The presenter did a good job of explaining these basics. He should know them pretty well, as exception handling is one of his priorities in the CLR development group.

Windows Mobile Development

Then there was the Windows Mobile development cabana talk -- a soft of informal talk targeted to a smaller audience -- which was kind of interesting. A couple of topics were covered such as developing using the emulator images (you can develop for Windows Mobile 5.0 now here at Tech-Ed; the emulator images for this new OS are available in the Hands-On Labs), using mobile controls in ASP.NET applications and the use of SQL Server Mobile (the new name of SQL CE) for database-oriented smart device applications. The coolness here is that you can synchronize and replicate SQL Server databases between your desktop/server and smart devices directly via ActiveSync.

Software Factories

One of my favorite topics as of late: software factories. The basic idea is that you find patterns in your software projects and pour them into a “factory,” i.e. a collection of code templates, configuration presets, reusable blocks etc. so that you can generate parts of your new applications automagically. The talk gave an introduction to software factories and there was a live demonstration of using a factory. If you're going to one of the international Tech-Ed events and you're into software architecture, this session is not to be missed!

The way Microsoft envisions software factories in Visual Studio 2005 is by using that tool's support for DSLs (Domain-Specific Languages and the upcoming Guidance Automation Technology, or GAT.

DSLs are abstractions of given problem domains and the solutions to those domains -- or rather, your solutions. You can compare this roughly to UML in sense of notation (class diagrams, use cases etc.) of the problem and the solution, through patterns. Visual Studio 2005 comes with designer support for DSLs and you can even create them programmatically using the DSL SDK. GAT then provides a “recipe“ infrastructure for building your apps step by step, as a set of Visual Studio extensions.

Basically, you open an application recipe (a software factory) in Visual Studio, you design the flow of your solution as a state machine on a drawing canvas in Visio/Rose style, and you connect the missing parts by filling in the code that does actual work. Some of the code will be generated by the DSL system based on templates (compare to CodeSmith and ASP.NET, because you're embedding code that must be run at code generation time between <# ... #> and <#= ... #> tags).

The speakers demo'ed building an application that allows users to complete an order. The code they generated used the UIP Application Block to manage how users navigate from one screen to the next, which is of course the smart thing to do. When data needed to be retrieved from a back-end system -- a web service of course -- they created a Web Reference proxy as usual and added a caching Service Agent on top. Data would only be retrieved from the back end if it was not already in the service agent instance's cache. And, yes, the service agent was auto-generated too, again based on a code template and some input from the developer. The generated code used the Caching Application Block. As Darth Vader would say, “Impressive... Most impressive!“

Yes, you can do it with other tools too

Of course, the basic ideas here are not new. You can use Visio templates today to come up with reusable general designs; you can use tools such as CodeSmith to generate code based on templates, including code that uses the Enterprise Library and the other Application Blocks. But in Visual Studio 2005 and the extensions these gentlemen demonstrated, it's all so nicely integrated with the IDE and wizards and designers make it much easier, saving us developers and architects time.

Software Factories are the Architect's Domain

I think that consuming software factories is for developers and that creating them is mostly work for the Solution Architect and the Senior Developer, based on code written in previous projects. It is their job to spot patterns in the enterprise's software designs and needs, and to extract those into a set of reusable factories and application blocks. Moreover, I think that while software factories are definitely another step in the right direction towards delivering 4GL's promise, the common problems related to reuse will resurface with factories: are people going to spend time to write code and create templates and factories that are actually reusable, and will they actually be reused? From experience I have learned that this is only true if reuse is enforced on the team by the Solution Architect, who must posess strong reuse and mentoring skills to drive this point home and to actually get it used by the rest of the team...


Smart Client Architecture

The final session I attended, or at least entered before I left 10 minutes later, was the one on Smart Client Architecture. This subject is “totally my bag,” to quote Austin Powers, and again I felt as if the presenters were dissing up old material that anyone can find in the Patterns & Practices materials. Anyway, I left the session quickly without waiting for any potential juicy bits to appear because I got tired of listening to the Buffalo Bill-soundalike onstage...

Well, I'm off to the reception now. Talk to you again tomorrow and keep those comments coming :-)

Comments