Defining Other Objects
In a similar fashion we define other objects:
| Business Object | Is Related To |
|---|---|
Reservation | Member (multiple not allowed; matching attribute in Member – Reservations) |
Item (multiple not allowed; matching attribute in Item – “Reservation”) |
|
Fee | Member object (multiple not allowed; matching attributes in Member – Fees |
Payment | Member object (multiple not allowed; matching attributes in Member – Payments |
For Fee and Payment objects we will choose to make their relationship with the Member object as a relationship of an “owner” (parent) and “owned by” (child), rather than “peer”. The “peer” relationship indicates that the instances of two objects can exist independently of each other, whereas the “Owner of” relationships indicates that the instances of the referred object may not exist without the instance of its parent, so if the instance of the parent is deleted the instances of the child must be deleted as well (we will see the examples of the “Owner of” and “Owned by” relationship later). Fees and payments do not make much sense without the member they belong to – as soon as this member is deleted the corresponding fees and payments must be deleted as well. Therefore we select the relationship type for the Member attribute of both Fee and Payment object as “Owned by” in the dialog of the “Matching Data” property1).
We have now created most business objects and their attributes. We will be creating a few more objects and attributes as we go along, but the core is there already. We now need to define business rules.
Member object a parent of not only Fees and Payments but also Loans and Reservations. However, with Loans and Reservations the situation is slightly more complicated because you could say that they are children not only of the Member object but also of the Item object. We could create two parents for these objects – for simplicity though we will make all these objects independent for now.