Which Design pattern
I have a program which models manufacturing process. In each stage of the process , objects are created. Specific objects can be created only in certain stage . The objects created in later stage, are using the objects created in earlier stages i.e output of previous stage is input to later stage.Which design pattern to use to mo开发者_如何学Cdel this behavior? I am not recognizing in this, any patterns that I am aware of.
Thanks
You probably want the Builder Pattern (Wikipedia) building a Composite.
More resources here (c2com) and here (Java).
In general, always take a look at the most popular patterns list, and use them as guidelines, never allow a pattern to pattern your thinking :>
what about Pipeline ?
Maybe you can model you application on a Finite State Machine?
精彩评论