UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University 17-11-2003.

Slides:



Advertisements
Similar presentations
UML an overview.
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.
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
Unified Modeling Language
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
UML – Class Diagrams.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
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.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Unified Modeling Language (UML)
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Objectives Explain the purpose and objectives of object- oriented design Develop design class diagrams Develop interaction diagrams based on the principles.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Chapter 14: Object-Oriented Data Modeling
Unified Modeling Language
The Unified Modeling Language (UML) Class Diagrams.
Object-Oriented Analysis and Design
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
Object-Oriented Systems Analysis and Design Using UML
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.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
Object Oriented Analysis & Design & UML (Unified Modeling Language)1 Part V: Design The Design Workflow Design Classes Refining Analysis Relationships.
Presented by: CHAN LAI SAN ( ) REBAH DAW SARREB ( ) FIDA AL-OBAISI ( ) 08 April 2008 (Tuesday 6pm – 7:30pm)
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
1 UML Basic Training. UML Basic training2 Agenda  Definitions: requirements, design  Basics of Unified Modeling Language 1.4  SysML.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Chapter 16 Applying UML and Patterns Craig Larman
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.
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.
Design Jon Walker. More UML ● What is UML again?
2007ACS-3913 Ron McFadyen1 Class Diagram See Schaum’s UML Outline, especially chapters 4, 5, 6, 7.
Object-Oriented Data Modeling
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Design Model Lecture p6 T120B pavasario sem.
Object Oriented Analysis and Design Class and Object Diagrams.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
INFSY 535.  Small systems  Larger systems 1.Understand the program requirement- what 3. Write and test each part (unit testing) 4. Maintenance 2. Specify.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Chapter 3: Introducing the UML
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.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
11 Systems Analysis and Design in a Changing World, Fifth Edition.
Class Diagram Associations Class Diagrams, Class Stereotypes, Class Associations Dr. Neal CIS 480.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2006 Classes and Objects Patrick Bailey Keith Vander Linden Calvin College.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
UML Diagrams: Class Diagrams The Static Analysis Model
UML Class Diagrams.
Object-Oriented Analysis and Design
UML Class & Object Diagram II
Object Oriented Analysis and Design
Systems Analysis and Design With UML 2
Unified Modelling Language
Object Oriented System Design Class Diagrams
Presentation transcript:

UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University

UML Modeling A model is an abstraction of a situation Models consist of objects Objects are alive: –They know their attributes –They can do things using their methods –They exist in different states –Each object is unique, it is not any other object. Objects live in communities –they exchange messages –They have relationships with each other Objects live in a world, and there are other worlds Classes are blueprints of objects Object are instances of classes

UML Diagrams Use Case diagrams Class diagrams Object diagrams Sequence diagrams Collaboration diagrams State chart diagrams Activity diagrams Component diagrams Deployment diagrams

Class Diagrams Classes are representations of objects. Class diagrams represent Objects and their relations with each other. Class diagrams are static, they display WHO operates, not WHAT happens

Class Diagram Notations Class Name Attributes Properties Operations Methods Private Static Public Parameters Return Values

Information/Property Notations > opt visibility opt name multiplicity opt : type opt = initial-value opt {property-string} opt Example: Tagged value e.g. Author = Kari E.g. > - (private) only the class can see this attribute # (protected) only the class and all of its subclasses + (public) all classes that can see the class can also see the attribute Example: [1..*] :String Indicating one or more addresses. If no is present you will still have a the empty string (””). If [0..*] : String is specified, the can be null.

Operation/Method Notations > opt visibility opt name(parameter-list) multiplicity opt : return-type opt {property-string} opt Without polymorphism, a method is the same as an operation With polymorphism, an operation is represented by two or more methods

Class relationships Generalization Base sub Class2Class1Class2Class1 Association Dependency

Generalization superclass subclass generalization arrow Also called generalization/specialization Generalization is converted into inheritance when generating application code. Payment Cash General Special

