1 / 7

CSC 216/002

CSC 216/002. Lecture 2. UML Class Diagrams. What are the little numbers for on the edges leading from the box representing a class?. Is-a vs. Has-a. A poodle is-a dog . A car has-a transmission. Aggregation vs. Association. An aggregation is a set of objects that make up a unit.

Download Presentation

CSC 216/002

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSC 216/002 Lecture 2

  2. UML Class Diagrams • What are the little numbers for on the edges leading from the box representing a class?

  3. Is-a vs. Has-a • A poodle is-a dog. • A car has-a transmission.

  4. Aggregation vs. Association • An aggregation is a set of objects that make up a unit. • Example? • An association is two or more objects that work together, but one is not part of another. • Example?

  5. Class-Responsibility-Collaborator • Classes: To find the objects, look for the nouns. • Responsibilities: Things a class knows or can do. • Collaborators: Other classes that are involved in fulfilling these responsibilities.

  6. Requirements for the Course-Registration System • The mission is to automate registration of students for courses at a university. • Each student takes one or more courses, which are identified by name and course number. • Each course is worth one or more credit hours. • A student can register for up to 21 credit hours. • For each course that is taught, the students are placed into sections, which may meet at different times and be taught by different instructors. • If more than 50 students want to take the same class, another section will be added. • If fewer than 5 students register for a section, it will be canceled. • If no instructor can be persuaded (or hired) to teach a class, it will be canceled. • Students may specify alternate courses or sections, in case of a time conflict, or if their first-choice class is canceled. • After a student has registered for courses, (s)he will be e-mailed a class schedule.

  7. Requirements for the Flight-Reservation System • The mission is to allow round-trip airline tickets to be bought over the Web. • Each customer specifies an origination point, a destination, and dates for outbound and return flights. • The customer reserves one outbound flight and one returnflight from a menu presented by the system. • Each choice that the system presents consists of one or more flight segments (there may be a change of planes). • The customer may buy tickets for one or more passengers. • No more tickets can be sold for a flight than there are seats on the plane. • Each passenger is assigned to a specific seat. • The system calculates the total cost of the tickets by adding the cost of the individual segments. • If dissatisfied with the cost, the customer may select alternate flights. • After a customer has bought a ticket, (s)he will be e-mailed a confirmation.

More Related