CS 2511 Fall2014 2014. UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○

Slides:



Advertisements
Similar presentations
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.
Advertisements

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 and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Lecture 12: Chapter 22 Topics: UML (Contd.) –Relationship Structural Behavioral –Diagram Structural Behavioral.
Inheritance COMP53 Sept Inheritance Inheritance allows us to define new classes by extending existing classes. A child class inherits all members.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
CS 2511 Fall UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○ Sequence.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
Unified Modeling Language
Unified Modeling Language
The Unified Modeling Language (UML) Class Diagrams.
UML Diagrams Computer Science I.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Using Jeroo To Teach Object-Oriented Concepts By Christian Digout.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
ITEC 370 Lecture 10 Design. Review Design –Why is it part of the process? –Who is the audience for design?
1 Chapter 2 (Cont.) The BA’s Perspective on Object Orientation.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Inheritance Building one object from another. Background Object-oriented programming is normally described has offering three capabilities Encapsulation:
Programming Logic and Design Fourth Edition, Comprehensive Chapter 15 System Modeling with the UML.
Unit 1 INTRODUCTION TO MODELING AND CLASS MODEL Ref : L7-UML.PDF.
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 Diagrams 1 These lecture slides are copyright (C) Marty Stepp, They may not be rehosted, sold, or modified without expressed permission.
Design Jon Walker. More UML ● What is UML again?
Peyman Dodangeh Sharif University of Technology Fall 2014.
Design Model Lecture p6 T120B pavasario sem.
More on Inheritance Chapter 11 Continued. Reminders Overloading – different signatures Overriding – same signatures Preventing overriding – use final.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
CSE 403, Spring 2008, Alverson Using UML to express Software Architecture.
CSE 403, Spring 2007, Alverson Using UML to express Software Architecture.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Lab 5 CPIT 250 System Analysis and Design.
CSE 219 Computer Science III UML. UML Diagrams UML - Unified Modeling Language UML diagrams are used to design object-oriented software systems –represent.
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.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Object-Oriented Design.
UML Part 1: Class Diagrams. Introduction UML stands for Unified Modeling Language. It represents a unification of the concepts and notations presented.
Class diagrams Terézia Mézešová.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
 Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and.
Chapter 3: Introducing the UML
CLASS DIAGRAMS A classy approach to objects. The Basic Class Diagram  Class Name  Attributes (- indicates private each would have properties or accessor/mutator.
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.
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.
Introduction to UML and Rational Rose UML - Unified Modeling Language Rational Rose 98 - a GUI tool to systematically develop software through the following.
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
UML Review – class diagrams SE-2030 Dr. Mark L. Hornick 1.
Advanced Programming in Java
Class Inheritance Part I
CHAPTER
Unified Modeling Language (UML)
Structural Modeling.
Unified Modeling Language
UML Diagrams: The Static Model Class Diagrams
Object Oriented Analysis and Design
The Basics of Class Diagrams for a single class
ניתוח מערכות מידע א' הרצאה 3
UML Class Diagram.
Advanced Programming Behnam Hatami Fall 2017.
Software Engineering System Modeling Extra examples Dr.Doaa Sami
IMPORTANT NOTICE TO STUDENTS:
CS 200 More Classes Jim Williams, PhD.
CS 501: Software Engineering
Computer Science II for Majors
Presentation transcript:

CS 2511 Fall

UML Diagram Types  2 Main Types Structure Diagrams ○ Class Diagrams ○ Component Diagrams ○ Object Diagrams Behavior Diagrams ○ Sequence Diagrams ○ Use Case Diagrams

Class Diagrams  Type of static structure diagram  Describes: The structure of a system by showing the system’s classes The class attributes The relationships between classes

Class Node Layout Class Name Attributes of Class (Data Members) Operations of Class (Member Functions)

Example Class Diagram Revisited public class Circle { private double radius; private double area; protected double getArea(); public void setCenter(Point); public Point center; } Circle radius : double area : double center : Point getArea() : double setCenter(Point)

Visibility Specifiers  To specify the visibility of a class member (both attributes and methods) use the following before the member's name: public: + protected: # private: - package: ~

Example Class Diagram Revisited public class Circle { private double radius; private double area; protected double getArea(); public void setCenter(Point); public Point center; } Circle - radius: double - area: double + center: Point # getArea() : double + setCenter(Point)

Class Relationships  A relationship is a general term covering the specific types of logical connections found on class and object diagrams.  We’ll look at the following: Dependency Aggregation Inheritance

Dependency  A very weak relationship  A class depends on another class if it manipulates objects of the other class

UML Dependency Shape - var1 : Point + draw(Circle c) Circle - radius: double - area: double + center: Point # getArea() : double + setCenter(Point)

Dependency in Code public class Shape { public void draw(Circle c); private Point var1; // Some other variables and methods … } public class Circle { private double radius; private double area; protected double getArea(); public void setCenter(Point); public Point center; } Notice that draw(Circle c) is the only reference to class Circle in Shape, so a weak relationship

Aggregation  A class aggregates another if its objects contain objects of the other class.  The aggregate class (the class with the white diamond touching it) is in some way the “whole,” and the other class in the relationship is somehow “part” of that whole. Mailbox - messages : ArrayList Message *

Aggregation in Code public class Mailbox { private ArrayList messages; // Other Variables and Methods Go Here } public class Message { // Variables and Methods Go Here } Note that this is a 1 to many relationship since for every Mailbox there are 0 or more messages stored

Inheritance  A class inherits from another if it incorporates the behavior of the other class  Special Cases of objects of the parent class type  (Possibly) capable of exhibiting additional responsibilities

UML Inheritance Child + method2() Parent + method1() Note only methods new to Child are listed in Child class (not methods inherited from Parent)

Inheritance in Code public class Parent { public void method1(); } public class Child extends Parent { public void method2(); }