Blog Home  Blog Home Feed your aggregator (RSS 2.0)  
Mikael Freidlitz - Development
software architecure, design and an occasional line of code
 
 Saturday, February 10, 2007

Patrik has understood how hard it can be for developers to grasp the beautiful concept of Design Patterns and has taken upon him to translate into a language most of us understand - C#.

Go on and check out his first take on the Strategy Pattern and then see how the implementation changes for Strategy Pattern using Delegates.

2/10/2007 1:29:45 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Development  |  Trackback
 Friday, November 24, 2006

In case you hadn’t noticed, I want you to go check out the latest utter coolness of Billy McCafferty’s.

Billy has started a challenge, called Refactor It! The Weekly Book Giveaway. The first challenge has already expired but is still up for learning purpose while the second challenge got released today.

Obviously I have to mention this: this weeks price is nothing less than the well composed book Applying Domain-Driven Design and Patterns: With Examples in C# and .NET by no less than the extraordinary Jimmy Nilsson. :-)

11/24/2006 1:25:45 AM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Development  |  Trackback
 Thursday, November 16, 2006

Just a few hours ago, I was watching my former dev112 brother-in-arms Dag König (now turned MS VSTS Evangelist) give an excellent presentation on Visual Studio Team Systems. He was particularly proud to introduce the Team Edition for Database Pros, the most recent part of the Team Suite, scheduled to RTM November 30.

Dag did a great job explaining how VSTS is supporting the full application lifecycle – from elaboration all the way into maintenance. Not only does it support processes (which are by the way pluggable in the VSTS environment, to provide on the fly support for the dev team) – it also supports pretty much any role that is available in a software development project.

I believe that what impressed me most was its extensibility through the cool API which Dag illustrated with a custom Bug Identification Work Item Generator which he had coded in only (kind of) 15 lines of C#.

Additional information regarding Visual Studio Team Systems can be found at another buddy’s place – the Blogfather of VSTS, Rob Caron! :-)

11/16/2006 11:02:29 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Development | VSTS  |  Trackback
 Tuesday, October 10, 2006

In the last few years, I have taken an interest in agile work in environments restricted by 'heavy' methodologies such as SDM and RUP. Before anyone goes saying that there are agile adoptions of any and each – that has yet never been an option for me.  My customers usually are large organizations with a mind set in stone regarding what methodology to use, which is a good thing for them. With 1000+ coworkers, it is good to have a common understanding of what to expect when you join a project, where to find necessary information, how to configure your code projects etc.

 

However, there are so many things about agile principles that can do so much good for pretty much any software development project that they become impossible to disregard. Just to mention a few, I'd like to name a couple of the practices from the most well known Agile methods, XP, that I as often as possible try to incorporate in my software development projects:

 

Pair programming – Even if my customer have a hard time accepting what he see as a huge overhead cost for daily pair programming, I encourage pair programming for bug fixes. It usually makes sense to the most stubborn manager that you really, really do not want to send out a bug fix that a) doesn't fix the bug or b) adds another bug. An extra pair of eyes helps reduce the risk of adding bugs among other things. There are so many benefits to pair programming alone, that it could take up an entire web site.

 

Continuous Integration – Setting up a Continuous Integration server that runs some kind of CI software doesn't take too much effort from a project perspective but it provides a host of benefits. It usually doesn't take any time convincing stakeholders that a CI server is of great benefit to the project and it becomes even easier once you start explaining the its goodness. The usual scenario is that the CI server rebuilds and tests the entire application every time someone checks in as little as a single line of code. CI helps the developer verify that his code integrates smoothly with the existing code base as well as it runs the unit tests to verify that the checked in code doesn't break the tests.

 

Unit testing – The absolutely easiest method to avoid regression bugs is to implement unit tests in your code. The unit tests are used to verify that something that worked before doesn't stop working from changes to the code. The unit tests may be a result from Test-Driven Development but my experience is that TDD is one of the practices that are harder to negotiate into a project following the classic methodologies.

 

Every single time the CI server builds and tests, the project can have its integration- and regression tests run. There are huge benefits from this since must bugs can be identified way ahead of the regular testing cycles.

 

I believe that there are a bunch of agile developers out there, locked down in non-agile environments and I will try my hardest to cover as much of this area as is possible to me.  The importance is to understand that there are disciplines from agile methods that fit very well together with the classic methods. All you have to do is to convince the boss of the benefits from thinking slightly differently.

10/10/2006 1:25:01 PM (W. Europe Daylight Time, UTC+02:00)  #    Comments [0]   Development  |  Trackback
 Monday, March 20, 2006
I actually believed that these were just bedtime stories, but it seems that Noel actually gets to live the entire Agile dream to its fullest! You ever wanted to know how it works? Go check out A day in the life....
3/20/2006 4:11:42 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Development  |  Trackback
 Monday, January 23, 2006

Yes, I am aware that I haven't posted anything in way too long. 'Nuf about that now.

