| |
GeekInterview.com > Tech FAQs > OOPS
| Print | |
Question: I have just started doing OOP design. My experience has been in RDBMS. Where we work with tables, relation between them defined using foreign keys. Can anyone pl. help in designing classes for a simple case here. There are two tables (states, districts). Districts contains stateId as foreign key. So state to district 1-many relation is there. Such things how do we design in oops. Thanx in advance
|
| January 01, 2006 21:14:09 |
#2 |
| Nitin Gupta |
Member Since: Visitor Total Comments: N/A |
RE: I have just started doing OOP design. My experienc... |
Alternatively, what can also be done is create a connection class class connection { Vector leftNodes; Vector rightNodes; } here leftNode will contain a state and rightNode will contain multiple districts. THis design support many-to-Many, oneto-one and many-to-one and one to many relationships |
| |
Back To Question | |