CONCEPTUAL DESIGN: UML CLASS DIAGRAM RELATIONSHIPS

Slides:



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

UML an overview.
214 CONCEPTUAL DESIGN: UML CLASS DIAGRAM RELATIONSHIPS.
Introduction to UML: Structural &Use Case Modeling
ESE Einführung in Software Engineering 6. Modeling Objects and Classes Prof. O. Nierstrasz.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
CS 340 UML Class Diagrams. A model is an abstraction of a system, specifying the modeled system from a certain viewpoint and at a certain level of abstraction.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
CONCEPTUAL DESIGN: UML CLASS DIAGRAM RELATIONSHIPS
Object-Oriented Analysis and Design
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
IMSE 11 - UML Class Diagrams
© Copyright Eliyahu Brutman Programming Techniques Course.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
UML and Object Oriented Concepts
Unified Modeling Language
Introduction To System Analysis and design
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
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.
CSCI-383 Object-Oriented Programming & Design Lecture 9.
CIT UPES | Sept 2013 | Unified Modeling Language - UML.
Introduction to UML By: Prof. Aiman Hanna Department of Computer Science, Concordia University, Montreal, Canada.
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.
Unified Modeling Language, Version 2.0
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Introduction To System Analysis and Design
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: An Aside: The Quickest Tour through the UML that you will ever get.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
1 © Prentice Hall, 2002 Chapter 14: Object-Oriented Data Modeling Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
Unit 1 INTRODUCTION TO MODELING AND CLASS MODEL Ref : L7-UML.PDF.
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.
By: DiGitAll UML an overview. Topics covered in this Session 1. Introducing UML. 2. What constitutes the UML. 3. Concepts of UML.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Chapter 5 System Modeling Sommerville, "software engineering ", 9 th Ed., 2011.
Unified Modeling Language. Object Oriented Methods ► What are object-oriented (OO) methods?  OO methods provide a set of techniques for analyzing, decomposing,
Enhanced Entity-Relationship (EER) Modeling. Slide 4- 2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
1 Unified Modeling Language, Version 2.0 Chapter 2.
© Shamkant B. Navathe CC Enhanced Entity-Relationship Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) Modern Database Management 11 th Edition Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson.
UML. Model An abstract representation of a system. Types of model 1.Use case model 2.Domain model 3.Analysis object model 4.Implementation model 5.Test.
UML (Unified Modeling Language)
UML AN OVERVIEW. Topics covered in this Session 1. Introducing UML. 2. What constitutes the UML. 3. Concepts of UML.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Unified Modeling Language (UML)
UML Diagrams: Class Diagrams The Static Analysis Model
Enhanced Entity-Relationship and Object Modeling Objectives
Business System Development
The Movement To Objects
Object-Oriented Analysis and Design
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

CONCEPTUAL DESIGN: UML CLASS DIAGRAM RELATIONSHIPS

What is UML? Is a language. It is not simply a notation for drawing diagrams, but a complete language for capturing knowledge(semantics) about a subject and expressing knowledge(syntax) regarding the subject for the purpose of communication. Applies to modeling and systems. Modeling involves a focus on understanding a subject (system) and capturing and being able to communicated in this knowledge. It is the result of unifying the information systems and technology industry’s best engineering practices (principals, techniques, methods and tools).

Unified Modeling Language (UML) used for both database and software modeling version 1.1 was adopted in November 1997 by the Object Management Group (OMG) as a standard language for object-oriented analysis and design Initially based on a combination of the Booch, OMT (Object Modeling Technique) and OOSE (Object-Oriented Software Engineering) methods, UML was refined and extended by a consortium of several companies, and is undergoing minor revisions by the OMG Revision Task Force. Ivar Jacobson is known as the father of Use Cases. Refernces http://www.inconcept.com/JCM/April1998/halpin.html

UML Diagrams UML includes diagrams for use cases static structures (class and object diagrams) behavior (state-chart, activity, sequence and collaboration diagrams) implementation (component and deployment diagrams). For data modeling purposes UML uses class diagrams, to which constraints in a textual language may be added

Identify the information system’s purpose A Simplified Object-Oriented Systems Analysis & Conceptual Design Methodology Activities Identify the information system’s purpose Identify the information system’s actors and features Identify Use Cases and create a Use Case Diagram Identify Objects and their Classes and create a Class Diagram Create Interaction/Scenario Diagrams Create Detail Logic for Operations Repeat activities 1-6 as required to refine the “blueprints”

Defining Class Class Objects A CLASS is a template (specification, blueprint) for a collection of objects that share a common set of attributes and operations. HealthClubMember Class Objects attributes operations

Relationships Generalization (Class-to-Class) (Superclass/Subclass) A RELATIONSHIP is what a class or an object knows about another class or object. Generalization (Class-to-Class) (Superclass/Subclass) Inheritance Ex: Person - FacultyPerson, StudentPerson, Staff... Ex: ModesOfTravel - Airplane, Train, Auto, Cycle, Boat... [Object] Associations FacultyInformation - CourseInformation StudentInformation - CourseInformation [Object] Aggregations & Composition (Whole-Part) Assembly - Parts Group - Members Container - Contents F o u r T y p e s

