Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.

Slides:



Advertisements
Similar presentations
UML (cont.) “The Unified Modeling Language User Guide” by G. Booch, J. Rumbaugh and I. Jacobson ● Classes ● Relationships ● Class diagrams ● Examples.
Advertisements

Stereotypes Stereotypes provide the capability to create a new kind of modeling element. –They can be used to classify or mark modeling elements. –A type.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
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.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
Slide 1 Chapter 7 Structural Modeling. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
What is UML? A modeling language standardized by the OMG (Object Management Group), and widely used in OO analysis and design A modeling language is a.
Page 1  Copyright © 1997 by Rational Software Corporation Class Diagrams A class diagram shows the existence of classes and their relationships in the.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Programming With Java ICS201 University Of Hail1 Chapter 12 UML and Patterns.
Common Mechanisms in UML
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
© SERG Software Design (UML) Software Design Static Modeling using the Unified Modeling Language (UML) Material based on [Booch99, Rambaugh99, Jacobson99,
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
© SERG Software Design (UML) Software Design Static Modeling using the Unified Modeling Language (UML) Material based on [Booch99, Rambaugh99, Jacobson99,
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.
DOMAIN MODEL CLASS DIAGRAM Prepared by: Fatimah Alakeel November, 2011.
Uml is made similar by the presence of four common mechanisms that apply consistently throughout the language. After constructing or developing the architecture.
Slide 1 Structural Modeling Chapter 7. Slide 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Class Modeling. Basic Class Modeling Concepts Object Class Link Association Generalization Inheritance.
Domain Modeling Part2: Domain Class Diagram Chapter 4 pp part 2 1.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
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.
Software Design Software Design (UML) Static Modeling using the Unified Modeling Language (UML) Material based on [Booch99, Rambaugh99, Jacobson99, Fowler97,
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.
2007ACS-3913 Ron McFadyen1 Class Diagram See Schaum’s UML Outline, especially chapters 4, 5, 6, 7.
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,
Chapter 5 System Modeling Sommerville, "software engineering ", 9 th Ed., 2011.
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.
Database Design – Lecture 12 Object Oriented Database Design cont’d.
Programming With Java ICS201 University Of Hail1 Chapter 12 UML and Patterns.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
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.
Overview of Software Project Management Review – Class 5 UML diagrams cont Overview of Software Project Management - Communication CEN 4010 Class 6 – 09/15.
© SERG Software Design Static Modeling using the Unified Modeling Language (UML) Material based on [Booch99, Rambaugh99, Jacobson99, Fowler97, Brown99]
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
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.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
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.
1 Chapter 13: Class Diagram Chapter 19 in Applying UML and Patterns Book.
Chapter 5: Structural Modeling
Modeling with UML – Class Diagrams
Unified Modeling Language (UML)
Lec-4 : Unified Modeling Language (UML)
Visit for more Learning Resources
Chapter 5: Structural Modeling
UML Class & Object Diagram II
Unified Modeling Language (UML)
An Introduction to Inheritance
UML Unified Modelling Language
UML Class Diagrams: Basic Concepts
Object Oriented Analysis and Design
Unified Modelling Language
Understand and Use Object Oriented Methods
Static Modeling using the Unified Modeling Language (UML)
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.
Static Modeling using the Unified Modeling Language (UML)
Information System Design
Presentation transcript:

Class Diagram Chapter 21 Applying UML and Patterns Craig Larman

Objectives Identify the meaning of Class Diagram Identify the different between Domain Model and Design Model Learn how we build UML Class Diagram (Class, Attribute, Relationship )

Class Diagrams A class diagram shows the existence of classes and their relationships in the logical view of a system UML modeling elements in class diagrams – Classes and their structure and behavior – Association, aggregation, dependency, and inheritance relationships – Multiplicity and navigation indicators – Role names

Software Design (UML) Classes ClassName attributes operations 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.

Software Design (UML) Class Names ClassName attributes operations The name of the class is the only required tag in the graphical representation of a class. It always appears in the top-most compartment.

Software Design (UML) Class Attributes 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.

Software Design (UML) Class Attributes (Cont’d) Person name : String address : Address birthdate : Date / age : Date ssn : Id 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

Software Design (UML) Class Attributes (Cont’d) Person + name : String # address : Address # birthdate : Date / age : Date - ssn : Id Attributes can be: + public # protected - private / derived

Software Design (UML) Class Operations Person name : String address : Address birthdate : Date ssn : Id eat sleep work play Operations describe the class behavior and appear in the third compartment.

Software Design (UML) Class Operations (Cont’d) PhoneBook newEntry (n : Name, a : Address, p : PhoneNumber, d : Description) getPhone ( n : Name, a : Address) : PhoneNumber You can specify an operation by stating its signature: listing the name, type, and default value of all parameters, and, in the case of functions, a return type.

Software Design (UML) Relationships In UML, object interconnections (logical or physical), are modeled as relationships. There are three kinds of relationships in UML: dependencies generalizations associations

Software Design (UML) 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

Software Design (UML) Generalization Relationships (Cont’d) Student UML permits a class to inherit from multiple superclasses, although some programming languages (e.g., Java) do not permit multiple inheritance. TeachingAssistant Employee

Software Design (UML) 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. Instructor Student

Software Design (UML) Association Relationships (Cont’d) We can indicate the multiplicity of an association by adding multiplicity. The example indicates that a Student has one or more Instructors: Instructor Student 1..*

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

Software Design (UML) Association Relationships (Cont’d) We can also indicate the behavior of an object in an association (i.e., the role of an object) using rolenames. Instructor Student 1..* learns fromteaches

Software Design (UML) Association Relationships (Cont’d) We can also name the association. Team Student membership 1..*

Software Design (UML) Association Relationships (Cont’d) We can specify dual associations. Team Student member of 1..* president of11..*