This question is related to OO Analysis and Design.
Differentiate between 1-way and 2-way association with example for each?
- Posted:
- 3+ months ago by ahsan479
- Topics:
- design, association, example, question, computer software
Answers (1)
One way association would be where the two objects have a one-many relationship (for instance an author object and a collection of book title objects). Two way association is where properties of each individual object combine to reference something unique (that neither object can reference on its own). A street number object and a road object. With them both, you get a house address.
To make this confusing, the analogy also works for an author object and book title object. There may be many authors with the same name, many books with the same name, but there is generally only one unique combination of author and book (most authors don't write multiple things and call them all exactly the same thing).