std.patterns: it was about time

BLS windevguy at hotmail.de
Sun Feb 1 02:08:30 PST 2009


Hi Andrei,
that's now something I appreciate ... Thanks!

I general patterns are not reusable as code, as developers must 
implement them new, over and over again.
I also thought that Mixins should be the key to implement a pattern 
library.
Let me name a library implemented pattern : Component.
The question is now which GoF pattern could be implemented as Component, 
or in other words are some are too much context-dependent ? ( Strategy, 
Provider /non GoF/)

I found a very interesting PhD thesis regarding this topic.
1- componentizable patterns
Flyweight
Observer
Mediator
Abstract Factory
Factory Method
Visitor
Command
Composite
Chain of Responsibility

I think we could add Singleton

2- Componentizable but not comprehensive
Builder
Proxy
State

Regarding Observer.
I think let's wait until Katrina (from the Qt binding project) explains 
what is needed to implement Qt Signal Slot in D2, so that hopefully the 
underlaying observer component fits.

Bjoern
PS. Source link don't work


Andrei Alexandrescu wrote:
> In wake of the increasing power of templates in D2, I am starting the 
> std.patterns module, which is to contain boilerplate for a number of 
> common design patterns (as in the GoF book). For now I'm adding a 
> Visitor implementation, which was lying in my codebase for a while.
> 
> http://ssli.ee.washington.edu/~aalexand/d/web/phobos/std_patterns.html
> http://ssli.ee.washington.edu/~aalexand/d/web/phobos/std_patterns.d
> 
> Comments and suggestions are as always welcome.
> 
> 
> Andrei



More information about the Digitalmars-d mailing list