OOP Question - How To implement certain methods in my object model
Posted on 2007-07-24
I have a rather theoritical question concerning OOP.
I have my object model containing every single business object.
Every business object alsohas its own DAO object (Data Access Object) that controls the data manipulation.
Now I've come to the point that i need to create certain methods that use one of my business objects, but don't really fit anywhere in the existing objects I created.
Let's say I have an Business Object 'Order', which contains all properties and calls to the DAO object for data manipulation (Load, Save, Delete).
Now I create a method 'createProductionOrder'. In the business logic of my case, a production order is divided in two; a transfer order and a production order. So I need to create two 'Orders' in this one method.
And this is why i'm confused: I cannot put this method in my 'Order' class because it creates two different types of Orders.
Should i implement a new pattern, or maybe a helper class of some sort? Please, any help is strongly appreciated!