uc 17 v2 - yshehab/SchoolRoomBooking GitHub Wiki
TO DO - revise
public void addMember(Name aName, Address anAddress, Email anEmail, School aSchool)
Given: The Name object aName, the Address object anAddress, the Email object anEmail and the School object school12.
- Check that no Member object with the supplied attributes exists (linked to any Schools or Organizations in the system)
As the check suceeds:
- A new Member object member6 is created with the supplied attributes
- member6 is linked to school12
If the Member already exists then throw an exception
private collection <School> school
References a collection of all linked School objects
private collection <Organization> organizations
References a collection of all linked Organization objects
public void addMember(Name aName, Address anAddress, Email anEmail, School aSchool)
Postcondition: If a Member object exists in the system with the supplied attributes an exception is thrown, otherwise a new Member object, aMember, is created with the supplied attributes. aSchool records a reference to aMember
Collection<Member> members
public void addMember(Member aMember)
Postcondition: a reference to aMember is recorded.
public Boolean hasMember(Name aName, Address anAddress, Email anEmail)
Postcondition: returns True if the receivers members contains a Member with the supplied attributes
Collection<Member> members
public Boolean hasMember(Name aName, Address anAddress, Email anEmail)
Postcondition: returns True if the receivers members contains a Member with the supplied attributes
None
Member(Name aName, Address anAddress, Email anEmail)
Post condition: a new Member object aMember is created. A reference to aMember is returned
worksAt from School to Member
isMember from Organization to Member