Take the 2-minute tour ×

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?


share|improve this question
Can you provide some more info about your use case? –  philfreo Sep 25 '10 at 4:06
add comment

2 Answers

It sounds like you want the builder pattern

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

share|improve this answer
add comment

Consider using dependency injection.

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

share|improve this answer
add comment

Your Answer


