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.

clip_image001

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.

clip_image002

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

image 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

Update October 2010: I’ve started a new in-depth series on my current Silverlight 4 Reference Architecture.

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.

    clip_image001

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:

  1. SCRUM/XP from the Trenches, Hendrik Kniberg (e-book)
  2. Code Complete 2nd Edition, Steven McConnal
  3. Applying Domain Driven Design and Patterns in C#, Jimmy Nilsson
  4. Patterns of Agile Practice Adoption, Amr Elssamadisy (e-book)
  5. xUnit Patterns, Refactoring Test Code, Gerard Meszaros
  6. 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.

Monday, May 18, 2009

Try to do this without LINQ

Today, me and my colleague Cor have been busy pair-programming for most of the day. While doing that we tried to build a dictionary which value is an enumerable collection. I think we found a great example of the power of LINQ that I think is worth sharing.

Consider the class diagram below. ExamSeries represents a examination series consisting of one or more questions. Each series has a language-specific part represented by SeriesDetail. Our goal was to be able to apply a Specification object to a collection of ExamSeries and receive a dictionary of all series matching that specification, including the specific languages. So our intention was to get a IDictionary<ExamSeries, IEnumerable<Language>>.

image

We started hand-writing multiple foreach loops and managed to get what we wanted, but somehow, I got this annoying feeling in the back of my head that this should be easier. After a lot of experimenting, we found the following rather nice example of using LINQ.

image

Not bad eh?

I’ll be speaking at the Microsoft Developer Days 2009

Thanks to the many votes we received on our wildcard proposals from attendees, colleagues and community members, me, Pieter Joost van de Sande and Dennis van de Stelt have won a timeslot on next week’s Microsoft Developer Days. I’ll be talking about Test Driven Development and SOLID on Thursday May 28th at 15:00 in the conference room named Central America.

Many attempts have been made to improve the overall quality of our software development efforts, but if there's one I'd like to put some attention on, it's Test Driven Development. It's design-first, test-first approach has proved significant increases in overall quality. However, TDD is not easy and requires quite some understanding of proper object oriented design. S.O.L.I.D. is one of the better known acronyms referring to a set of very important design principles that both improve your ability to do TDD, but also make sure that your software is highly testable and maintainable.

Stuff I’ll be covering:

  • What is quality?
  • Demonstrating Test Driven Development with a hands-on demo
  • The S.O.L.I.D. principles
  • Phases of unit testing
  • Examples illustrating the advantages of S.O.L.I.D.
  • Guidelines for getting started

Prerequisites: You should be able to understand C# 3.0 and Lambda expressions, and feel at home amongst the principles of OO such as encapsulation, inheritance and polymorphism.

In the mean time, if you like to follow me on my daily activities until the DevDays, my Twitter account is http://twitter.com/dennisdoomen

Thursday, May 07, 2009

About Programmer Lifestyle Dilemmas

image

Yesterday, I attended the second Devnology meeting in Utrecht and I had a really fun evening. Devnology is an initiative started by Pieter Joost van de Sande and Freek Leemhuis and focuses on sharing experiences, insights and knowledge between members of the entire developer community. That means that you'll see not only .NET and Java developers, but also developers using C++, Ruby on Rails, SmallTalk and even functional programming. It felt very refreshing to hear about all those other platforms I simply don't have the time for.

This session was held in one of the very attractive rooms offered by Seats2Meet in Utrecht and focused on the typical dilemmas a programmer has to face in his daily duties. As a kind of preparation we were asked to answer a list of questions related to our habits, interests and so on. I thought it would be nice to share my answers and also mention the things I heard from the others and will read or investigate.

Q: Do you prefer to work as an independent consultant or be on someone’s payroll?
I have always liked to work for a company, either big or small, as long as they can offer enough interesting opportunities. I don't like to find my own customers (at least, not initially) or spend time on administrative tasks. Moreover, working in a company offers my changes for sharing knowledge, experiences and enthusiasm.

Q: Do you prefer to work in pairs or alone?
I definitely stimulate Pair Programming within my teams since I've seen it cause an improvement in the overall level of technical and domain knowledge. But I myself don't always do it, mostly, because I typically have a lot of team leading tasks. The primary reason for me to sit next to another developer is to improve the usage of coding guideline, design principles and other best practices. Obviously, when trying to figure out a complex technical challenge, Pair Programming really excels.

Q: Do you prefer to work in the office or at home?
I prefer to work at the office since it is more fun, and allows me to have interesting discussions with other colleagues.

