uc 06 v2 - yshehab/SchoolRoomBooking GitHub Wiki

6. View all bookings and their details for a given organization. Version 2

TO DO - revise

Coordinating method

Collection <Booking> getBookings(Organization anOrganization)

Object diagram for a typical scenario.

Walk-through for this scenario

Given: The Organization object, organization9

  1. Access the collection of Permit objects linked to organization9, which in this case is {permit5, permit66}.
  2. Create a new empty collection, results.
    For each Permit object accessed in step 1:
  3. Access it_s collection of Booking objects
  4. Add each Booking object to results
  5. Return results

Sequence diagram for this scenario

Notes on alternative scenarios

If there are no Permits linked to an Organization, or no Bookings linked to a Permit then return an empty collection

Updates to implementation model

Classes

Class Permit

Links

private collection<Booking> bookings

Methods

public collection<Booking> getBookings()
Post condition: returns bookings

Class Organization

Links

private collection<Permit> permits

Methods

public collection<Booking> getBookings()
Post condition: returns a collection of all Booking objects linked to all Permit objects in permits.

Class LettingCoord

Links
Methods
Collection <Booking> getBookings(Organization anOrganization)

Post condition: returns a collection of Booking objects which are linked to the Permit objects linked to anOrganization

Navigations

consistsOf from Permit to Booking
hasPermit from Organization to Permit

Discussion

⚠️ **GitHub.com Fallback** ⚠️