dcsimg
In associating two classes, do we use reference of the class or use the id of the class....
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Gnanasekaran_Sakthivel
Posted On:   Sunday, May 18, 2008 05:39 PM

Example: Association between Item and Bid classes.
Bid contains a reference to Item.

			
public class Item {
Integer itemId;
String name;
}

Approach 1:
			
public class Bid {
Integer bidId;
Item item;
ETC
}


Approach 2:
			
public class Bid {
Integer bidId;
Integer itemId;
ETC
}


I just would like to see the pros and cons of these two approaches.

Thank you guys
About | Sitemap | Contact