School of Computer Science and Engineering

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

Object-oriented modeling Class/Object Diagrams
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.
Unified Modeling Language Philip Liew
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
ITEC200 – Week03 Inheritance and Class Hierarchies.
UML – Class Diagrams.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
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.
UML Class Diagram and Packages
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
7M822 UML Class Diagrams advanced concepts 15 September 2008.
7M822 UML Class Diagrams advanced concepts 14 October 2010.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
ECE 355: Software Engineering
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
HISTORY RULES & REGULATIONS
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Classes and Class Diagrams. Learning Outcomes Students will be able to : Describe a class Identify components of a class diagram Explain the terms: –Multiplicity.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
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.
7-1 © Prentice Hall, 2004 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
7-1 © Prentice Hall, 2007 Week 5: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
Unit 1 INTRODUCTION TO MODELING AND CLASS MODEL Ref : L7-UML.PDF.
® 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 Diagrams: The Static Model Class Diagrams. The Static Model Define the static structure of the logical model Represent classes, class hierarchies.
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.
An Introduction to the Unified Modeling Language
Information Systems Engineering
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
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.
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,
Class Diagram Classes are the most important building block of any object-oriented system. A class is a description of a set of objects that share the.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Design Model Lecture p6 T120B pavasario sem.
Relationships Relationships between objects and between classes.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
Lecture 8-2 : Class Diagrams. Class Representation Class Name Attribute1 Attribute2 … Operation1 Operation2 … responsibility.
UML Class Diagram. A class diagram shows 1.Classes 2.The relationships between them.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Class diagrams Terézia Mézešová.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
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.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
Made by : Calliope – Christine Despotidou MAY 2015.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
CHAPTER
UML Diagrams: Class Diagrams The Static Analysis Model
COMPONENT & DEPLOYMENT DIAGRAMS
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
UML Diagrams: The Static Model Class Diagrams
Object Oriented Analysis and Design
Seminar 3 UML Class Diagram.
Software Engineering Lecture #11.
Chapter 4 Advanced Class Modeling
UML Class Diagram.
Unified Modelling Language
Class Diagram.
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Presentation transcript:

School of Computer Science and Engineering Class Diagrams Bong-Soo Sohn Assistant Professor School of Computer Science and Engineering Chung-Ang University

CLASS in UML Class Name Attribute1 Attribute2 … Operation1 Operation2 responsibility

CLASS in UML Class name WashingMachine First letter is upper-case No empty space in a class name. with package name? package_name::class_name Ex) HouseholdAppliances::WashingMashine WashingMachine

myWasher:WashingMachine CLASS in UML Attribute Attribute Names Additional information (attribute vale) can be specified. Ex) capacity:Integer = 8 WashingMachine brandName modeName serialNumber capacity Instance of WashingMachine myWasher:WashingMachine brandName = “TROMM” modeName = “WD-R121XH” serialNumber = “LG57774” capacity = 12

CLASS in UML Operation WashingMachine brandName class methods modeName addClothes() removeClothes() addDetergent() turnOn() brandName modeName serialNumber capacity WashingMachine class methods first letter is lower-case Additional information (e.g. signature) can be specified. Ex) addClothes( C:String )

Additional information (signature) in operations WashingMachine brandName modelName serialNumber capacity addClothes( C:String ) removeClothes( C:String ) addDetergent( D:Integer) turnOn( ):Boolean - Parameter name and type - Return type

Stereotype WashingMachine WashingMachine WashingMachine brandName . . . addClothes() WashingMachine <<id info>> brandName modelName serialNumber <<machine info>> capacity <<clothes-related>> addClothes() removeClothes() addDetergent() <<machine-related>> turnOn() If the lists of class attributes and operations are long, stereotype can be used to separate the list for better understanding. stereotype one or extensibility machanisms in UML allow designers to extend the vocabulary of UML in order to create new model elements Notation :<<stereotype_name>>

Responsibility and Constraints Use when inserting constraints a class has to follow. Notation : text in ‘{ }’ WashingMachine <<id info>> brandName modelName serialNumber <<machine info>> capacity <<clothes-related>> addClothes() removeClothes() addDetergent() <<machine-related>> turnOn() Responsibility : Take dirty clothes as input and produce clean clothes as output {capacity =5 or 8 or 10 Kg} Explain what class has to do

Note WashingMachine brandName modelName serialNumber capacity <<id info>> brandName modelName serialNumber <<machine info>> capacity <<clothes-related>> addClothes() removeClothes() addDetergent() <<machine-related>> turnOn() Responsibility : Take dirty clothes as input and produce clean clothes as output Refer to Government Standard EV5-2241 on generating serial numbers {capacity =5 or 8 or 10 Kg} Note Use when inserting additional information.

Class Modeling Class name attribute1 attribute2 … operation1 Nouns during conversation with clients Class name attribute1 attribute2 … operation1 operation2 responsibility Nouns during conversation with clients , which are related to class name. Verbs during conversation with clients의뢰

Example : modeling basketball game

Example : modeling basketball game

Basketball Game Conversation with coach noun ball, basket, team, players, guards, forwards, cener, shot, shot clock, three-point line, free throw, foul, free-throw line, court, game clock verb Shoot, advance, dribble, pass, foul, rebound Initial Class Diagram

Initial class diagram Ball diameter volume dribble() shoot() pass() advance() Player name height weight dribbleBall() passBall() shootBall() rebound() foulOpponent() Forward does most of the intermediate range shooting and rebounding Guard does most of the dribbling and passing Team Basket ShotClock {pro = 24 sec college = 35sec Int’l = 30 sec} center stays near basket, shoots from close range Foul Shot Court GameClock {pro = 4 12-minute quarters college and Int’l=2 20-minute halves} ThreePointLine FreeThrow Duration {pro = 48minutes college and Int’l = 40 minutes FreeThrowLine

Association When classes are connected together conceptually, that connection is called association

Association

Constraints on Association

Association Classes Association can have attributes and operations, just like a class.

Link An association may have instances, just as an object is an instance of a class

Multiplicity The number of objects from one class that relate with a single object in an associated class. One – to – one One – to – many(*) One – to – one or more(*) 1..* One – to – zero or one One – to – a bounded interval ex. one – to – 5 through(..) 10 One – to exactly n ex. One – to – 10 One – to – a set of choices ex. One – to – 5 or(,) 10

Multiplicity Possible multiplicities and how to represent them in UML

Reflexive Association Association with itself

Inheritance and Generalization Is a kind of inheritance, Generalization subclass , superclass root class, leaf class

abstract class Class that does not have an instance italic font

Dependencies one class may use another. The most common usage of dependency is to show that the signature of one class’s operation uses another class

More about class diagrams 집합연관(Aggregation) 복합연관(Composition) 문맥(Contexts) 인터페이스(Interface) 실체화(Realization) 가시성(Visibility)

Aggregations A class consists of a number of component classes

Constraints on Aggregations Constraint to show that one component or another is part of whole

Composite A strong type of aggregation Each component in a composite can belong to just one whole

composite structure diagram Show class’s internal structure Show components of a class

Interface and Realization One entity (interface) defines a set of functionalities as a contract, and the other (class) realizes the contract by implementing the functionality defined in the contract.

Visibility + : public # : protected - : private