Object relationship 2005-01-05 - By Ramnish Kalsi
Back This would actually depend upon the usage. If the company object is not complete without members information, then yes, you would have to load the member information.
Alternately, if you do not need the information about the members, you could either maintain a list of ID's of the organization (instead of whole objects) , that this company is member of.
But, firstly, you should redefine your business model slightly - when you say "a company is member of other companies", what exactly do you mean. Is it an amalgamation of companies ?? If so, will the company object be accurate depiction of this umbrella business entity. ?
think about these before you finalise your model.
--ramnish.
-- --Original Message-- -- From: An interest list for Sun Java Center J2EE Pattern Catalog [mailto:J2EEPATTERNS-INTEREST@(protected)]On Behalf Of Bayarsaikhan VOLODYA (YAZ-ArGe) Sent: 05 January 2005 14:03 To: J2EEPATTERNS-INTEREST@(protected) Subject: Object relationship
Hi all,
a company can be member of other companies. class company{ ArrayList membersOf; }
when i load this company from database, do i have to load member companies too? if yes, i must load members of the members'. huh? if no, nullpointer issue !!!
how do i handle that?
thanks. Bayarsaikhan VOLODYA
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager.
This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com **********************************************************************
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|