🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

ACS2913 Software Requirements Analysis and Design Instructor: David Tenjo DOMAIN MODELING THE UNIVERSITY OF WINNIPEG - ACS 2913 - FALL 2020 1 The Domain Model Class Diagram Class ◦ A type of classification used to describe a collection of objects Domain Class ◦ Classes that describe objects in...

ACS2913 Software Requirements Analysis and Design Instructor: David Tenjo DOMAIN MODELING THE UNIVERSITY OF WINNIPEG - ACS 2913 - FALL 2020 1 The Domain Model Class Diagram Class ◦ A type of classification used to describe a collection of objects Domain Class ◦ Classes that describe objects in the problem domain Class Diagram ◦ A UML diagram that shows classes with attributes and associations (plus methods if it models software classes) Domain Model Class Diagram ◦ A class diagram that only includes classes from the problem domain, not software classes so no methods SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 2 UML Domain Class Notation Domain class Notation includes a name and attributes (no methods) Class name is always capitalized Attribute names are not capitalized and use camelback notation (words run together and second word is capitalized) Compound class names also use camelback notation SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 3 Simple Domain Model Class Diagram ◦ A customer places zero or more orders ◦ An order is placed by exactly one customer ◦ An order consists of one or more order items ◦ An order item is part of exactly one order SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. UML Notation for Multiplicity How many instances of one class are related to how many instances of another class. SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 5 Domain Model Class Diagram Bank with many branches ◦ Note notation for the key ◦ Note the precise notation for the attributes (camelback) ◦ Note the multiplicity notation SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 6 Domain Model Class Diagram Course Enrollment at a University There are many CourseSections for a Course A CourseSection has many Students and a Student is registered in many CourseSections Problem ◦ How/where to capture student grades? SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 7 Refined Course Enrollment Model with an Association Class Association class— an association that is treated as a class in a many to many association because it has attributes that need to be remembered (such as grade) SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 8 The association class is the same “thing” as the association itself Association Class Properties The unique identifier (key) for the association class is the concatenation of the keys of the attached classes ◦ In the previous example the key for CourseSection is CourseNumber+SectionNumber ◦ Hence the key for CourseEnrollment is CourseNumber+SectionNumber+StudentID ◦ Note: If more information is required to uniquely identify instances of the association class, then the model is incorrect, i.e., if the key cannot be formed by the concatenation of the endpoint keys, it is in error. SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 9 Hospital Registration System Where is each patient' medical history remembered in this model? ◦ Each Ward has many medical histories and each medical history is associated with a patient ◦ Each patient has many visits and each visit is association with a ward 10 Admission System with Association Class 11 Band with members and concerts ◦ How many bands can a person play in? ◦ For a band, how many concerts can it play in? ◦ For a concert, how many bands may be playing? ◦ What attributes can you use for keys? Do you need to add “key” attributes? SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 12 Band with Concert Booking Information Note: The association class (Booking) also provides a name and meaning for the association Given the keys you identified, what is the key for the Booking class? Does it uniquely identify instances? SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 13 Generalization/Specialization ◦ A hierarchical relationship where subordinate classes are special types of the superior classes. Often called an Inheritance Hierarchy Superclass More Complex Issues about Classes: ◦ the superior or more general class in a generalization/specialization hierarchy Subclass Generalization/Specialization Relationships ◦ the subordinate or more specialized class in a generalization/specialization hierarchy Inheritance ◦ the concept that subclasses classes inherit characteristics of the more general superclass SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 14 Generalization/Specialization SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 15 Generalization/Specialization Inheritance for RMO Three Types of Sales Abstract class— a class that allow subclasses to inherit characteristics but never gets instantiated. In Italics (Sale) Concrete class— a class that can have instances Inheritance – Attributes of OnlineSale are: ◦ timeOnSite, chatUse, saleDateTime, priorityCode, S&H, tax, totalAmt… SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 RIGHTS RESERVED. ©2016. CENGAGE LEARNING. ALL 16 Generalization/Specialization Inheritance for the Bank with Special Types of Accounts A SavingsAccount has 4 attributes A CheckingAccount has 5 attributes Note: the subclasses inherit the associations too SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 17 More Complex Issues about Classes: Whole Part Relationships Whole-part relationship— a relationship between classes where one class is part of or a component portion of another class Aggregation— a whole part relationship where the component part exists separately and can be removed and replaced Computer has disk storage devices (storage devices exist apart from computer) ◦ Car has wheels (wheels can be removed and still be wheels) Composition— a whole part relationship where the parts cannot be removed (filled in diamond symbol) ◦ OrderItem on an Order (without the Order, there are no OrderIterms) ◦ Chip has circuits (without the chip, there are no circuits) SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 18 Whole Part Relationships Computer and its Parts Note: this is aggregation, with diamond symbol. Whole part can have multiplicity symbols too SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 19 Whole-part relationships Composition THE UNIVERSITY OF WINNIPEG - ACS 2913 - FALL 2016 20 Aggregation vs. Composition The composition and aggregation are two subsets of association. In both cases, the object of one class is owned by the object of another class; the only difference is that in composition, the child does not exist independently of its parent, whereas in aggregation, the child is not dependent on its parent i.e., standalone. Association An aggregation is a special form of association, and composition is the special form of aggregation. Aggregation Composition THE UNIVERSITY OF WINNIPEG - ACS 2913 - FALL 2020 21 There are actually three types of relationships in class diagrams ◦ Association Relationships ◦ These are associations discussed previously, just like ERD relationships More on UML Relationships ◦ Whole Part Relationships ◦ One class is a component or part of another class ◦ Generalizations/Specialization Relationships ◦ Inheritance ** Remember: Do not confuse relationship with association SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 22 There are several ways to create the domain model class diagram for a project RMO CSMS has 27 domain classes overall Can create one domain model class diagram per subsystem for those working on a subsystem Can create one overall domain model class diagram to provide an overview of the whole system RMO CSMS Project Domain Model Class Diagrams Usually in early iterations, an initial draft of the domain model class diagram is completed and kept up to date. It is used to guide development. SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 23 RMO CSMS Project Sales Subsystem Domain Model Class Diagrams SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 24 RMO CSMS Project Customer Account Subsystem Domain Model Class Diagram 25 RMO CSMS Project Complete Domain Model Class Diagram SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 26 Given the complete RMO CSMS Domain Model Class Diagram and Sales and Customer Account subsystem examples: RMO CSMS Project Domain Model Class Diagrams ◦ Try completing the Order Fulfilment Subsystem Domain Model Class Diagram ◦ Try Completing the Marketing Subsystem Domain Model Class Diagram ◦ Try Completing the Reporting Subsystem Domain Model Class Diagram Review the use cases from Chapter 3 and decide what classes and associations from the complete model are required for each subsystem ◦ Classes and associations might be duplicated in more than one subsystem model SYSTEMS ANALYSIS AND DESIGN IN A CHANGING WORLD, 7TH EDITION – CHAPTER 4 ©2016. CENGAGE LEARNING. ALL RIGHTS RESERVED. 27 Summary The UML class diagram notation is used to create a domain model class diagram for a system. The domain model classes do not have methods because they are not yet software classes. There are actually three UML class diagram relationships: association relationships, generalization/specialization (inheritance) relationships, and whole part relationships Other class diagram concepts are abstract versus concrete classes, compound attributes, composition and aggregation, association classes, super classes and subclasses 28

Use Quizgecko on...
Browser
Browser