Chapter 7 Understanding More Complex Requirements Models Using Generalization / Specialization and Whole-Part Hierarchies.

Slides:



Advertisements
Similar presentations
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
Advertisements

Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
Chapter 14 (Web): Object-Oriented Data Modeling
Chapter 12 Java Code Examples Showing Problem Domain Classes.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Overview Objective: refine information gathered
2Object-Oriented Analysis and Design with the Unified Process Events and Use Cases  Use case  Activity the system carries out  Entry point into the.
6. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Explain how events can be used to identify use cases that define requirements.
Systems Analysis and Design in a Changing World, 6th Edition
Chapter 14: Object-Oriented Data Modeling
Unified Modeling Language
Extending ER Diagrams (13) CPSC 356 Database Ellen Walker Hiram College (Includes figures from Database Systems: A Practical Approach to Design, Information.
Chapter 5: Modeling Systems Requirements: Events and Things
Systems Analysis and Design in a Changing World, Tuesday, Feb 27
Modeling System Requirements:
Systems Analysis and Design in a Changing World, Fifth Edition
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Systems Analysis and Design in a Changing World, Fifth Edition
Association Class Generalization/Specialization Whole-Part Page More Associations 1.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Lab 04.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
1 © Prentice Hall, 2002 Chapter 14: Object-Oriented Data Modeling Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
© 2011 Pearson Education 1 Chapter 13 (Online): Object-Oriented Databases Modern Database Management 10 th Edition, International Edition Jeffrey A. Hoffer,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Chapter 5 Models and UML Notation for The Object-Oriented Approach.
Domain Modeling Part2: Domain Class Diagram Chapter 4 pp part 2 1.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
5 - 1 Copyright © 2006, The McGraw-Hill Companies, Inc. All rights reserved.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Objectives Explain how events can be used to identify use cases that define requirements Identify and analyze events and resulting use cases Explain.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
Chapter 8 - Additional Inheritance Concepts and Techniques1 Chapter 8 Additional Inheritance Concepts and Techniques.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
What is a Structural Model?
Component 4/Unit 6b Topic II Relational Databases Keys and relationships Data modeling Database acquisition Database Management System (DBMS) Database.
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
Example: object diagram for Scheduler, v What is wrong with this diagram? Seems like a lot of similarity between Task and UnplannedTask Can use.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
Object-Oriented Application Development Using VB.NET 1 Chapter 5 Object-Oriented Analysis and Design.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) Modern Database Management 11 th Edition Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson.
Class Diagram Lecture # 1. Class diagram A Class Diagram is a diagram describing the structure of a system shows the system's classes Attributes operations.
25/2/16. Software Design (UML) ClassName attributes operations A class is a description of a set of objects that share the same attributes, Operations.
Chapter 5: Structural Modeling
5 Systems Analysis and Design in a Changing World, Fourth Edition.
5 Chapter 5: Modeling Systems Requirements: Events and Things Systems Analysis and Design in a Changing World.
Entity Relationship (E-R) Model
UML Diagrams: Class Diagrams The Static Analysis Model
Business System Development
DATA REQIREMENT ANALYSIS
The Movement To Objects
Systems Analysis and Design in a Changing World, 6th Edition
Systems Analysis and Design
Software Lifecycle Activities
Entity-Relationship Model
Object Oriented Analysis and Design
Domain Class Diagram Chapter 4 Part 2 pp
Systems Analysis and Design in a Changing World, 6th Edition
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Presentation transcript:

Chapter 7 Understanding More Complex Requirements Models Using Generalization / Specialization and Whole-Part Hierarchies

Understand systems having a Generalization / Specialization Hierarchy Generalization / Specialization Hierarchy associated with another class Inheritance from a class that is not Abstract Generalization / Specialization with Multiple Inheritance Whole / Part Relationships Complex Whole-Part Hierarchies Chapter Objectives

Generalization / specialization hierarchy tree of classes and subclasses that lead from the general to the specific Generalization / Specialization

Source: Specialization Generalization Super ClassSub Class

Whole / Part Whole / part hierarchy tree of classes and subclasses that lead from the entire entity to its individual components also an example of aggregation

Whole / Part Components Aggregation Part Whole Super ClassSub Class

A medical clinic needs to store information about doctors and patients. want to store information about each doctor name, date of birth, date employed, specialty also need information about patients name, date of birth, employer, insurance company Object classes in this problem domain obviously include doctors and patients These two classes have things in common names and date of birth as attributes Leads to general class: Person Still need to define two specialized classes for these two types of people because they do have unique attributes for doctors, still want to know date of employment and specialty for patients still want to know employer and insurance company Example

Result is three classes Person, DoctorPerson, PatientPerson Person is a general class Generalization / Specialization hierarchy is indicated in UML by the triangle symbol on the line which connects Person to DoctorPerson and PatientPerson. Example (c)

