بسم الله الرحمن الرحيم ” اللهم أنت ربي لا إله إلا أنت خلقتني و أنا عبدك وأنا على عهدك ووعدك ما استطعت ، أعوذ بك من شر ما صنعت ، أبوء لك بنعمتك على و أبوء.

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

CRC Modeling. Recap Class Modeling – How to Identify classes, its attributes and functions? – Class selection criteria – Relationships Associations Generalization.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
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.
UML – Class Diagrams.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
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.
Chapter 14 (Web): Object-Oriented Data Modeling
UML Class Diagram and Packages
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 
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
Chapter 14: Object-Oriented Data Modeling
Chapter 14: Object-Oriented Data Modeling
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.
OBJECT ORIENTED PROGRAMMING LECTURE 12 Instructor: Rashi Garg Coordinator: Gaurav Saxena.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
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.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
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,
Class-based Modeling.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 24. Review ANALYSIS Level Class Diagram – Identifying Entities – Identifying Attributes – Identifying Operations.
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.
Inheritance Chapter 10 Programs built from objects/instances of classes An O.O. approach – build on earlier work. Use classes in library and ones you have.
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,
Chapter 5 System Modeling Sommerville, "software engineering ", 9 th Ed., 2011.
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.
Class Modeling Design Class diagram. Classes The term “class ” refers to a group of objects that share a common attributes and common behaviour (operations).
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
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.
ITEC0724 Modern Related Technology on Mobile Devices Lecture Notes #2 1.
UML Class Diagrams Sequence Diagrams CSE230 Dae-Kyoo Kim.
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.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
SUBCLASSES - JAVA. The Purpose of Subclasses Class Farm String getOwner() void setOwner(String s) int getSize() void setSize(int s) Class DairyFarm String.
Unified Modeling Language (UML)
Object-Oriented Modeling
COMP 2710 Software Construction Class Diagrams
Interface, Subclass, and Abstract Class Review
Class diagram Description
Class Diagrams.
Inheritance B.Ramamurthy 11/7/2018 B.Ramamurthy.
Object Oriented Analysis and Design
Lec 3: Object-Oriented Data Modeling
2018, Fall Pusan National University Ki-Joune Li
UML Class Diagram.
Unified Modelling Language
Software Engineering System Modeling Extra examples Dr.Doaa Sami
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Object Oriented System Design Class Diagrams
Information System Design
2019, Fall Pusan National University Ki-Joune Li
Presentation transcript:

بسم الله الرحمن الرحيم ” اللهم أنت ربي لا إله إلا أنت خلقتني و أنا عبدك وأنا على عهدك ووعدك ما استطعت ، أعوذ بك من شر ما صنعت ، أبوء لك بنعمتك على و أبوء لك بذنبي فاغفر لي فإنه لا يغفر الذنوب إلا أنت ”.

Class Diagrams

What is a Class Diagrams?  Class diagrams are the backbone of almost every object oriented method, including UML. They describe the static structure of a system.  A class diagram describes the types of objects in the system and the various kinds of static relationships that exist among them.

Class Diagrams A class diagram shows:  Classes Attributes Methods  Interfaces  Collaborations  Relationships: Dependency, Generalization, Association A class diagram is a STATIC view of system

Classes  A class is the description of a set of objects having similar attributes, operations (behavior), and relationships.

Basic Class Diagrams Window size: Size visibility: boolean display() hide() Class Name Attributes Operations

Basic Class Diagrams +public #protected -private / derived $ static Visibility Attribute Name [Multiplicity]:Type = Initial Value Visibility Method Name (Parameter List) : Return-List Class Scope Variable

Basic Class Diagram (Example) Person + name : String - ssn : String # birthday : Date / age : int +getName : String -calculateAge : int

Associations  A semantic relationship between two or more classes that specifies connections among their instances.  A structural relationship specifying that objects of one class are connected to objects of a second (possibly the same) class.  Example: “ An Employee works for a Company ”.

Associations (cont.)  An association between two classes indicates that objects at one end of an association “ recognize ” objects at the other end and may send messages to them. Borrower Book 31 currBorrbk[]

Association (Java implementation) public class Borrower { Book bk[]; int numBooks; … public Borrower() { numBooks = 0; bk = new Book[3]; } // methods that update bk public void borrowBook( Book b ) { bk[numBooks] = b; numBooks++; b.setBorrower( this ); } public class Book { Borrower currBorr; public void setBorrower( Borrower bw ) { currBorr = bw; }

Aggregation  A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts. Models a “ is a part-part of ” relationship. Whole Part Car Wheel 4 wheels

Aggregation (Java implementation) public class Car { private Wheel wheels[];... // wheel objects are created externally and // passed to the constructor public Car( Wheel w1, Wheel w2, … ) { // we can check w1, w2, etc. for null // to make sure wheels exist wheels = new Wheel[4]; wheels[0] = w1; wheels[1] = w2; … }

Composition  A strong form of aggregation: The whole is the sole owner of its part:  The part object may belong to only one whole Multiplicity on the whole side must be one The life time of the part is dependent upon the whole  The composite must manage the creation and destruction of its parts LinePoint 3..* 2 Polygon

Composition (Java implementations) public class Car { private Wheel wheels[];... public Car() { wheels = new Wheel[4]; // Wheels are created in Car … wheels[0] = new Wheel(); wheels[1] = new Wheel(); … }... }

Generalization  Indicates that objects of the specialized class (subclass) are substitutable for objects of the generalized class (super-class) “ is kind of ” relationship Shape Circle Super Class Sub Class An abstract class Generalization relationship

Generalization  A sub-class inherits from its super- class: Attributes. Operations. Relationships.  A sub-class may: Add attributes and operations. Add relationships. Refine (override) inherited operations.

Generalization (Java implementation)  public abstract class Shape { public abstract void draw();... }  public class Circle extends Shape { public void draw() {... }... }

Dependency  A dependency indicates a semantic relation between two or more classes in which a change in one may force changes in the other although there is no explicit association between them  A stereotype may be used to denote the type of the dependency Parser getTransaction() uses Bank processTransactions ()

Dependency (Java implementation) public class Bank { … public void processTransactions() { // Parser p is a local variable … Parser p = new Parser( … ); … p.getTransaction(); … } … }

Realization  A realization relationship indicates that one class implements a behavior specified by another class (an interface or protocol).  An interface can be realized by many classes.  A class may realize many interfaces. LinkedList > List LinkedList List

Realization (Java implementation)  public interface List { boolean add(Object o);... }  public class LinkedList implements List { public boolean add(Object o) {... }... }

Basic Class Diagrams Superclass Subclass Inheritance (Generalization) (is-a, kind-of) Class with parts Assembly Class Aggregation (Part-Of) Association (relationship) Class with parts Assembly Class Dependency Class A Class B name Interface Concrete Class Realization

 Multiplicity The number of instances of the class, next to which the multiplicity expression appears, that are referenced by a single instance of the class that is at the other end of the association path. Indicates whether or not an association is mandatory. Provides a lower and upper bound on the number of instances.

Multiplicity Indicators Exactly one1 Zero or more (unlimited)* (0..*) One or more1..* Zero or one (optional association) 0..1 Specified range2..4

Computer: Computer PrintServer: PrintServer Printer: Printer print(file) User: User print (filename) Queue: Queue [printer free] print(file) [printer busy] store(file)

Computer print(filename) PrintServer status(): integer print(file) Printer print(file) Queue store(file) uses Managed by