Q: Can you live with a waterfall methodology or do you insist on Agile?
I have lost faith in a traditional waterfall approach, and strongly believe in many of the aspects of typical Agile methodologies. I'm currently looking into using (elements of) SCRUM for my projects.

Q: Do you try to keep up with all the latest developments, or focus on concepts?
I always try to stay in shape by reading blogs, books and by having discussions with other members of the community. However, I'm starting to become aware of the fact that I can't keep up that pace for a very long time. As a matter of fact, I'm already pushing some of the newer technologies that are not yet necessary for my current tasks aside as long as possible.

Q: Specializing or generalizing
I focus my attention on the stuff that helps me the most at my current job, but I do have a particular interest in Test Driven Development, design and architecture. However, I always keep an overview of all the products and technologies the Microsoft platforms offers. So, I'm both :-)

Q: What are your three favorite blogs?

Q: What are your three favorite Podcasts?
I've never done that, but looking at the popularity of these during this meeting, I'm going to look into them.

Q: Name three books that had a lot of impact

  1. Applying Domain Driven Design and Patterns - Jimmy Nillson
  2. Domain Driven Design: Tackling Complexity in the Heart of Software - Eric Evans
  3. Scrum and XP from the Trenches - Henrik Kniberg

Q: What tools do you use to find knowledge?
I primarily use Google Reader to stay up to date with a whole bunch of blogs. I don't understand why Microsoft's Live site does not provide something like this.

Q: What events do you visit regularly?
PDC or Teched, Microsoft Developer Days, Software Developer Event / Conference, CodeCamp, DotNed, Devnology, OpenSpace

Q: What are you going to read or investigate as a result of this second Devnology meeting?

Wednesday, April 22, 2009

Enterprise Library 5.0 is under development NOW

It’s a shame this year’s Microsoft Developer Days does not cover anything of the work the Patterns & Practices team is doing. However I know from first hand that they’re doing a very good job. A few weeks ago, you were given the opportunity to vote for your favorite feature or improvements, and now, they’ve delivered their first drop. And while you’re reading about it, notice that P&P is actually using (a variation) of SCRUM, hence their reference to Sprints.

Tuesday, April 14, 2009

We've just passed more than 1000 unit tests

In November 2008, me and some fellow colleagues have started working on a new project where we use Test Driven Development to gain a highly maintainable and highly testable system. Today, we have reached our 1000st unit test, or better, 'specification'. The term Test Driven is a bit misleading since TDD is really a design process, which has nice little granular unit tests as a side-effect. Anyway, we tried to reach this point before Eastern, but obviously we were professional enough not to add some dummy tests :-)

Thursday, April 09, 2009

Wildcard Proposal: TDD and SOLID, two ingredients for high quality software

Many attempts have been made to improve the overal quality of our software development efforts, but if there's one I'd like to put some attention on, it's Test Driven Development. It's design-first, test-first approach has proved significant increases in overal quality. However, TDD is not easy and requires quite some understanding of proper object oriented design. S.O.L.I.D. is one of the better known acronyms referring to a set of very imporant design principles that both improve your ability to do TDD, but also make sure that your software is highly testable and maintainable.

If you like to hear more about this on the coming Developer Days, give me a Thumbs Up at the DevDays09 site and help me into one of those wilcard sessions.

Important Note: You must first register on the DevDays site, regardless of whether you're not sure yet you'll go. Then wait for the activitation mail, log in and press the thumbs-up symbol next to my photo and the vote count.

Wednesday, April 01, 2009

Help prioritizing Enterprise Library 5.0

Patterns & Practices has just finished compiling a list of candidate features and improvements for the next installment of the Enterprise Library. Grigori Melnik, the Enterprise Library's product manager has opened an online survey and invites the .NET community to share their priorities and, if needed, add any additional requests. Make sure you add your vote over here.

Friday, March 27, 2009

The Query Command Separation principle, who was right?

Yesterday, at my Design Patterns & Testability session at the dotNED meeting, I tried to explain the purpose of the Query Command Separation principle. However, somebody from the company Quadrant (forgot to ask for his name) mentioned an entirely different explanation of the pattern. Since many design principles are not very well specified, I was expecting some discussion, but in this case, I was caught off guard a little bit.

He was explaining it as a pattern for distributing changes over multiple synchronized databases. For instance, when one database is used for reporting or querying and the other for maintaining state, command-like objects are used to apply the same change to both databases. I heard about this approach and it sounded like the Command pattern. However, he mentioned an article from Greg Young posted on Code Better, so it sounded serious enough for me to investigate.