Use case (Add new doctor) Event: A doctor is newly employed by the clinic Use Case: Add new doctor, Main scenario user sends message to DoctorPerson class asking it to add new DoctorPerson object DoctorPerson class needs Name, Date of Birth, Date Employed, and Specialty to add a DoctorPerson object, so user is asked to provide those values user supplies requested values DoctorPerson class adds new DoctorPerson object and tells the user task is complete

Sequence Diagram Add new Doctor

Event: A new patient is added to the clinic. Use Case: Add new patient, Main scenario user sends message to PatientPerson class asking it to add new PatientPerson object PatientPerson class needs Name, Dare of Birth, Insurance Company, and Employer to add PatientPerson object, so user asked to provide those values user supplies requested values PatientPerson class adds new PatientPerson object and tells user task is complete Use case (Add new patient)

Sequence Diagram Add new Patient

No reason to add a Person object explicitly Person class is inherited by DoctorPerson and PatientPerson This design enables users to look up information about doctors and patients query capability is implicit user could ask to see all doctors with specific specialty user could ask to see all the patients with specific insurance company would require extended interface and additional programming objects could become records in relational database DBMS would enable queries against those records Comments on Use Cases

Example (c) Add another class to the problem domain Treatment attributes are Date, Start Time, End Time Each Treatment is associated with the DoctorPerson we providing the treatment assuming one doctor per treatment A PatientPerson might receive many treatments Such associations are shown on the class diagram

Generalization / Specialization Hierarchy Associated with Treatment

Use Case (Record Treatment) Event: A patient receives a treatment Use Case: Record treatment, Main scenario user sends a message to Treatment class asking to add new Treatment object Treatment needs DoctorPerson Name and PatientPerson Name because it is required to connect to both objects, so user is asked to provide these values user supplies the values Treatment class needs the Date, Start Time, and End Time for the time, so user is asked to provide these values user supplies the values Treatment class adds new Treatment object using Date, Start Time and End Time connects to correct DoctorPerson object connects to correct PatientPerson object tells user task is complete

Sequence Diagram Record Treatment

Inheritance from a Class That is not Abstract Generalization / Specialization hierarchies can be complex Sometimes a general class includes objects and is also specialized into subclasses that also include objects

Generalization / Specialization with Multiple Inheritance In the dive shop example, some customers are both dive customers and boat customers. Some customers who dive always rent a boat. Class diagram that includes an additional class, Dive&BoatCustomer, appears to solve the problem. Dive&BoatCustomer inherits all attributes and services of DiveCustomer & BoatCustomer. This called multiple inheritance because the object inherits attributes and services from multiple classes.

Multiple Inheritance

Whole-Part Relationships Object relationships in which an object has a particularly strong association with other objects the first object’s parts Example of whole-part relationship specific college and the faculty who teach in the college college “contains” or “includes” faculty UML symbol for a whole-part relationship is a diamond on the line connecting to classes.

Whole-part Relationships (aggregation) with Cardinality / Multiplicity Indicated

Example Whole-Part Hierarchy At the dive shop, a Boat Assembly, not a boat, is rented. one type contains a boat hull, motor, trailer another type Boat Assembly contains boat hull, two motors, but no trailer third type Boat Assembly contains boat hull and trailer, but no motor Important for the dive shop to know what each type Boat Assembly includes. Boat Assemblies are permanent “packages” whose parts stay together and are never rented separately. Dive shop needs to know what they are renting determines rental price ensures return of complete assembly

Boat Assemblies

Use Case (Add new Boat) Event: New boat assembly purchased for rental. Use Case: Add a new boat assembly, Main scenario user sends a message to BoatAssembly asking for new BoatAssembly object BoatAssembly needs Coast Guard ID and Total Weight to add new Boat Assemble object user asked user for those values user supplies requested values BoatAssembly then adds new BoatAssembly object

BoatAssembly is a collection of parts has one Boat Hull user asked for Hull Number and Capacity of Boat Hull user supplies Boat Hull values BoatAssembly asks BoatHull to add new BoatHull object BoatAssembly might include one trailer user asked if assembly includes Trailer if so, user asked for Serial Number and License Number User supplies Trailer Values Adding a new boat

BoatAssembly asks Trailer to add new Trailer object BoatAssembly might include one or more Motors if so, for each motor, user asked for Serial Number, Manufacturer, Model Number, Horsepower User supplies Motor values BoatAssembly asks Motor to add Motor object Adding a new boat

Adding a new boat Sequence diagram

Review Questions 1. What can one class inherit from another class? 2. What symbol in the class diagram indicates A Generalization / Specialization Hierarchy? 3. What is the difference between a class with its name written in italics and a class with its name written with ordinary letters? 4. What is a nonexhaustive Generalization / Specialization Hierarchy?

5. What is multiple inheritance? 6. Why is the multiple inheritance example for the dive shop a potential problem? 7. Explain why whole-part hierarchies contain object relationships but Generalization / Specialization Hierarchies do not. 8. What are the advantages of using whole-part hierarchies in the class diagram? Review Questions