Lec-4 : Unified Modeling Language (UML)

Slides:



Advertisements
Similar presentations
Modeling Main issues: What do we want to build How do we write this down.
Advertisements

Modeling Main issues: What do we want to build How do we write this down ©2008 John Wiley & Sons Ltd. vliet.
Object-Oriented Analysis and Design
Informatics 43 – May 7, Restatement of Goals for Testing Want to verify software’s correctness  Need to test  Need to decide on test cases  No.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
Introduction To System Analysis and Design
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Unified Modeling Language
Introduction To System Analysis and design
12-CRS-0106 REVISED 8 FEB 2013 CSG2H3 Object Oriented Programming.
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.
Introduction To System Analysis and Design
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
DOMAIN MODEL CLASS DIAGRAM Prepared by: Fatimah Alakeel November, 2011.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
UML Diagrams: The Static Model Class Diagrams. The Static Model Define the static structure of the logical model Represent classes, class hierarchies.
Software Design Software Design (UML) Static Modeling using the Unified Modeling Language (UML) Material based on [Booch99, Rambaugh99, Jacobson99, Fowler97,
Class Diagram. Classes Software Design (UML) Class Name attributes operations A class is a description of a set of objects that share the same attributes,
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.
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
Object Modeling THETOPPERSWAY.COM. Object Modelling Technique(OMT)  Building a model of an application domain and then adding implementation.
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.
Class Diagram Slide 1 1. Objective  Introduces the evolutionary approach for building classes  Explain how to identify objects and attributes of classes.
By Mashael AlDayel Introduction to UML. What is UML? UML (Unified Modeling Language) is a graphical language that is suit-able to express software or.
Informatics 43 – May 5, Restatement of Goals for Testing Want to verify software’s correctness  Need to test  Need to decide on test cases  No.
Entity Relationship (E-R) Model
CHAPTER
UML Diagrams: Class Diagrams The Static Analysis Model
Entity Relationship Model
Visit for more Learning Resources
Main issues: • What do we want to build • How do we write this down
Chapter 5: Structural Modeling
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Class Diagrams.
Object-Oriented Modeling with UML
Entity-Relationship Model
Entity-Relationship Modelling
Unified Modeling Language (UML)
Abstract descriptions of systems whose requirements are being analysed
UML Diagrams: The Static Model Class Diagrams
Object Oriented Analysis and Design
System models October 5, 2005.
Introduction To System Analysis and Design PART 2
Software Engineering Lecture #11.
Object Oriented Analysis and Design Using the UML
Class Diagram Slide 1.
Class Diagram Slide 1.
Systems Analysis and Design With UML 2
Chapter 20 Object-Oriented Analysis and Design
Entity-Relationship Modelling
CIS 375 Bruce R. Maxim UM-Dearborn
Appendix A Object-Oriented Analysis and Design
Understand and Use Object Oriented Methods
Static Modeling using the Unified Modeling Language (UML)
Copyright 2007 Oxford Consulting, Ltd
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Class Diagram.
CIS 375 Bruce R. Maxim UM-Dearborn
Static Modeling using the Unified Modeling Language (UML)
Object Oriented System Design Class Diagrams
Appendix A Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Presentation transcript:

Lec-4 : Unified Modeling Language (UML)

Unified Modeling Language (UML) UML (Unified Modeling Language) is a graphical language that is suit-able to express software or system requirements, architecture, and design. UML used for both database and software modeling UML modeling also supports multiple views of the same system.

UML diagrams Can be categorized as the fallowing: Structural diagrams: Show the building blocks of your system—features that don’t change with time. Ex: Class diagram Behavioral diagrams: Show how your system responds to requests or otherwise evolves over time. Ex: Use case diagram Interaction diagrams: Is a type of behavioral diagram. To depict the exchange of messages within a collaboration (a group of cooperating objects). Ex: Sequence diagram & Collaboration diagram

UML Diagrams Another way of categorizing UML diagram: Static diagrams to show the static features of the system. (no change) Dynamic diagrams to show how your system evolves over time. Functional diagrams: to show the details of behaviors and algorithms.

Object-oriented analysis (OOA) Trying to figure out what the users and customers of a software effort want the System to do. Builds a “real-world” model from requirements client interviews, domain knowledge, real-world experience collected in use cases and other simple notations OOA models address three aspects of the system (its objects) class structure and relationships sequencing of interactions and events data transformations and computations

Static Modeling using the Unified Modeling Language (UML) UML Class Diagrams

Classes A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics. Graphically, a class is rendered as a rectangle, usually including its name, attributes, and operations in separate, designated compartments. ClassName attributes operations

Class Names ClassName attributes operations Class naming: Use singular names because each class represents a generalized version of a singular object. The name of the class is always appears in the top-most compartment.

Class Attributes An attribute is a named property of a Person name : String address : Address birthdate : Date ssn : Id An attribute is a named property of a class that describes the object being modeled. In the class diagram, attributes appear in the second compartment just below the name-compartment. An object class is an abstraction over a set of objects with common: attributes (states) and and the services (operations) (methods), provided by each object.

Class Attributes (Cont’d) Attributes are usually listed in the form: attributeName : Type A derived attribute is one that can be computed from other attributes, but doesn’t actually exist. For example, a Person’s age can be computed from his birth date. A derived attribute is designated by a preceding ‘/’ as in: / age : Date Person name : String address : Address birthdate : Date / age : Date ssn : Id

Class Operations Operations describe the class behavior Person name : String address : Address birthdate : Date ssn : Id eat sleep work play What the class knows Operations describe the class behavior and appear in the third compartment. What the class does

Depicting Classes When drawing a class, you needn’t show attributes and operation in every diagram. Class diagrams provide the representations used by the developers. Person Person Person name : String birthdate : Date ssn : Id eat() sleep() work() play() Person name address birthdate Person eat play

Objects

Generalization Relationships Person A generalization connects a subclass to its superclass. It denotes an inheritance of attributes and behavior from the superclass to the subclass and indicates a specialization in the subclass of the more general superclass. Student

(Cont’d) UML permits a class to inherit from multiple superclasses. Student Employee TeachingAssistant

Association, aggregation and composition When considering the 3 relationships: association, aggregation and composition, • the most general relationship is association, • followed by aggregation • and, finally, composition.

Association Relationships If two classes in a model need to communicate with each other, there must be link between them. An association denotes that link. Student Instructor

(Cont’d) We can indicate the multiplicity of an association by adding multiplicity adornments to the line denoting the association. The example indicates that a Student has one or more Instructors: Student Instructor 1..*

(Cont’d) The example indicates that every Instructor has one or more Students: Student Instructor 1..*

(Cont’d) We can also indicate the behavior of an object in an association (i.e., the role of an object) using rolenames. teaches learns from Student Instructor 1..* 1..*

We can also name the association. (Cont’d) We can also name the association. membership Student Team 1..* 1..*

We can specify dual associations. (Cont’d) We can specify dual associations. member of Student Team 1..* 1..* 1 president of 1..*

(Cont’d) Associations can also be objects themselves, called link classes or an association classes. Registration modelNumber serialNumber warrentyCode Warranty Product

A class can have a self association. (Cont’d) A class can have a self association. LinkedListNode next previous

Aggregations We can model objects that contain other objects by way of special associations called aggregations and compositions. An aggregation specifies a whole-part relationship between an aggregate (a whole) and a constituent part, where the part can exist independently from the aggregate. Aggregations are denoted by a hollow-diamond adornment on the association. Example: a bank (whole) has customers (as parts) .Deleting a bank does not cascade deleting customers. Customers can move to another bank

Compositions A composition indicates a strong ownership and coincident lifetime of parts by the whole (i.e., they live and die as a whole). Compositions are denoted by a filled-diamond adornment on the association. Window Scrollbar 1 1 Titlebar 1 1 Menu 1 1 .. *

(Cont’d) Example : A bank (whole) has many branches (parts). Branches can not exist independently of the whole (parts objects can NOT exist independently) Deleting a bank (whole) cascades deleting branches (parts). But, if a branch (part) is deleted, the bank (whole) may remain.

Inheritance: is a “is a kind of” is a association. Child class ‘subclass’ can inherit attributes and operations from parent class‘superclass’. Example: An inheritance hierarchy in the animal kingdom

Library class hierarchy Class name Library item Library class hierarchy Catalogue number Acquisition date Cost Attributes Type Status Number of copies Methods Operations Acquire () Catalogue () Dispose () Issue () Is a Return () Generalisation Published item Recorded item Title Is a Title Publisher Medium Book Magazine Film Computer program Director Author Edition Year Issue Date of release Version Distributor Publication date Platform ISBN

User class hierarchy Library user Name Address Phone Registration # Register () De-register () Reader Borrower Affiliation Items on loan Max. loans Staff Student Department Major subject Department phone Home address

Hierarchy Diagram (UML notation) PERSON Name, Address Phone, Sex Date of Birth ChangeAddress EnquireDOB&Sex ISA CUSTOMER EMPLOYEE Balance SIN O/Due 30, 60, 90 Credit Rating Marital Status This kind of arrowhead indicates that this No. of Dependants Date Hired Date Paid CheckCrRating AgeBalances relationship is one of subclassing Wage Rate GiveRaise CalcMonthPay

Multiple inheritance Rather than inheriting the attributes and services from a single parent class, a system which supports multiple inheritance allows object classes to inherit from several super-classes.

Example: Multiple inheritance The talking book Voice recording Author Edition Speaker Duration Publication date ISBN Recording date Talking book # Tapes

Summary of UML Class Diagram Notation

Summary of UML Class Diagram Notation

UML Example for Displaying Specialization / Generalization

UML Diagrams Another way of categorizing UML static diagram: Component Diagrams Show the organizations and dependencies among software components. Deployment Diagrams Represent the distribution of components across the hardware topology

Component Diagrams

Deployment Diagrams