Object-oriented modeling Class/Object Diagrams

Slides:



Advertisements
Similar presentations
UML an overview.
Advertisements

Alternative Approach to Systems Analysis Structured analysis
Karolina Muszyńska Based on:
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Department of Computing
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
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.
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
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.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
7M822 UML Class Diagrams advanced concepts 14 October 2010.
Unified Modeling Language
The Unified Modeling Language (UML) Class Diagrams.
Karolina Muszyńska Based on: G. Schneider, J.P. Winters „Stosowanie przypadków użycia” S. Wrycza, B.
Systems Analysis and Design in a Changing World, Tuesday, Feb 27
Systems Analysis and Design in a Changing World, Fifth Edition
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
1 Systems Analysis & Design Object Modeling IS 431: Lecture 6 CSUN Information Systems
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
R McFadyen Chapter 7 Conceptual Data Modeling.
Association Class Generalization/Specialization Whole-Part Page More Associations 1.
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.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
7-1 © Prentice Hall, 2004 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
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.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Introduction to Object Modeling
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.
Object-Oriented Data Modeling
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 Analysis and Design Class and Object Diagrams.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Class diagrams Terézia Mézešová.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Karolina Muszyńska Based on: S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) Modern Database Management 11 th Edition Jeffrey A. Hoffer, V. Ramesh, Heikki Topi © 2013 Pearson.
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.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
UML Diagrams: Class Diagrams The Static Analysis Model
Business System Development
DATA REQIREMENT ANALYSIS
Chapter 5: Structural Modeling
Object-Oriented Analysis and Design
Class diagram Description
Object Oriented Analysis and Design
Senior Project II Team 1 – Class Diagram
Object Oriented Analysis and Design Using the UML
UML Class Diagram.
SYS466 Domain Classes – Part 1.
Understand and Use Object Oriented Methods
Presentation transcript:

Object-oriented modeling Class/Object Diagrams Karolina Muszyńska Based on: http://www.csun.edu/~dn58412/IS431/IS431_SP13.html S. Wrycza, B. Marcinkowski, K. Wyrzykowski „Język UML 2.0 w modelowaniu SI”

Object Modeling – class/object diagrams Static view - class/object diagrams role basic concepts advanced concepts examples No additional notes

Class/object diagrams - role Class diagrams – kind of UML diagrams showing the static view of the system, constituting the basis for the future object-oriented database. Class diagrams depict the system’s object structure and show object classes that the system is composed of as well as the relationships between classes. Object diagrams - they are similar to class diagrams but instead of depicting object classes they model actual object instances, showing the structure of the systems in a given moment of time. No additional notes

Class diagrams - types Conceptual diagram – class diagram including basic elements, using class, attributes and behavior names, which are clear and understandable for the user. Implementation diagram – class diagram enriched by additional elements like data types, visibility, association classes, generalization relationships, or realizations. No additional notes

Class/object diagrams – basic concepts Object – anything that is or is capable of being seen, touched, or otherwise sensed, and about which users store data and associate behavior (which is important in the considered domain) Attributes - data that represents characteristics of interest about an object (everything what is known about an object is represented by the attributes) Behavior/Methods - refers to things that the object can do and that correspond to functions that act on the object’s data (or its attributes) Class - a set of objects sharing a common structure – attributes and behavior, and common relationships and meaning.

Class/object diagrams – basic concepts Class name Attributes with data types Methods with output data types

Class/object diagrams – basic concepts Object name Values of the attributes

Class/object diagrams – basic concepts An object/class relationship is an association that exists between one or more objects/classes. It is defined by business rules and/or common practices. There are four types of relationships among classes: association, generalization, dependency and realization. Association - main type of relationship describing the possible set of associations among objects of the associated classes. Navigation is the defined direction of communication between classes; if not defined the default navigation is bi- directional. Multiplicity defines how many instances of one class can be associated with one instance of another class.