Turns out we were both right. As a technical design pattern, the QCS principle does indeed what I though it did and has been written down by Bertrand Meyer. At the same time though, Greg Young and Udi Dahan and some of their fellow Distributed Domain Driven Design guys have been redefining this pattern on the architecture level. You can read about that over here.

Slides from the Design Patterns & Testability session at dotNED

As usual, I ran out of time big time, but still, it was a great evening. We continued until 21:45 and even though my throat was hurting as hell due to the flu, people were paying attention very well. TDD en testability are really difficult subjects and always cause a lot of discussion, but the discussion itself already proved some of the claims I made. So, I'm happy!

 DSCF1184

You can download the slides here and the code that shows all the examples I had in mind (and failed to show within the available time) here.

Sunday, March 15, 2009

Dutch Open Space Code Day 2009

Open Space Code is a hands-on programming event following the Open Space format. The concept was borrowed (with permission) from the Open Space Coding Day that was held in the UK recently. Open Space events are more freeform than normal conferences, where all the interactivity is mostly found in coffee breaks. Mostly they're just great fun.

twitter

Announcements will be posted on this website and on this Twitter account @openspacecodenl, if you want to attend, send an email at info@openspacecode.nl.

The target date is Saturday the 6th of June 2009 from 9.00 to 17.30, the target location is in Den Haag near the A4 but hasn't been confirmed yet.

Design Patterns & Testability at dotNED and SDN

March will be busy month for me. On Thursday the 26th of March, we will be hosting the monthly Dutch dotNED community at the Holiday Inn hotel in Leiden. I'll be talking about testability and design patterns by showing how Test Driven Development and Design Patterns can help you create highly maintainable software. I'll start with a short introduction on TDD and list quite a few principles that I've learned from some of the more noticeable members of the community. I'll then continue with coding an example application using various design pattern and in TDD-style. Check out the registration page here.

On Monday the 30th, I'll repeat the design patterns part of that session at the quarterly SDN Event in Driebergen. And if you're into testability, you'll be in for a joy because quite a few sessions will be covering that subject.

Friday, March 06, 2009

New coding guidelines for C# 3.0

Update June 29th, 2010
This document has just gone through a major update for both C# 3.0 and C# 4.0. Read more about it here and get the document from http://www.csharpcodingguidelines.com/.

I have been a long-time supporter of coding standards because I believe in its value as a way of improving overall code quality and helping inexperienced developers to gain more insight on the consequences of their work. I wrote my first C# Coding Standard together with Vic Hartog in 2003 for Philips Medical Systems, but have been refining these since then. However, I think every architect or lead developer should decide for himself whether or not he or she wants to comply with each and every rule, so I decided to refer to this document as Coding Guidelines rather than Coding Standard.
In the last couple of months I’ve been busy trying to revise this original document in order to come up with a version suitable for C# 3.0. And since Visual Studio has great support for automatic code checking using its Static Code Analysis feature, I decided to remove any overlapping rules and guidelines. The new document should be used as a companion to Code Analysis/FxCop and adds additional best practices that have proved to be very useful in my daily work as a consultant.

Tuesday, February 24, 2009

Hoorah, we have a daughter

Last Sunday, the 22nd of February, my wife gave birth to a beautiful little girl listening to the name Teddie. She was born at 14:24 in the Reinier de Graaf Gasthuis in Delft and her weight was 3940 grams. She is very healthy, but when her mother’s water broke, we discovered that she dirtied her amniotic fluid. Therefore, to be safe, labor was continued in the hospital. Mother and daughter have stayed one night in the hospital for observation but are now comfortably at home.

DSCF1004_small

Monday, January 26, 2009

The circle of most influencing community members

Somebody recently asked me to name the top 5 of most influencing members from the software developer community. Since I spend a lot of my time reading books, articles and blog posts, that list is actually quite long. So I decided to name the six professionals who have been inspiring me the most in the last year or two. Notice that the order is not of any significance.

Ayende Rahien
If you haven't heard of Ayende Rahien you must live behind a rock. Not only does he produce over 1000 blog posts a year, he is the creator of Rhino Mocks and a very important participant in the NHibernate community. And what I particularly like about his posts is that he is not afraid to publicly disagree with the general public. He is very open in publicly discussing important events and occurrences from the .NET community, even if it deals with feedback he got on his own work.

