Need working code for Abstract Factory and Factory Method Pattern with generics
I would like to get both Abstract Factory and Factory Method patterns written with generics.
I look forward to some wonderful 'code blocks'.
Volkan Genç, Jul 30, 2011
I have implemented both patterns with generics, based on the examples provided on the dofactory site (structural example for Abstract Factory and real-world example for Factory Method).
Even though both are possible, I don't think the Factory Method implementation is any better using the generics the way I've done it. (And I can't seem to find any better solution).
The Abstract Factory surely gains from the generics, because the implementation is reusable in all cases.
If these code blocks look like the gofactory .NET Optimized versions, it is without intent because I haven't yet had the chance to look at those.
Hopefully this is what you were looking for.
Mathieu Lavigne, Aug 01, 2011