views:

40

answers:

2

Hi,

I have to create a lot of objects which relate to each (i.e. one is passed in as a parameter of the constructor to the other) to do some work.

Usually factory type patterns seem suitable for making only one object. This is several. I was thinking of doing something like a fluent interface and then the properties on the class are the final objects, or use the specification design pattern. Is there any other better way?

Thanks

+1  A: 

It sounds like you want the builder pattern

sorry, that link had a dead image, this one may help also

David
+1  A: 

Consider using dependency injection.

You did not mention the platform, but if its dot net (as hinted by your username) then I suggest StructureMap.

eglasius