Link to home
Start Free TrialLog in
Avatar of posseke
possekeFlag for Cabo Verde

asked on

OOP Question - How To implement certain methods in my object model

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.

For example:

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!

Greetz, po$$e
ASKER CERTIFIED SOLUTION
Avatar of Darren
Darren
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of posseke

ASKER

Thx for the replies both of you,

Both Factory Pattern and the extra class (derived or non-derived) are possible, I'll look further into the Factory , this will do fine!

Greetz, po$$e