Billy McCafferty
I first noticed Billy after reading his CodePlex article on best practices and design principles when using NHibernate in an enterprise architecture. I haven't heard a lot from him anymore other than his recent investment in his S#arp Architecture, but that article really boosted my interest in harvesting best practices and design patterns for building serious systems.

David Hayden
After working for a company that invested big time in custom software factories with almost no return-of-investment, I decided to try to be more pragmatic and started to use what's there. Particularly the stuff provided by Patterns & Practices drew my attention, and since then I've been very involved in their software factory endeavors. But if there is one man which name pops up everywhere where Web Client Software Factory or Enterprise Library is covered, it's David Hayden. He has provided so much important advice and examples on using, extending and exploiting these P&P marbles, I think I would not have been so successful in using them during my day-to-day work.

Jimmy Nilsson
Pieter-Joost van der Sande, one of the funnier community members, recently pointed me at a book written by Jimmy Nilsson: Applying Domain Driven Design. It more or less dealt with the exact same domain modeling design issues I run into regularly. But this was one of those books I wish I would have read it two years earlier. It would have saved me from all the trials and tribulations that I ran into trying to develop a nicely integrated architecture based on the P&P stuff, NHibernate and service orientation. But more importantly, one of things his book did was to really jumpstart my interest in Test Driven Development.

Jeremy Miller
And that brings me to another notable member of the .NET community, Jeremy D. Miller. After reading Jimmy's book I became very eager for more information and guidance on TDD. And as a long time reader of Codebetter.com, I discovered that Jeremy wrote an awful amount of articles on TDD and design for testability. Since then, we have been applying his 'laws' as much as possible resulting in much more consideration for writing well designed, loosely coupled and testable code. And as that would not be enough, he also wrote some great articles on Agile development and team coaching as well. He sure knows what he is talking about.

Martin Fowler
Last but not least is the guy that I suspect being the inspiration for most of the other guys above. I mean, most of the stuff mentioned by them is heavily based on the elementary design patterns 'discovered' by Fowler. If you haven't at least browsed through his book Patterns of Enterprise Application Architecture now is the time if you're considering to be a serious software architect. And while you're on it, also consider checking out the original bible by Eric Gamma and the other members of the Gang of Four, Design Patterns: Elements of Reusable Object-Oriented Software.

Saturday, January 17, 2009

Black screen after upgrading to Windows 7 beta 1

Today I've upgraded my 64-bit Windows Vista desktop to Windows 7 Beta 1. However, after a seemingly succesful in-place upgrade, I ended up in a black screen listing the Windows 7 build number (7000) in the lower right corner. Apart from a fully functional default mouse pointer, nothing happened, even after waiting for 30 minutes as was suggested by this post. CTRL-ALT-DEL did work however, making me believe it was the setup that was stuck. Fortunately, the setup created a special boot menu entry that performs a complete rollback that actually works.

Obviously I did not like that all, so I continued my research for finding a solution. Somehow, some arbritrary post reminded me of the fact that I have both my TFT monitor and my Panasonic Plasma TV connected to my videocard. And what do you know! That solved it!

So my advice to you is: make sure you disconnect any secondary monitors or TVs before performing a Windows 7 install or upgrade.

Friday, January 09, 2009

Happy New Year | Best Wishes 2009

I was planning to post earlier, but unfortunately my first week after the holiday was filled with
unexpected challenges...


A new year always means that a lot of new things will happen, but I think 2009 is going to be one of those years that brings a lot of promising things to the .NET community. Personally, for me it's going to be even more interesting, so let me summarize some of the things I'm looking forward to.



  • The release of Windows 7. I'm currently evaluating beta 1 of Windows 7 (build 7000) on my Asus EEE PC and it runs like a charm. Even though some have said that footprint was not smaller at all, I'm convinced that it needs lot less resources than Vista.

  • The release of Visual Studio 2010 and the .NET Framework 4.0. I'm hoping for a first beta in March or April because working with the CTP virtual machine is a pain in the butt.

  • The release of NHibernate 2.1 with complete LINQ support

  • Another PDC from November 17th to 20st where we'll finally hear what Microsoft really meant with "Oslo". The TechED Europe is happening two weeks prior to that, so expect the official release of Visual Studio 2010 at the PDC. Rumours also say, Microsoft will announce Office 14 and the next release of MOSS.

  • The new Star Trek movie directed by J. J. Abrams, the founding father behind Lost.

  • "The Pacific", a 10-part mini-series from the creators of Band of Brothers, my all-time favourite movie.

  • And last but not least, becoming a father of a beautiful daughter (assuming she inherits some of her mother's genes).