Relationships Exist to: 1) show relationships 2) enforce integrity 3) help produce results In this example: Removal of a University Course should also remove Students that are in the Course but not Student Information. Removal of a Student should also remove the Courses that the Student is in but not the University Course. Removal of a Student in a Course should not affect either University Course or Student Information. UniversityCourse StudentInformation 1 0,m 1 StudentInCourse 0,m

{ UML Class Diagram Notation 1 of 2 Class attributes operations Member memberNumber firstName lastName telephone address city etc... checkOutVideo checkInVideo buyItem attributes operations { Expanded view of a Class into its three sections: Top: Class Name Middle: attributes Bottom: operations

UML Class Diagram Notation 2 of 2 Class Generalization Relationship Object Aggregation Association 0..* 1..* Object Composition Association 0..* 1 Object Association n Will always be “1”

Class Diagram Relationships Generalization Object Association Aggregation Composition

Generalization (Class-to-Class) (superclass – subclass; supertype – subtype) A Generalization follows a “is a” or “is a kind of” heuristic from a specialization class to the generalization class. (e.g., student “is a” person, video “is a kind of” inventory). Common attributes, operations and relationships are located in the generalization class and are inherited by the specialization classes Unique attributes, operations and relationships are located in the specialization classes. Inherited attributes and operations may be overridden or enhanced in the specialization class depending on programming language support. Inherited operations in the specialization classes may be polymorphic. Only use when objects do NOT “transmute” (add, copy, delete) Multiple inheritance is allowed in the UML but can complicate the class model’s understanding and implementation (e.g., C++ supports but Java and Smalltalk do not).

Generalization Example Others: Transactions Things Places Etc... Role attributes operations Staff Faculty Student Visitor attributes attributes attributes attributes operations operations operations operations

Poor Generalization Example (violates the “is a” or “is a kind of” heuristic) Person attributes operations Head Arm Leg attributes attributes attributes operations operations operations

Generalization Inheritance One-Way Inheritance from the Generalization to the Specialization Common o1 o2 o3 Specialization a1 a2 a3 a4 a5 a6 Specialization a4 a5 a6 Unique o1 o2 o3 o4 o5 o6 o4 o5 o6 (a = attribute; o = operation)

Generalization - Multiple Inheritance Specialization a6 a7 a8 a1 a2 (which one?) a3 a4 a5 inherited attributes o6 o7 o8 o1 o2 o3 o4 o5 (which one?) inherited operations

UML Generalization Notation Note Supertype Useful text discriminator Subtype 1 Subtype 2 Note: Supertype = Superclass; Subtype = Subclass

Generalization - Multiple Classification Discriminator Doctor role Person Nurse patient Physical- therapist Patient

Rational Rose Class Diagram Example

Associations Relationships between instances (objects) of classes Conceptual: associations can have two roles (bi-directional): source --> target target --> source roles have multiplicity (e.g., cardinality, constraints) To restrict navigation to one direction only, an arrowhead is used to indicate the navigation direction No inheritance as in generalizations

Object Association Relationship Patterns b) Object Aggregation Associations Whole attributes operations Class A attributes operations x x x x x x x Part1 attributes operations Part2 attributes operations PartN attributes operations x Class B attributes operations c) Object Composition Associations (y may not be “1”) Whole attributes operations Class A attributes operations x Class B attributes operations 1 1 x 1 y y y a) Object Associations Part1 attributes operations Part2 attributes operations PartN attributes operations

Associations role B Class A Class B role A Example: Employee Company Person Employer

Multiplicities 1 Class exactly one 0..* many (zero or more) Class 0..1 optional (zero or one) Class m..n numerically specified Class Example: 0..* Course CourseOffering 1

Aggregation & Composition Aggregation (shared aggregation): is a specialized form of ASSOCIATION in which a whole is related to its part(s). is known as a “part of” or containment relationship and follows the “has a” heuristic three ways to think about aggregations: whole-parts container-contents group-members Composition (composite aggregation): is a stronger version of AGGREGATION the “part(s)” may belong to only ONE whole the part(s) are usually expected to “live” and “die” with the whole (“cascading delete”) Aggregation vs. Composition vs. Association???

Aggregation Composition Faculty SalesOrder 1..* 1 (team-teaching is possible) 0..* 1..* CourseTeaching SalesOrderLineItem (another: assembly --> part) (another: hand --> finger)

Composition Composition is often used in place of Generalization (inheritance) to avoid “transmuting” (adding, copying, and deleting of objects) Person {abstract} 1 Person FacultyRole 0..1 1 Faculty Student 0..1 StudentRole FacultyStudent Note: Attributes may need to be considered to more-fully understand

Video Store – UML Class Diagram 1 1 Inventory SaleItem RentalItem Video Game ConcessionItem VCR 0..* 0..* Transaction Employee StoreLocation 1 1 SaleTransaction RentalTransaction Suplier 0..* 1 1 0..* 1 1 0..1 0..* Member PurchaseOrder 1..* 1..* 1 1..* SaleRentalLineItem 0..* 0..* PurchaseOrderLineItem

Conclusion UML is effective for modeling large, complex software systems It is simple to learn for most developers, but provides advanced features for expert analysts, designers and architects It can specify systems in an implementation-independent manner Structural modeling specifies a skeleton that can be refined and extended with additional structure and behavior Use case modeling specifies the functional requirements of system in an object-oriented manner