uc 16 v2 - yshehab/SchoolRoomBooking GitHub Wiki

16. Add an existing member to an existing organization. Version 2

TO DO - revise

Coordinating method

public void addMemberToOrganization(Member aMember, Organization anOrganization)

Object diagram for a typical scenario.

Walk-through for this scenario

Given: The Member object, member6 and the Organization object, organization45

  1. Check if member6 is linked to organization45.
    As member6 is not linked to organization45:
  2. organization45 records a reference to member6

Sequence diagram for this scenario

Notes on alternative scenario

If Member is already a member of the organization, do nothing

Updates to implementation model

Classes

Class Organization

Links

Collection<Member> members

Methods

void addMember(Member aMember)

Class LettingCoord

Links

None

Methods

public void addMemberToOrganization(Member aMember, Organization anOrganization)

Navigations

isMemberOf from Organization to Member

Discussion

Probably could do without the Boolean return and have the UI only allow selection from organizations the member is not already a member of.

Where can an existing Member be selected from within the UI?

The options are:

  • From all other Organizations - would need a public method to select all organizations -> all members.
  • From all Schools - ditto - all Schools -> all members.
  • From everywhere - ditto - Set of both of the above - a bit of a monster.
  • Manually by the user picking a school -> Member &/or Organization -> Member.
⚠️ **GitHub.com Fallback** ⚠️