views:

762

answers:

2

I'm looking for design patterns (GOF, but others would be welcome too) for Delphi 2009.

There are some very good and classic articles about Design Patterns in Delphi:

Additionally, the newer Delphi's have some design patterns built in into the IDE via the model view.

However, none of them seem to make good use of the new features that Delphi has to offer, like generics and anonymous methods. There are C# examples that use generics and anonymous methods, but they can't really be translated 1:1 to Delphi, and I'd like to get some advice from people who've got hands-on experience with these specific features in Delphi.

Are any example available online, or in a book, or can anyone provide some useful examples or tips maybe?

+4  A: 

I've got a fairly simple example of a Generic Factory that uses anonymous methods up here

Malcolm Groves
Alright, useful article. Your site is in my bookmarks now..
Wouter van Nifterick
You may want to take a look at ModelMaker (http://www.modelmakertools.com) since it implements some design patterns IIRC. I mostly use it for documentation and code visualization, but it seems to be a very solid tool.
David Taylor
+1  A: 

GOF patterns are the same for any object oriented language. Delphi 2009 is not an exception. Generics and anonymous methods features are just a syntactic sugar, to make our life easier. So if your read the original GOF Design Patterns book, you can easily apply its concepts to Delphi 2009 and all its previous versions (even some of Turbo Pascal).

eugener
Ok, let me clarify: I'm not looking for the patterns (the book you're mentioning is on my desk at the moment). I'm looking for specific implementations and best practices now that we've got new language features that we can make use of.
Wouter van Nifterick
Some patterns are not easy to implement in Delphi. The Visitor pattern for example, when the classes are in different units: the only solution I know involves hard class typecasts.
mjustin