1 / 20

OBJECT-ORIENTED MODELING WITH UML — QUESTIONS & EXAMPLES

310414 SOFTWARE ENGINEERING. OBJECT-ORIENTED MODELING WITH UML — QUESTIONS & EXAMPLES. QUESTION? . If you had to draw a map of the area around HKUST to explain to someone how to get to BUU from Chonburi , what is the one most important thing you would include?. roads.

windhamr
Télécharger la présentation

OBJECT-ORIENTED MODELING WITH UML — QUESTIONS & EXAMPLES

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. 310414SOFTWARE ENGINEERING OBJECT-ORIENTED MODELING WITH UML — QUESTIONS & EXAMPLES

  2. QUESTION? If you had to draw a map of the area around HKUST to explain to someone how to get to BUU from Chonburi, what is the one most important thing you would include? • roads. • land topology (e.g., contours showing elevation above sea level. • historical sites to see (e.g., the BS beach). • the types and places of vegetation (i.e., trees and other types of plants). • location of hiking trails. • bus routes.

  3. QUESTION? If you had to draw a map of the area around BUU to explain to someone how high the Academic Building is above sea level, what is the one most important thing you would include? • roads. • land topology (e.g., contours showing elevation above sea level. • historical sites to see (e.g., the HKUST beach). • the types and places of vegetation (i.e., trees and other types of plants). • location of hiking trails. • bus routes.

  4. QUESTION? Consider the relationship between files and directories in a computer system. Which type(s) of abstraction models this relationship? • classification only • aggregation only • generalization only • classification and aggregation • aggregation and generalization • classification and generalization • classification, aggregation and generalization • none of the above

  5. QUESTION? Which type of abstraction relates objects and classes? • classification only • aggregation only • generalization only • classification and aggregation • aggregation and generalization • classification and generalization • classification, aggregation and generalization • none of the above (this is not a type of abstraction)

  6. QUESTION? Which type of abstraction relates objects and classes? • apply classification abstraction to objects to form classes IS_MEMBER_OF relationship

  7. QUESTION? Which type of abstraction relates attributes and classes? • classification only • aggregation only • generalization only • classification and aggregation • aggregation and generalization • classification and generalization • classification, aggregation and generalization • none of the above (this is not a type of abstraction)

  8. Course QUESTION? • apply aggregation abstraction to attributes to form classes Which type of abstraction relates attributes and classes? IS_PART_OF relationship course# name instructor prerequisite

  9. The coverage of the generalization shown above is: • overlapping, complete • disjoint, complete • overlapping, incomplete • disjoint, incomplete Payment Cash CreditCard DebitCard QUESTION? What is the policy of the organization?

  10. Customer Individual Company The coverage of the generalization shown above is: • overlapping, complete • disjoint, complete • overlapping, incomplete • disjoint, incomplete QUESTION?

  11. QUESTION? Which type of abstraction relates links and associations? • classification only • aggregation only • generalization only • classification and aggregation • aggregation and generalization • classification and generalization • classification, aggregation and generalization • none of the above (this is not a type of abstraction)

  12. University Person QUESTION? • apply classification abstraction to links to form associations Which type of abstraction relates links and associations? WorksFor

  13. QUESTION? • apply aggregation abstraction to classes to form associations Which type of abstraction relates links and associations? WorksFor Person University

  14. Has ServiceOrder ServiceCall Takes ServiceAgent ServiceOrder WaitsFor ServiceOrder Part ComposedOf Product Part QUESTION? What is the most likely multiplicity of the following associations? 1 0..* 1 0..* * * 1..* 1..*

  15. Meets Day Course Classroom • for each (course, classroom) • for each (course, day) • for each (classroom, day) QUESTION? * 0..3 0..1  0, 1, 2 or 3 days  0 or 1 classrooms  many courses

  16. EXAMPLE The classes shown have some attributes that are internal object identifiers (OIDs) that should not appear at the conceptual level and should either be deleted or be replaced with relationships. All such attributes conveniently have names ending in ID. Some further information about the application follows. A person may work for any number of companies. Persons, companies, or banks may own cars. The car owner ID represents either the person, company, or bank who owns the car. A car may have only one owner (person, company, or bank). A car loan given by a bank is for the purchase of a car. A car may have multiple car loans. Prepare a class diagram in which the OIDs are either deleted or replaced with relationships. Use associations and generalizations as necessary. Show the most likely multiplicities for all associations and the final attributes for each class. Note: Your final class diagram should contain no OIDs.

  17. Person Car CarLoan name age employer1ID employer2ID employer3ID personID address ownerID vehicleID ownerType model year vehicleID customerType customerID accountNumber bankID interestRate currentBalance Company Bank name companyID name bankID EXAMPLE

  18. Owner 1 * Owns name 1 {disjoint, complete} Car model year WorksFor * * IsFor Company * CarLoan * {incomplete} Lends 1 accountNumber interestRate currentBalance Bank Person age address EXAMPLE SOLUTION It is important to realize that some IDs represent associations while others are simply internal OIDs and so should not appear as attributes at all.

  19. EXAMPLE Construct a class diagram for the classes listed below. Use association, aggregation and generalization relationships as necessary. Show the multiplicity for all relationships. file system drive file directory sector ASCII file disk executable file track

  20. EXAMPLE SOLUTION ResidesOn * 1..* File system Drive can also be aggregation (e.g., floppy, removable) 1..* 1..* * File Disk 1..* Track Directory Executable ASCII 1..* Sector

More Related