Association Represents links between classes. –Customer makes a payment. –Customer makes an order. UML allows non-directional associations at the analysis phase Class2Class1

Association Associations have a navigational direction –A Customer’s Payment –Payment of a customer Navigational direction is a design issue, not an analysis issue. If no navigation is given, this may indicate a bidirectional navigation or that it is not specified. PaymentCustomer Payment

Association We have –ordinary association –simple aggregation: very similar to ordinary association, only means one class is more Important than the other. Aggregation is modeled by an empty diamond at the important part For the programmers, Aggregation is “Call by reference” –composition (strong aggregation)

Association We have –ordinary association –simple aggregation: –composition (strong aggregation) Composition is a Whole-Part relationship Composition is modeled by a black diamond at the Whole. Order can not exist outside the Customer For the programmers, Composition is “Call by value”

Association Associations have Multiplicity –0 –0.. 1 –0.. n –1 –1.. n –n

Association Associations have Roles –Roles explain the meaning of the association –Roles are “names” for the participation of each class in the association. –The programmer converts the roles to the appropriate property names. –Roles have visibility

Association Associations can be qualified –The association may have some internal parameters. –The designer should fully explain how the qualified association should be implemented.

Association Classes Associations can have properties and methods. An Association Class is a class that represents the association. InstitutePerson works for Job description salary

Reflexive Association

Designing with Associations UML designer should explain with maximum detail all the elements of an association Class A Class B Name and Visibility Of Role B Association Association Name Name of Role A Multiplicity of Role A Multiplicity of Role B

Dependency Dependency means “One class uses the other” Could be used to show that one method of a class uses some objects of the other class. Programmers use Dependency to include the definition of a class in the other. Basic Class Dependent Class Depends on

Abstract Classes Italic Means abstract Generalization means inheritance

Interfaces Interfaces are pure virtual classes Interfaces contain only declarations Interfaces can be realized by classes Interface inheritance is a good programming methodology. Realization

Parameterized classes Some classes may not be very clear by their own, but rather depend on an external parameter. Parameterized classes must be instantiated before you can create objects of them. You can understand parameterized classes as “class templates”

Designing effective class diagrams Organize similar classes into packages Beware of cyclical generalization Generalization and realization is unique between 2 classes Use associations where there are structural relationships Associations are NOT communication pipes. Start with Analysis, then refine details to the maximum level. Explain everything to the programmer using UML notations.

Common Class diagram pitfalls Cyclic generalization Redundant generalization Redundant realization UML/OOP features not supported in the implementation language –Multiple inheritance not supported by Java. Duplicate navigable roles for a class in many associations

Class diagrams in Rational Rose The class diagram toolbar Class Interface Association Association Class Package Dependency Generalization Realization

Class diagrams in Rational Rose Classes in Rational Rose

Class diagrams in Rational Rose Classes in Rational Rose

Class diagrams in Rational Rose Classes in Rational Rose

Class diagrams in Rational Rose Associations in Rational Rose

Quiz I Every student will be advised by one teacher. Some teachers advise many students, and some advise none. Which of the following class diagrams most clearly represents that student-teacher relationship?

Quiz 2 An application has many windows, each window has an icon, icons are stored in the application, and are shared between windows. An application has many windows, each window has a unique icon, icons are stored in the application, not in the windows. An application has many windows, each window has an icon, icons are stored in the windows, and referenced by the application. An application has many windows, each window is identified by its own unique icon. The application includes the windows and their icons.

Workshop Analyze the following business case using UML and Rational Rose, and design a class diagram for an OOP computer system that serves it. –A Customer makes an Order, and a Payment for it. –A Payment is one of three kinds: Cash, Check, or Credit. –The order contains Items, each item is bought in a specific quantity and at a specific price. –The Order can be in a STATE like: “pending” for new orders “approved” for received and accepted orders “rejected” for received and rejected orders “shipped” for approved orders that are shipped to the customer “closed” for orders received by the customer Duration 90 minutes