Introduced in the 2009 edition, this year’s Microsoft Developer Days is again offering wildcard sessions to anyone who posted a proposal on their Facebook site. Obviously I posted a proposal as well, and partly thanks to the community and partly because there were only eight proposals, my proposal is now available on the DevDays site for voting. Support me by going over here and voting for my session.
Monday, February 01, 2010
TFS Development Practices Part 2: Peer Reviews
What is it?
A formal review of all code and artifacts related to a requirement or task by another person than the original developer. Rework because of review comments must be revalidated afterwards.
Why would you do that?
- Because the average developer
- introduces 10-50 bugs per 1000 lines of code (at least, according to Moore’s Law)
- is not always aware of the potential pitfalls of particular code constructs (hence coding guidelines)
- is not always up to date with all available constructs in a new C# version
- does not have full awareness of all the out-of-box solutions offered by the .NET Framework, open-source sites or commercial vendors
- often does not realize that an ingenious and elegant solution may be too complex to understand by others.
- sometimes loses sight of the overall solution and the initial goal when working on a some piece of code too long.
- Because it helps improve the awareness of, and the understanding behind your company’s coding guidelines.
Notice that the amount of necessary review work can be reduced by introducing the Pair Programming practice.
What’s the bare minimum you need to do?
- Find issues in the interpretation of the functional requirements.
- To verify compliance against your coding guidelines or standards.
- If you don’t have one, consider the Aviva Solutions C# 3.0 Coding Guidelines. Notice that these are an extension to Visual Studio’s Code Analysis, so the latter is still worthwhile.
- To find any loose ends such as TODOs or incomplete code. Resharper 4.5 includes a nice tool window that quickly shows an overview of all TODOs in your current solution. Resharper 5.0 even includes solution-wide analysis that finds dead code.
- To ensure that all code is easy to read and understand. For instance, all members and types have a comprehensive name and non-trivial code is annotated with code comments.
- To ensure that each and every check-in improves the code base, rather than introducing software rot.
What’s the usual thing to do?
- To ensure that all naming of code elements matches those of the functional design, preferably using Domain Driven Design’s Ubiquitous Language.
- To check for the usual pitfalls such as God classes or methods that are way too long.
- To find any redundant code or code that is unnecessarily complex and requires refactoring.
- To find any code constructs that may put other developers on the wrong foot and therefore jeopardize future maintenance.
- To find code constructs that can be replaced with a simple call to a previously developed generic class or .NET Framework construct.
- To stimulate the use of design principles such as S.O.L.I.D. or the design patterns defined by the likes of Martin Fowler and Eric Gamma so that the overall code quality increases.
How do you do that?
- It is important to make sure that all files related to a particular piece of functionality can be easily found. Use a Check-in Policy to associate each and every change with a corresponding work item such as a Scenario, Task or Bug. Since a major change may involve multiple check-ins, especially in a larger team where multiple developers work in the same areas of your code base, Change Sets provide insufficient traceability.
- Use a logging form or something similar to review every piece of code related to a particular work item and store it on the project’s team site.
- Alternatively, copy and paste the code into Microsoft Word, and use its reviewing features to annotate the code with comments and improvements.
- Or even better, install TeamReview and its corresponding Review Response work item and add review comments directly from inside Visual Studio’s code editor, while keeping them together under the associated work item. Also check-out this poster illustrating the underlying review workflow.
Tuesday, January 19, 2010
Software Development Practices from the Real World; On Repeat
On Saturday February 27th, the Dutch DotNED user group, Aviva Solutions and Oosterkamp Training & Consultancy will be hosting a full day session on software quality. The session will be mostly held by myself, but I will be accompanied by my colleagues Jonne Kats and Peter Hesseling.
Unfortunately, due to popular demand, the session was fully booked within 24 hours. But now, we are seriously considering repeating the session in the beginning of April. So if you’re still interested, go to the DotNED registration page and click the link at the bottom of the page to send us an email.
Friday, January 08, 2010
Storyotypes in Visual Studio 2010
Storyotypes are stereotypes for user stories that can help to define the right scope for your user stories. You can read more about these in the article Using Storyotypes to Split Bloated XP Stories and these slides. Team Foundation Server 2010 includes a new VSTS for Agile process template closely following the Scrum practices and supporting a user story WIT. However, Storyotypes are not supported, so I decided to change the standard work item template to add that field.
You can download the modified WIT template from here. You can install them into an existing project using the witadmin.exe tool (available if you open a Visual Studio 2010 Command Prompt), but it’s much easier to use the TFS Power Tools.
Monday, January 04, 2010
TFS Development Practices Part 1: An Introduction
As part of my many assignments, I’m compiling a bunch of best practices into a set of development guidelines for bootstrapping our internal projects using TFS. I’ve decided to share these with the community so that others may benefit from it as well. Beware that these practices are not new nor in any way invented by myself. I'm merely trying to get some good resources together in a nice compact format.
So what are my goals?
- To provide insight into the benefits of applying well known best practices on software development projects.
- To provide examples of applying those practices on new and ongoing projects and explain how to gain the most of out them.
- To help you jumpstart a new project or professionalize running projects.
And what do you gain?
The goal of these posts is to end up with a set of development practices that provide the following benefits:
- Allows you to more quickly and accurately assess the impact of new requirements.
- Promotes building well designed software that allows changing functionality with lesser risks (even during a running project).
- Promotes a consistent code-base that solves similar problems using similar solutions, everywhere.
- Strives for a functionally consistent software system. For instance, ensuring that date fields look the same all over the application).
- Attempts to prevent code duplication so that you never have to make changes at multiple locations if you change a particular piece of behavior or logic.
- Eases the effort for deploying a new release by removing as many human actions as possible.
- Provides traceability on where a particular piece of functionality has been realized technically.
- Improves the developer experience when working on an existing or shared code-base (e.g. readability, purpose and goal of a block of code).
- Provides a safety net that reduces and possible prevents the chance of running into regression problems.
- Attempts to prevent common mistakes or misinterpretations by introducing common rules and recommendations.
- Strives to a situation where each and every member of the team is aware of the project’s affairs.
- Promotes any endeavors that improve the self-education and self-organization of teams.
Sunday, November 22, 2009
The ups and downs of the final PDC 2009 day
In addition to the WCF 4.0 session I blogged about earlier, I also attended some more sessions. The first one, Hybrid Cloud Computing with Azure and the Service Bus by Clemens Vasters was quite cool. One of the challenges that you may have if you move only a part of your system to an Azure server , is how to communicate with your on-premise systems. His team wrote a nice tool called the Port Bridge that you can use to create a very efficient secure tunnel between the cloud-based website and the firewalled on-premise application server or database. It understands many of the protocols and can tunnel both TCP/IP as well as Named Pipes. Check out a more detailed description on Clemens' blog.
I then continued to the Workflow Services and Window Server AppFabric session, but left halfway. The speaker was British and had a horrible accent that made it very difficult to follow him. Anyhow, in addition to the WCF statistics, AppFabric's IIS extensions also provide in-depth information on the whereabouts of individual Workflow instances and its contained activities.
After the lunch, I dropped in a XAML/Silverlight Futures talk, but left after ten minutes because it was only dealing with advanced XAML parsing. I then moved to the Mastering RIA Services session but was disappointed as well. The first half hour was just an intro of what happens under the hood, followed by some best practices. However, the term "mastering" was rather misleading since it never touched the advanced topics I was expecting. Definitely not on par with the remainder of the PDC sessions.
I concluded the day with an awesome talk on all the aspects Team Foundation Server 2010 offers for getting a piece of functionality completely done. It included aspects such as gated check-in, automatic deployment, and managing your entire test lab using the System Center Virtual Machine Manager and the Test and Lab Manager. The host, Brian Randal, is a very good and enthusiastic speaker. I attended his full-day pre-conference session on last year's PDC.
As of now, all sessions should be available in normal quality as well as HD from the PDC website here.
Friday, November 20, 2009
Routing and service discovery in WCF 4.0
This year, the PDC 2009 lasts only four days (if you include the preconference day) so today I tried to attend as many sessions as possible. It's amazing to see how fast this week passed by. And I don't know how Microsoft does it, but this PDC has been full of novelties and amazing moments (and with that I'm not even mentioning all the social aspects of such a conference).
For instance, when I decided to attend a WCF 4.0 session, I didn't expect to see so many improvements and innovations, First of all, they've significantly reduced the amount of configuration needed to get your services running. Default bindings and behaviors, inheritance of bindings and behaviors, and listing services in the web.config rather than individual .svc files all make configuration easier. Another improvement is the advanced health monitoring and tracing functionality that they’ve integrated in the IIS manager. This takes the form of a dashboard providing live information on the WCF services running on a server, including extensive visualization and deep diving features for analyzing what is really going on in your service. So you no longer need to fiddle with configuration settings in the web.config to get some tracing.
Another new feature is service discovery. I'm not really sure what happened with the UDDI protocol, but in WCF 4.0 they’ve introduced new behaviors that will make your service discoverable through an UDP multi-cast network package. Using the new DynamicEndPoint class you can simply provide the contract definition of the service you're looking for, and WCF will look for a running service on the network. Really cool. And it supports both this kind of ad-hoc discovery as well as managed discovery facilitated by a dedicated discovery service running somewhere in your company.
However, the most impressive feature of WCF 4.0 is the built-in routing service that you can host just like any other service. Its feature set includes a routing engine that uses customizable filters to determine how to route what service operations to which service. It also has built-in support for bridging different transport/bindings, different SOAP versions, and even handle different authentication mechanisms. In addition to that, it can automatically reroute messages to an alternate endpoint if the preferred one is not available le. And finally, even though I'm against distributed transactions, the transaction scope will flow over the routed channel.
Thursday, November 19, 2009
Silverlight, Silverlight, Silverlight...and laptops
On the second day of the PDC, Scott Guthrie announced the release of the first beta of Silverlight 4. Well, I've been expecting Silverlight to replace WPF as the first-choice for line-of-business apps for a long time, and I was right. The number of new features is overwhelming. Just look at this comprehensive post written by Tim Heuer to get definitive prove. And as part of this release, they've renamed the RIA Services framework to WCF RIA Services and included it in the Silverlight 4 SDK. Check out this post to get some more info on what has changed since the last CTP. I spend the remainder of the day attending every Silverlight 4 session available. I'm so looking forward to using this in a real-life project.
One thing all attendees noticed this week is that the PDC was going through a crisis as well. There was no free breakfast, no party at Universal Studios and even no gadget. Well, the PDC organization has compensated for that big time. How? Well, because during the keynote, Steven Sinofsky announced that every attendee will receive a multi-touch convertible Acer Aspire 1420P tablet pc for free. Now that's what I call an awesome gadget! And it is fully installed with Windows 7, the Office 2010 beta and some nice showcase tools for its multi-touch support. I can tell you that the audience went wild when this was announced.
TDD and BDD at the PDC 2009
In addition to the usual hot-of-the-press content, the PDC organization also introduced a new way for attendees to contribute to the event. They call it a birds-of-a-feather session where attendees can propose a subject and host a discussion in one of the break-out rooms. Obviously, I filed a proposal on one of my favorite subjects TDD and BDD, and unlike my expectations, I was actually selected as one of the proposals.
Well, yesterday, the first day of the PDC, it finally happened. At 16:30 I went to room 309 and found it exceeding its full capacity of 120 people in no time. Apparently, automated testing and Agile practices are just as hot in the US as it is in Netherlands. I started the sessionwith an inventory of questions people would like to get an answer to. BDD was important, but after a short discussion I got the impression that most attendees did not yet really grasp the essentials of TDD. But since it was a discussion session, Ididn't want to take control and explain it to the audience myself. Instead I tried to let individual attendees explain it to the rest. Unfortunately, since many interpretations exists, that didn't really work. I tried to steer the discussion to get a clear understanding of it, and I made sure I added my two cents as well, but I'm quite sure some attendees still left the session with some unclarity.
Nevertheless, a small group of developers kept lingering at the room's exit and we've been continuing the discussion for almost an hour. So from my point of view, it was a big success. Even if they did not all grasp the concepts and ideas behind TDD, they sure have been triggered to read more about it.
Wednesday, November 18, 2009
First day at the PDC 2009
After waking up at 5:00 in the morning for the third night in a row, Tuesday was the first day of the PDC conference itself. As is common for any Microsoft conference, the first keynote is usually a bunch of marketing stuff, and this one was no different. Nevertheless, if you have watched it from the PDC site, you will agree that this whole cloud thing cannot be ignored anymore. I have to make sure I'll attend one of many cloud sessions in addition to all the architectural and Silverlight talks.
The keynote was followed by a talk by the team-formally-known-as-the-Oslo-gang, Chris Anderson and Don Box. It started with a short intro on the Entity Framework 4.0 which helped me confirm the ideas I've been forming for my next SDN talk. Right after that, they introduced the OData protocol that allows virtually any application and framework to exchange data. And while doing that, they used Quadrant as a 'nice visualization tool for showing data'. I really wonder what happened with all the Oslo tools and frameworks. One cool thing about OData is that you can retrieve the metadata in EDMX-format from any OData-compatible data source, even a Sharepoint list. By simply providing the URL to the data source in the Add Service Reference dialog of VS, it will generate code in similar way the Entity Framework does for you now.
The remainder of the day was filled with an additional EF4 session which didn't reveal anything new for me, some tips and tricks on Blend 3, and some nice demos showing some of things they have in mind for the next version of ASP.NET.
The official conference day was finalized by a moderate party in the main lounge amongst the many exhibitioners such as DevExpress, Infragistics and Telerik. Thomas was tired, but Ronald and I concluded the day with a drink in the Saddle Ranch at Sunset Boulevard.
Silverlight 4 Beta available now
During the keynote of the second day of the PDC, Scott Guthrie announced the first beta of Silverlight 4. What we already knew for a while is becoming true: Silverlight will replace WPF for most line-of-business apps. The release is scheduled for the first quarter of 2010.
Checkout the announcement page for more details and the download links.
Tuesday, November 17, 2009
Between fun and work
On Monday, we drove back from Las Vegas while doing a quick stop at another factory outlet mall and another stop at the local Frys electronics shop. Las Vegas was sunny but really cold (about 3 degrees Celsius) so we where happy to be back in LA and enjoy a nice 20 degrees. We left quite late in the morning so it was already 15:30 at the time we entered the LA zone again. We didn't have lunch yet, so we decided to continue to the Santa Monica area. But because of the traffic, at the time we parked the car near Santa Monica blvd, we decided that a light dinner was better. Santa Monica is a very nice area which I think could live in without any issues.
Because I was supposed to be at the PDC conference center at 19:00 for a meet-and-greet with the Birds-of-a-Feather organization, we didn't have a lot of time to linger over there. In fact, because of the traffic jams I barely managed to be on time. No, not barely, but not at all!. Apparently, Outlook screwed up the time zone differences and put the meeting request at the wrong time. I had to be at the conference center at 18:00 instead of 19:00! When I entered the room at 18:50 the audience made some funny comments which I didn't get initially. Only when they wrapped up the meeting five minutes later, a proverbial light bulb popped up. Fortunately, the guys from the organization were willing to summarize the most important hints and tips, and I joined them on a walk to Palarmo's Party at The Mayan a few blocks from the conference center.
The party was fun, but not as crowded as last year which is probably caused by the fact that there so few Dutch attendees :-). We left at around 21:30 to go to the rooftop bar of The Standard, but that appeared to be a bit boring as well. So after grabbing a bite from the local Subway we finalized another fun day in California.
Viva Las Vegas
Since we were in LA anyway and they rented a convertible (particularly a Chrysler Sebring), Thomas and Ronald suggested to drive to Las Vegas on Sunday and return on Monday. So we went on a road trip to the City of Sin. It takes only 4,5 hours to drive there and there are plenty of Starbucks along the road, so we actually had quite a lot of fun driving there. We stayed at the Stratosphere hotel which is well-known for its 350-meter high tower. I have a slight problem with heights, but we did go up and enjoyed a spectacular view from the open balcony. Quite a challenging endeavor since the tower is actually swinging back and forth all the time.
We spend most of the day trawling along The Strip and getting surprised by the awesome hotels. Especially The Venetian is really impressive. They've essentially duplicated large parts of Venice, including a really impressive indoor canal where the roof looks like an genuine open sky with clouds and all.
Unlike the rumors, Las Vegas is less hysterical than I expected. Obviously, you'll find casinos everywhere (and with everywhere I mean everywhere, even at tank stops), but the atmosphere is quite relaxed. We enjoyed some beers and tacos along the indoor canal, and had dinner at one of the food courts you'll find in the many hotels. After we returned to the hotel, Thomas decided to go to bed, but me and Ronald still had some energy left to go visit a night club. After a 2-km walk we ended up at the Lavo Nightclub and enjoyed two beers for 17 dollars (!), but the fatigue caught on us quite promptly. We must be getting old...
Arriving in LA, California
Last Saturday, after a long 11-hour flight, I finally arrived at the Los Angeles International Airport. Fortunately, Lars Cornelissen, a German speaker which I met at the NRWConf 2009, was sitting next to me. So at least there was somebody to chat with and the flight was not utterly boring. Since I hooked up with Thomas Huijer and Ronald Harmssen from Oosterkamp Training, I took a ride with their convertible and was dropped off at The Standard, my residence for this week. The room is very nice; cheaper, but much more spacious than the Westin Boneventura I spend last year. It even has an IPod docking station.
Since they both arrived with half full suit cases (why didn't I think about that?), we drove to the Citidal Outlets to do some outlet shopping. Prices of brands like Tommy Hillfiger are incredibly low already, but with the current Euro-Dollar rate, it gets even better. Suffice to say, I was succesful :-) We completed the day with diner at Rudy's, a 1940-style burger restaurant. Since we were all suffering from the time difference, at around 20:00, we called it a day.
Tuesday, September 29, 2009
Book Review: Art of Unit Testing
Somehow this year has been one where I spend a lot time reading. Last week I finished Roy Osherove's The Art of Unit Testing, and I've almost finished reading Kent Beck's TDD by Example. After that, I'll jump right into Robert (Uncle Bob) Martin's Clean Code; A Handbook of Agile Software Craftsmanship.
I met Roy about two years ago when I, Don Smith and Olaf Conijn attended a late-night dinner during the 2007 TechED Europe in Barcelona. The funny thing is that I don't even remember what his sessions were about, but I won't forget the fact that he finished them with some hilarious guitar playing. I do remember though some guys from the company behind TypeMock stalking him. And apparently that worked; he is now one of the company's most visible employees. Since then he has blogged a lot of about Test Driven Development and Unit Testing, so I was really eager to read his recent book, The Art of Unit Testing.
Let me start by making it very clear that this book is not about Test Driven Development. One of my colleagues recommended it when somebody else asked about a good book about TDD. If you're looking for that, refer to Kent Beck's TDD by Example, Jimmy Nilsson's Applying Domain Driven Design or the many blog posts written by Jeremy D. Miller. At least, those are the ones that helped me get started.
The book does a great job in explaining the advantages of mocking frameworks in comparison to hand-written stubs and fakes. And since Roy is working for TypeMock these days, I was really expecting him to plug their product TypeMock Isolater throughout the entire book. But I'm not sure whether he was already working for that company at the time he had written the book, I never found him suggesting one product was better than the other.
One thing I didn't like were some his examples in chapter 6. From my point of view, he was demonstrating how to end up with obscure tests. Especially his suggestion to refactor all kinds of shared logic to a general setup method or a test base-class causes the stuff you need to know to understand a test to end up on lots of different places. xUnit Patterns has some much better solutions for solving such problems. And as in many test-related books and articles, it seems that almost nobody is mentioning the patterns of all patterns, the Test Data Builder. That one has proved to really help keep my unit tests readable.
Also, if Roy is ever going to publish another edition, it would be nice to add an intro on Behavior Driven Development (BDD) as well. BDD really helps to ease the thinking process of writing proper specifications.
All in all, I think this book deserves a score of 3.5 (on a scale from 1 to 5). In essence it is a great introduction to everything you need to know to get started with unit testing. Especially chapters 7 and later provide very useful guidance on how to get started and how to deal with the more difficult challenges, both technical as organizational. He shares a lot of his own experiences, and I particularly liked the ones where he failed because he's not afraid to share the lessons he learned himself. Granted, Gerard Meszaros' xUnit Patterns contains a lot more in-depth coverage of proper test automation, but Roy's book manages to cover all aspects in a very readable form.
Tuesday, September 01, 2009
A day and night at the NRW09 Conference in Germany
About 1,5 year ago I first met Daniel Fisher when he and two colleagues from NewTelligence, a German consultancy firm, hosted a full-day session on advanced .NET 3.0. During the breaks, we ended up talking about software factories and stayed in contact through MSN and email.

Since then, he started DevCoach, his own company, and became very active in the German .NET community through the Just Community initiative. In 2008, he and Stephan Oetzel organized their first full-day event, the NRW Conference, roughly comparable to our SDN events. Last year he invited me to do a talk in Wuppertal, but due to holiday conflicts I had to drop the opportunity. But this year, I did make it, and it was fun.
The event started on Thursday evening with a speakers dinner in Pöschkes, a local restaurant. Since I wanted to avoid the traffic, I left Rijswijk at around 14:00 and arrived at Wuppertal at around 17:00. I forgot how fun it was to drive the German autobahn where most of it still does not have any speed limit. Diner started not until 20:30, so that gave me some time to take a walk in the vicinity of the Ibis hotel, which by the way, was a simple but descent hotel. Unfortunately, it had no Wi-Fi and my phone's GPRS connection did not work either. I then went to the event location to meet the rest of the speakers, which appeared to be a rather unusual place. Instead of the typical conference center this event was held in a kind of cultural center/club named "Die Börse". Definitely an interesting place to hold an event for developers.
Dinner was excellent, but lasted a bit long and other than Daniel and Stephan it appeared to me that most Germans are a bit too reluctant to speaking English. Fortunately, I was sitting next to Sergey, who accompanied Daniel in the Netherlands, Lars Corneliussen, a very funny but loud German speaker, and Phil Winstanley, the only other non-German speaker. Although very young, he appeared to be a seasoned speaker and has been MVP for many years. The three of us enjoyed some interesting discussions throughout the entire evening and finished the night at around 01:00 with a final drink at the hotel's bar.
The next morning at 8:00 we all met at the venue to receive some drinking coupons and our speakers shirt. The first session started at 9:00 with a rather spectacular recap of last years edition and some encouraging words from the organization. Luckily I do understand German (although I don't speak it that well).
My session started at 11:10 and appeared to last only one hour instead of the usual 75 minutes. The session was held in the main room where the keynote was held, so it looked rather empty, even though there were about 35 people in it (of the 102 attendees in all four tracks). The talk ran fast and reasonable smooth, but at the end, nobody asked questions. However, I got a score of 1.7 on a scale between 1 (excellent) and 6 (aweful) so it is probably the language. Most Germans are not accustomed to speaking English even though I did not expect that from a developer community. Phil, who gave an excellent interactive talk on ASP.NET MVC versus WebFoms did not get any questions either.
I also attended Sergey's session on Orthogonal Architecture where he explained how you could apply the S.O.L.I.D. principles on an architectural level. I found that idea very interesting, so I just might ask Sergey whether I could use his slides to do this talk in the Netherlands. Since I had plenty of time to spare I also went to a talk on JQuery delivered by a German speaker I forgot his name off. I have not used JQuery yet, but I see why Microsoft decided to include it in the next version of ASP.NET. At around 18:30, after attending Phil's session and having dropped him off at the Dusseldorf airport, I finally drove back home.
You can view (or download) the slides below and download the source code of my demos from here.
Wednesday, July 29, 2009
Defining a reference architecture for Silverlight LOBs
Recently I've been catching up on Silverlight by reading Pro Silverlight 2 in C# and the many blogs and articles on Silverlight 3 and I'm seriously impressed. The reason for this sudden interest is the fact that I'm considering Silverlight as an alternative to ASP.NET for building line-of-business applications. Silverlight 2 was promising, but lacked some important features that are required in full-screen Silverlight apps. However, Silverlight 3 has introduced some major improvements that convinced me that it is finally ready for replacing ASP.NET for controlled environments.
Since I'm quite fond of Martin Fowler's approach to Evolutionairy Design, I'd like to have at least a rough idea of where I'm going to in terms of architecture and technology support. Consequently, I've been thinking hard to come up with a list of features and ideas I'd like to consider in a SL architecture. The list is not complete, so I’ll adapt it regularly. But since I assume more people are trying to cross that same bridge, I though sharing my wish list could be useful.
General
- Simple Design, Test-Driven Development and Refactoring are the foundation of all design and development efforts.
- I will explicitly consider every recommendation from the RIA Pocket Guide and make sure they are either included in the design or made part of the product backlog.
- I'm seriously considering to use MOQ instead of Rhino Mocks. I've been using Rhino for over two years, but Ayende hasn't reported much development anymore and its Silverlight support is only alpha. MOQ has official Silverlight support and appears to be very active.
- I'll start with Visual Studio 2008 SP1, but will switch to Visual Studio 2010 Beta 2 when it arrives and has support for RIA Services.
The Application Server
- RIA Services to expose DTOs to the client. I have thought long and hard about how to fit RIA Services in a system, but I refuse to directly expose the domain model and pollute it with explicit choices about how far RIA should serialize a my domain entities. Therefore, I will expose DTOs only, even though I loose the automatic propagation of validation logic to the client.
- A Domain Model roughly designed according to DDD principles where cross-aggregate logic will be covered by Domain Services.
- Obviously I'll use NHibernate accompanied by LINQ and Fluent NHibernate (download them from here if you want a set of compatible builds).
- I'll still use the Repository pattern to hide any LINQ-to-NHibernate limitations. They will be exposed through an NHibernateObjectContext that serves as the unit-of-work and essentially wraps the ISession
- I'm considering to introduce Domain Events to keep any infrastructural logic from poluting the domain model. However, I'm not sure how worthwhile this purist approach will be.
- I've spend too much time hand-coding this translators in earlier projects, so I'm open to try out AutoMapper for this.
- As usual, I'll use Enterprise Library 4.1 on the backend for Policy Injection, Exception Handling, Validation and Logging. I'm not sure when version 5.0 will arrive, but I like its feature set. If it arrives in time, I will consider migrating (the 3.0 -> 4.1 migration was trivial).
The Silverlight client
- The use of Regions and Views such as the Composite Application Guidance (CAG) is providing, but without the concept of modules. The Web Client Software Factory had a similar concept, but I never found real use for them anyway.
- An Event Aggregator to allow communication between views and other components without them needing a direct reference to eachother. I'm not yet sure which one I'll use. CAG has a nice one, but Jeremy's version might be interesting as well.
- Dependency Injection through Unity for Silverlight.
- I wish there was a Policy Injection framework for Silverlight as well...
- RIA Services also adds a very nice mechanism for sharing code between the server and the Silverlight client, but I'm not sure yet how I'll use it. I think this is something that will become clear during development.
- The RIA DomainContext will be accessed through an interface so that the ViewModel classes can be unit tested properly without any dependency on RIA.
- INotifyPropertyChanged using lambda expressions instead of literal property names
- Model-View-ViewModel (essentially Presentation Model with INotifyPropertyChanged and INotifyCollectionChanged support)
- Some mechanism for hooking Silverlight controls to ICommand objects. I'm not sure yet whether I like the CAG implementation, so I may have to find an alternative.
- Silverlight Toolkit and Telerik's RadControls for Silverlight
- Deep linking with SL3's Navigation Framework
Sunday, July 19, 2009
NHibernate 2.1.0 GA with LINQ and Fluent
NHibernate 2.1.0 GA has just been released on SourceForge, so I thought it useful to compile the latest versions of both Fluent NHibernate (revision 530) and the NHibernate.LINQ (revision 915) against this new build. You can download them in one package from here.
Saturday, July 18, 2009
Book Review: Code Complete 2nd Edition
A few months ago, me and colleague Jonne Kats had a discussion on whether or not to refactor a single- line non-intuitive expression in a properly named method. Just for the sake of the argument, I was against this particular instance, and he was in favor of many very small methods. I felt it was more a matter of personal preference, but he challenged me by referring to the book Code Complete , written by Steven McConnell. Obviously, I took on this challenge and read the 2nd edition.
The 2nd edition of Code Complete holds about 900 pages, but is definitely worth the read. The first 200-250 pages deal with general considerations for building high-quality software, followed by an equal amount of pages dealing with the typical interpretation problems that have made coding standards so popular. To me, those chapters provided additional food for my enthusiasm towards coding guidelines. Especially the stuff dealing about naming classes and members helped me gain additional arguments for making developers understand their significance. The remainder of the book covers almost every noticeable aspect of software development. Some chapters are very technical and deal with topics such as debugging practices, performance tuning, productivity tools, but others are actually very high-level and cover system integration and configuration management, project management, and management involvement in general,
The book uses examples written in VB, C++, Java and occasionally in C#. That was quite nice because even though I'm a former C++ developer, I forgot about the peculiarities of C++ and how much cleaner C# really is. Consequently, some of the examples were not really applicable to me. And since I've already spend a good deal of my career on coding, layout and design guidelines, I skipped most of the chapter covering code layout. The chapters on debugging and programming tools were a bit obsolete as well, because debuggers and development environments have matured incredibly since 2004, the release date of this book.
On the other hand, in spite of its age, the book is incredibly actual. Many of the practices explained in this book are now considered Agile practices. And were it really stands off against all the other design-related books is its extensive use of hard facts. I can't remember reading a technical book that caused me to send a few pages to my direct supervisors or my customer's management team so often. It is full of comparisons and study reports explaining why practices such as automated testing, pair programming, coding standards, and proper naming work so well; Steven did not held himself back on psychological and empirical studies. And the beauty of this all is that it is very lighthearted easy read, similarly to Jimmy Nilsson’s DDD with C# book, and a welcome change to the excellent but very dry Domain Driven Design by Eric Evans.
So what about that discussion with Jonne? Well, as usual when we have a discussion on topics such as this our intentions and goals are the same, but somehow we always differ in nuance. In this particular case, I must agree that replacing the non-intuitive expression with a single-line method was the right advice. That doesn’t mean you have to do that everywhere, just stick to the rule that a method should do one thing, and do that thing right. Just read the book and learn to gain a feeling of what is right from there.
Obviously, reading this book has changed my current shortlist of must-reads a bit:
- SCRUM/XP from the Trenches, Hendrik Kniberg (e-book)
- Code Complete 2nd Edition, Steven McConnal
- Applying Domain Driven Design and Patterns in C#, Jimmy Nilsson
- Patterns of Agile Practice Adoption, Amr Elssamadisy (e-book)
- xUnit Patterns, Refactoring Test Code, Gerard Meszaros
- Domain Driven Design, Tackling Complexity In The Heart, Eric Evans
Monday, June 01, 2009
Slides and demo code for my TDD/SOLID talk at DevDays 2009
Even though it was just a wildcard session (people had to vote for my proposal), the room had a capacity of only 50 people, and the DevDays organization forgot to list the wildcard sessions on the website, I was very happy to see that the room was more than full. Although I had quite a lot of content to cover and the pace of my session was quite high, I think it went very smooth. Since it is not possible to fill-in an evaluation form through the DevDays site, hopefully, people drop me an email or a tweet me with some feedback.
Anyhow, in case you want to review the slides or inspect the code I’ve used to create the demos and examples, get the slides from here, and the code from here.
