Software Engineering System Modeling Chapter 5 (Part 2) Dr.Doaa Sami

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

Ch 12: Object-Oriented Analysis
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Department of Computing
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
NJIT 1 Domain Model Visualizing Concepts Chapter 9 Applying UML and Patterns Craig Larman.
Chapter 9 Domain Models 1CS6359 Fall 2012 John Cole.
How to Make a Domain Model Tutorial
Systems Analysis and Design in a Changing World, Fifth Edition
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
Glenn David Blank Computer Science & Engineering Department Lehigh University, Bethlehem, PA, USA With support from the National Science Foundation (Grants.
1 Chapter 2 (Cont.) The BA’s Perspective on Object Orientation.
5 Systems Analysis and Design in a Changing World, Fourth 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.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
CSC480 Software Engineering Lecture 11 September 30, 2002.
Class diagram Used for describing structure and behaviour in the use cases Provide a conceptual model of the system in terms of entities and their relationships.
UML Class Diagram Trisha Cummings. What we will be covering What is a Class Diagram? Essential Elements of a UML Class Diagram UML Packages Logical Distribution.
UML Class Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
BCS 2143 Object Oriented Design Using UML. Objectives Objects Interactions Finding Classes Relationship Between Classes Attribute and Operation Class.
Lecture 1: UML Class Diagram September 12, UML Class Diagrams2 What is a Class Diagram? A class diagram describes the types of objects in the system.
Design Model Lecture p6 T120B pavasario sem.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
12 OBJECT-ORIENTED DESIGN CHAPTER
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
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.
OO DomainModeling With UML Class Diagrams and CRC Cards Chapter 6 Princess Nourah bint Abdulrahman University College of Computer and Information Sciences.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
CHAPTER 6 OBJECT ANALYSIS.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
 Class and Diagram  Representation of Class Name Attributes Operations  Visibility of Attributes and Operations.
5 Chapter 5: Modeling Systems Requirements: Events and Things Systems Analysis and Design in a Changing World.
Elaboration popo.
Unified Modeling Language (UML)
COMP 2710 Software Construction Class Diagrams
DATA REQIREMENT ANALYSIS
ATM OO Design and Implementation Case Study
Object-Oriented Analysis and Design
Class diagram Description
OO Domain Modeling With UML Class Diagrams and CRC Cards
System Modeling Chapter 4
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Software Engineering System Modeling Chapter 5 (Part 2) Dr.Doaa Sami
OO Domain Modeling With UML Class Diagrams and CRC Cards
Object Oriented Analysis and Design
Software Engineering Lecture #11.
Object Oriented Analysis and Design Using the UML
UML Class Diagram.
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Unified Modelling Language
Software Engineering System Modeling Extra examples Dr.Doaa Sami
Understand and Use Object Oriented Methods
Software Design Lecture : 15.
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Copyright 2007 Oxford Consulting, Ltd
Software Engineering System Modeling Chapter 5 (Part 1) Dr.Doaa Sami
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Object Oriented System Design Class Diagrams
Appendix A Object-Oriented Analysis and Design
Information System Design
Chapter 4 System Modeling.
ITEC324 Principle of CS III
Domain Model: Visualizing Concepts
Presentation transcript:

Software Engineering System Modeling Chapter 5 (Part 2) Dr.Doaa Sami Modified from Sommerville’s originals

2 C. Structural Models

What is a Domain Model? Use cases looked at the system’s environment (actors) and the system’s external behavior. Use cases consider the system as a black box and help us understand how the system as a whole interacts with the outside word. Now we turn to consider the inside of the system. We do this by building the domain model, which shows what the black box (the system) encloses. uses cases elaborate the system’s behavioral characteristics (sequence of stimulus-response steps), domain model gives details of the systems structural characteristics (system parts and their arrangement) Software Engineering OO Domain Modeling

What is a Domain Model? uses cases elaborate the system’s behavioral characteristics (sequence of stimulus-response steps), domain model gives details of the systems structural characteristics (system parts and their arrangement) The next step is to model the inside of the system. We do this by building the domain model, which shows what the black box (the system) encloses. Software Engineering OO Domain Modeling

3 1. C l a s s D i a g r a m

Structural Models 4  Structural models of software display the organization of a system in terms of the components that make up that system and their relationships.  You create structural models of a system when you are discussing and designing the system architecture.  Class diagrams used for modeling the static structure of the object classes in a software system.

Class Diagram attributes, operations, relationships and behaviors. 5  A class represent a concept.  It is a description of a set of objects having similar attributes, operations, relationships and behaviors.  A class encapsulates state (attributes) and behavior (operations).  The Class Name is the only mandatory information. Class Name Attribute Operation()

From Use Cases to: Objects, Attributes, Operations (methods) -“evolutionary ” Software Engineering OO Domain Modeling

Building the Domain Model A useful strategy for building a domain model is to start with: the “boundary” concepts that interact directly with the actors and then identify the internal concepts Software Engineering OO Domain Modeling

Domain Model Relationships Conceptual Class Diagram Classes, attributes, associations Domain objects Use Case Model Functional Requirements Domain Model Define terms Glossary Interaction Diagrams Dynamic Behavior Software Engineering OO Domain Modeling

Steps to create a Domain Model Identify Candidate Conceptual classes Draw them in a Domain Model Add associations necessary to record the relationships that must be retained Add attributes necessary for information to be preserved Software Engineering OO Domain Modeling

Finding Classes 6 Categories to focus when finding represent-able objects:  Tangibles (e.g. classroom, playground).  Conceptual (e.g. course, module).  External Organizations (e.g. publisher, supplier).  Roles Played (student, teacher).  Other System (admission system, grade reporting system).

attribute values +getlength(): double Class Attributes 7  Visibility name : type [count] = default_value  underline static attributes. Student  Visibility -name: string  +  public - totalStudent:int #  protected + getName(): string  -  private + getTotalStuden()t:int  /  derived  derived attribute: not stored, -length: double -width:double attribute values +getlength(): double +getArea(): double - salary: double + getSalary(): double Rectangle /area:double but can be computed from other +getWidth():double

 Visibility -name: string Class Operations 8  Visibility name (parameters) : return_type  underline static operations. Student  Visibility -name: string  +  public - totalStudent:int  # protected + getName(): string  -  private + getTotalStuden()t:int return_type is omitted if function is: Rectangle  constructor -length: double  void -width:double +getlength(): double +getWidth():double +getArea():double - salary: double + getSalary(): double /area:double

Attributes: UML Notation Software Engineering OO Domain Modeling

Find conceptual classes Software Engineering OO Domain Modeling

Use a category list Finding concepts using the concept category list : Physical objects: register, airplane, blood pressure monitor Places: airport, hospital Catalogs: Product Catalog Transactions: Sale, Payment, reservation Software Engineering OO Domain Modeling

Identifying objects Software Engineering OO Domain Modeling

Identifying Operations ‘methods’ Software Engineering OO Domain Modeling

Objects Software Engineering OO Domain Modeling

Example: Identify conceptual classes from noun phrases Consider the following problem description, analyzed for Subjects, Verbs, Objects: The ATM verifies whether the customer's card number and PIN are correct. SC V R O O A O A If it is, then the customer can check the account balance, deposit cash, and withdraw cash. S R V O A V O A V O A Checking the balance simply displays the account balance. S M O A V O A Depositing asks the customer to enter the amount, then updates the account balance. M S V O R V OA V OA Withdraw cash asks the customer for the amount to withdraw; if the account has enough cash, S M A O V O R OA V S C V O A the account balance is updated. The ATM prints the customer’s account balance on a receipt. O A V C S V O A O Analyze each subject and object as follows: Does it represent a person performing an action? Then it’s an actor, ‘R’. Is it also a verb (such as ‘deposit’)? Then it may be a method, ‘M’. Is it a simple value, such as ‘color’ (string) or ‘money’ (number)? Then it is probably an attribute, ‘A’. Which NPs are unmarked? Make it ‘C’ for class. Verbs can also be classes, for example: Deposit is a class if it retains state information Software Engineering OO Domain Modeling

Mapping parts of speech to object model components [Abbott, 1983] Part of Speech Model Component Examples Proper noun Instance Ali Common noun Class Student, Customer,.. Doing verb Operation Buy, check,.. Being verb Inheritance Is a kind of, is one of either Having verb Aggregation (Composition) Has, consists of, includes Modal verb Constraints Must be Adjective attributes Attributes 3 years old Software Engineering OO Domain Modeling

Example: a typical description Software Engineering OO Domain Modeling

Mapping parts of speech to object model components Software Engineering OO Domain Modeling

Example: Initial POS domain model SalesLineItem Register Item Store Sale Payment Software Engineering OO Domain Modeling

Relationships 9  There are two kinds of Relationships  Association (student enrolls in course).  Generalization (parent-child relationship).  Associations can be further classified as  Aggregation.  Composition.

Associations Software Engineering OO Domain Modeling

Association  Associations denote relationships between classes. 10  Associations denote relationships between classes.  Describe the nature of the relationship.  Example:  Student enrolls into course  Course enrolled by a student. Student Course Enrolls

Multiplicity relates to ONE instance of another class. 11  Multiplicity is the number of instances one class relates to ONE instance of another class.  For each association, there are two multiplicity decisions to make, one for each end of the association.  For each instance of Professor, many Sections may be taught.  For each instance of Section, there may be either one or zero Professor as the instructor. Professor Section -name:string 0..1 has 0..* -section#:int +getName():string +getSection#:int

Multiplicity (C++ Implementation) 12 Professor Section -name:string 0..1 has 0..* -section#:int +getName():string +getSection#:int class Professor{ class Section{ // A list of Sections // Proffessor Section sec[4]; Professor prof; string name; int sectionNum; Public: Public: string getName(); int getSectionNum(); }; } ;

Multiplicity Representation 13

Multiple association between two classes Software Engineering OO Domain Modeling

Example: Initial POS domain model Software Engineering OO Domain Modeling

Example: Initial Domain model of the Monopoly Game Software Engineering OO Domain Modeling

Example: Domain model of the Monopoly Game Software Engineering OO Domain Modeling

Aggregation models a whole-part relationship between an 14 Association is used when both of the involved classes are equaly important.  Aggregation is a special form of association that models a whole-part relationship between an aggregate (the whole) and its parts.  Aggregation shows how classes that are collections are composed of other classes.  Aggregation is a part-of relationship. Car 1 4 Wheel

Composition 15  Composition is a strong form of aggregation.  Aggregation is used to model a whole-part relationship between an aggregate (whole) and its parts.  Composition is a strong form of aggregation.  The whole is the only owner of its part.  Multiplicity on the whole side must be one.  The lifetime of the part is dependent upon the whole.  When Circle is destroyed, Point is also destroyed.  The composite must manage the creation and destruction of its parts.

Composition (C++ Implementation) 16 Restaurant 1 1 Menu class Restaurant{ class Menu{ .... }; Menu m; }; ....

Generalization Cows and Wolfs are Mammals. 17 Rather than learn the detailed characteristics of every entity that we experience, we place these entities in more general classes (animals, cars, houses, etc.) and learn characteristics of these classes.  This allows us to infer that different members of these classes have some common characteristics e.g. Cows and Wolfs are Mammals.

Generalization Cont. 18  In object-oriented languages, generalization is implemented using class inheritance mechanisms.  In a generalization, the attributes and operations associated with higher-level classes (super classes) are also associated with the lower-level classes (sub classes).  Subclasses are inherit the attributes and operations from their Superclasses and then add more specific attributes and operations.

Generalization 19

Generalization Software Engineering OO Domain Modeling

Association Class association connection to have operations and 20  An association class is a construct that allows an association connection to have operations and attributes.  It used when you need to include another class because it includes valuable information about the relationship.

Example: Information System for School 21

Software Engineering OO Domain Modeling

Software Engineering OO Domain Modeling

Software Engineering OO Domain Modeling

Software Engineering OO Domain Modeling

Software Engineering OO Domain Modeling

Class or Attributes Software Engineering OO Domain Modeling

Class or Attributes Software Engineering OO Domain Modeling

Description Class Software Engineering OO Domain Modeling

Data types as attributes Software Engineering OO Domain Modeling

Attributes are NOT foreign keys Software Engineering OO Domain Modeling