Design question

Hi,

I am new to j2ee platform.

I am working on a j2ee application with jsp as presentation layer. I am using struts as MVC pattern model. I am facing some puzzle while designing the application. Hope someone share their experience with me.

When there is a one-to-many relation in the database entity, how to design the objects in a object oriented manner? Should it be a customer object with a list of order object or just a list of order id?

I suppose it should be a list of order object.

But every time when a "save customer" request is received, usually contains the customer detail and a list of order id, I will create a customer object and pass to back end. Then I need to get the list of object object from backend first before I can create a customer object.

Seems quite bad.... any idea..

Thanks.

[869 byte] By [forum_user] at [2007-9-26 18:06:48]
# 1

I guess you may wish to take a look at a later problem thread posted by me. http://forum.java.sun.com/thread.jsp?forum=92&thread=210962

Or if you are lucky, the Aggregate Entity pattern may solve your problem..

Hasan

SCJP, SCJD

Moderator JViews, Java/J2EE discussion group

http://groups.yahoo.com/group/JViews

meltwater at 2007-7-3 1:47:59 > top of Java-index,Other Topics,Patterns & OO Design...