If you're an enterprise developer, I'm certain that you already build most of your applications on top of Enterprise Library for .NET 1.1. If you don't, you should. If you don't even know what it's about, EntLib is a library of application blocks that guides you through the everyday tasks of an enterprise developer. As a bonus, the application blocks are designed to be easy to use and they are well suited to be integrated in your enterprise application. You can get yourself acquainted with the EntLib using some nice Hands On Labs that Microsoft gracefully has provided.

I have some good news for those that have moved on to .NET 2 as well. MS has release EntLib for .NET 2! There are a few webcasts and presentations but it seems that we have to wait until March to see the Hands On Labs.

You should keep an eye on Tom's blog if you are interested in building high quality enterprise apps. He never fails to keep us updated on the latest and greatest from the PnP EntLib gang.

1/23/2006 4:03:05 PM (W. Europe Standard Time, UTC+01:00)  #    Comments [0]   Development  |  Trackback
 Wednesday, September 14, 2005

As I wrote the other day, I was listening to Brad and Krzysztof talking about The Art of Building a Reusable Class Library. Most of this PDC pre-conf was pretty much common sense. What I like about it is that it is formalized common sense. You see, it turns out that your common sense isn't always compliant with what others consider common sense. From this session, and especially with a copy of their soon-to-be-released book, Framework Design Guidelines.

One of the early tips they provided was to group similar functionality by name. It may seem trivial, but I see it all the time that class library designers fail on this.

Let's say that you have a string management class for instance, in which yo would be able to append, overwrite, read and manipulate the text by regex. At a first glance, method names such as Append, OverWrite, Read and Manipulate may feel pretty good. But what would happen if you hade more, say 30, methods in this class. Wouldn't it be hard to identify that you can write by either appending or overwriting? According to these friends, it would be a better idea to group the methods by changing the names slightly, into something like Modify, Read, WriteAppend and WriteOver. This way you'll get all the writing methods nicely grouped together in your intellisence.

My one favorite statement from that entire day was the following:

Use abstract classes when possible - interfaces when necessary!

Using interfaces instead of abstract classes hinders the evolvement of your framework. Interfaces are awesome for defining strict contracts of your framework but is a real pain if you'd want to add generic features to a group of classes. There are two occasions where you might prefer interfaces over abstract classes:

1. When you want to create a hierarchy of value types
2. When you want to simulate multiple inheritance

At any other scenario, do favor defining classes over interfaces!

Fields vs. properties
Use properties. It is as simple as that. Even if you see no immininet reason to modify whatever value you'd want to expose, there might be a reason for it in v2. Have you considered that you might want to cache a value for performance reasons?

Documentation is important but it does not compensate for a bad API. What Brad said about that? "Good documentation on a bad API is like lipstick on a pig!" A bad API is a bad API. The solution is not to write fool proof documentation - the API in it self is what should be fool proof.

If in doubt - use the manual
If you are the slightest bit uncertain of how to implement something - have a look for something similar in your team's existing source code base. If you don't find it there, you might find a clue in the .NET Framework. Download and check out the Rotor code - it's pretty much exactly what makes up .NET.

Finally, The Pit of Success
Brad really focused on the importance of The Pit of Success - a definition that he has borrowed from Rico Mariani. As a framework- or class designer, you should design your deliverables so that someone using it would easily stumble into doing things right. The most intuitive route should not lead to failure or misuse of the framework. If you provide two options, the most preferrable should also be the one leading to the least work and the least risk of messing up the application that he's building.

9/14/2005 8:28:21 PM (W. Europe Daylight Time, UTC+02:00)  #    Comments [1]   Design | Development  |  Trackback
 Tuesday, September 13, 2005

After a somewhat insane shopping spree at Camarillo Premium Outlets and a sunny day at SeaWorld San Diego, I finally got to hear Brad Abrams and Krzysztof Cwalina talk about good framework design.

One thing they talked about was naming conventions. They said to definitely drop anything similar to hungarian notation. camelCase and PascalCase are good though. There is also one exception; KEEP the I-notation for interfaces, that seems to be something that Ingo disagrees with, and I didn't quite get where Jimmy is positioned in this case.

Oh... There is so much more. I'll have to get that into a separate note - I just liked this little anecdote thing. It's funny how these thinge keep getting debated. I think I'm going to play it safe though, and stick to what BradA says. :)

9/13/2005 11:14:32 PM (W. Europe Daylight Time, UTC+02:00)  #    Comments [3]   Development  |  Trackback
 Wednesday, August 17, 2005
Really good information on the status of the Dependency Injection (DI) implementation in EntLib v2 and some sample DI code of mine
8/17/2005 1:25:29 AM (W. Europe Daylight Time, UTC+02:00)  #    Comments [3]   Development  |  Trackback
 Sunday, March 27, 2005
Both Scott and Bertrand has written nice articles on how to use custom HttpHandlers in order to return custom content from a HTTP request...
3/27/2005 1:22:33 PM (W. Europe Daylight Time, UTC+02:00)  #    Comments [3]   Development  |  Trackback
Copyright © 2009  Mikael Freidlitz . All rights reserved.
Based on 'Portal' theme by Johnny Hughes.