UML Multiplicity Notations Association Multiplicity Association with Multiplicity Notation Meaning An employee works for one and only one department. Department Employee 1 Works for Exactly 1 1 Employee Department An employee has either one or no spouse. 0..1 Has Spouse Employee Zero or one 0..1 0..* Makes Payment Customer 0..* or * A customer can make no payment up to many payments. Zero or more Payment Customer Makes * A university offers at least 1 course up to many courses. Course University Offers 1..* One or more 1..* A team has either 7, 8, or 9 games scheduled Specific range Game Team 7..9 scheduled 7..9 Has

Class/object diagrams – basic concepts Association name Association 0..* Customer Order places 1 contractor contract Multiplicity Multiplicity Roles Roles

Class/object diagrams – basic concepts Aggregation – a special kind of relationship, which shows that some objects/classes are made up of other objects/classes. By identifying aggregation relationships we can partition a very complex object and assign behaviors and attributes to the individual objects within it. There are two types of aggregation relationships: composition - all part-objects make up and live in the whole-object, shared aggregation /aggregation/ - implies that parts may be shared by many wholes.

Aggregation Relationship Operation Team Doctor Nurse Admin staff “is a part of” relationships (part-objects may be shared by many whole-objects)

Composition Relationship Order Order item Book Page “is made of” relationships (all part-objects make up and live in the whole-object)

Class/object diagrams – advanced concepts Visibility – access modifier which determines the access level of the attributes or methods of the object class. Visibility defines whether attributes and methods of specific classes can be seen and used by other classes. UML specifies 4 main visibility levels: „-” private – only objects within the same class can see and use the attributes or methods, „#” protected – only objects within the same class and from descendent classes can see and use the attributes or methods, „+” public – objects of any class can see and use the attributes or methods, „~” package - only classes within the same package can see and use the attributes or methods. There is a rule that class attributes should be set private and the external access to them is made possible by public methods.

Class/object diagrams – advanced concepts Multiple association – a situation when associated classes can play different roles to each other and so there are multiple associations between them. Each association should be named or characterized. Participant Auction is seller is buyer

Class/object diagrams – advanced concepts Reflexive association – a situation when there is an association between different objects of the same class (an association binding the class with itself). 1 Automobile platform 1..10 passenger car transports

Class/object diagrams – advanced concepts Generalization relationship - indicates that one of the two related classes - the subclass (child) is considered to be a specialized form of the other - the superclass (parent) and superclass is considered as ‘generalization' of subclass. In other words the child class is a specific type of the parent class and assumes all the characteristics of its parent class. The generalization relationship is also known as the inheritance relationship. The parent class can be either a real class or an abstract class. The abstract class has no real object instances, it is only a generalization of real objects which are specified as child classes.

Generalization Relationship Employee Doctor Nurse Admin staff “is a kind of” relationships

Class/object diagrams – advanced concepts Realization relationship - denotes the implementation of the functionality defined in one class by another class (interface). Relationship in which one model element (the client) realizes (implements or executes) the behavior that the other model element (the supplier) specifies. A realization relationship between classes and interfaces shows that the class realizes the operations offered by the interface. Realizations can only be shown on class or component diagrams.

Class/object diagrams – advanced concepts Interface Realization relationship

Building a Class Diagram Find the potential objects (the best way is to review each use case to find nouns that correspond to business entities or events). Select the proposed objects (clean the list of all potential business objects from: synonyms, nouns outside the scope of system, nouns that are roles without unique behavior or are external roles, unclear nouns that need focus and nouns that are really actions or attributes). Identify attributes and operations of the classes. Identify associations and multiplicity (to help insure that all possible relationships are identified we can create a class matrix). Identify generalization relationships (we should look for all one-to-one multiplicity relationships between objects because they may be generalization relationships, as well as for classes that have common attributes and behaviors). Identify aggregation relationships (we must remember that aggregation relationships do not imply inheritance but they propagate behavior). The first step should be to identify related classes and build class diagrams for each particular use case and next build an integrated class diagram for the whole system.

Class diagram – example