Design Model Lecture p6 T120B029 2004 pavasario sem.

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
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
Unified Modeling Language
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.
Object-Oriented Analysis and Design
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Introduction To System Analysis and Design
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.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Class Diagram & Object Diagram
© Copyright Eliyahu Brutman Programming Techniques Course.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Sharif University of Technology1 Design and Use-case Realization Software Engineering Laboratory Fall 2006.
7M822 UML Class Diagrams advanced concepts 14 October 2010.
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.
Introduction To System Analysis and design
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
Introduction To System Analysis and Design
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.
4. UML. CPSC 333: Foundations of Software EngineeringJ. Denzinger 4.1. Motivation The Unified Modeling Language tries to integrate older approaches Developed.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
Chapter 16 Applying UML and Patterns Craig Larman
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 03. Classes,
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
Class diagram Used for describing structure and behaviour in the use cases Provide a conceptual model of the system in terms of entities and their relationships.
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.
NJIT UML Class Diagrams Chapter 16 Applying UML and Patterns Craig Larman.
Lecture 6: Structural Modeling
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.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
Software Engineering Lecture 8 Object-Oriented Analysis.
1 Introduction to Classes. 2 Terms and Concepts A class is... –The most important building block of any object- oriented system. –A description of a set.
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.
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.
Introduction to UML Hazleen Aris Software Eng. Dept., College of IT, UNITEN. …Unified Modeling Language.
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.
WELCOME TO OUR PRESENTATION UNIFIED MODELING LANGUAGE (UML)
11 Systems Analysis and Design in a Changing World, Fifth Edition.
CHAPTER
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Introduction to Unified Modeling Language (UML)
Introduction to UML Introduction to UML Shiyuan Jin September,23,2002
Object Oriented Analysis and Design
UML Class Diagram.
SYS466 Domain Classes – Part 1.
Understand and Use Object Oriented Methods
Copyright 2007 Oxford Consulting, Ltd
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Presentation transcript:

Design Model Lecture p6 T120B pavasario sem.

2 Main processes of the team assignment requirements analysis design process codingtesting Used technique: UML use case diagrams UML activity diagrams Used technique: UML component diagrams, UML class diagrams, UML state diagrams UML sequence diagrams, UML activity diagrams Used languages: Java C++ … requirements document problem description design document T120B029

3 The Design Model T120B029 The analysis model represents the system in terms of objects that domain experts know. The design model represents the same system, but at a level of abstraction closer to the source code. For example, the classes in the design model have a language and model properties assigned, which define the mapping to code.

4 Structural Diagrams Used to visualize, specify, construct, document static aspects of system class diagram package diagram [not standard UML] object diagram component diagram deployment diagram T120B029

5 Common Uses of Class Diagrams to model vocabulary of the system, in terms of which abstractions are part of the system and which fall outside its boundaries to model simple collaborations (societies of elements that work together to provide cooperative behavior) to model logical database schema (blueprint for conceptual design of database) T120B029

6 Class diagram Central for OO modeling Shows static structure of the system –Types (!) of objects –Static relationships Association (e.g.: a company has many employees) Generalization (subtypes) (e.g.: an employee is a kind of person) Dependencies (e.g.: a company is using trucks to ship products) T120B029

7 Three Perspectives We can look at classes from these perspectives: Conceptual (OOAnalysis) –Shows concepts of the domain –Should be independent from implementation Specification (OODesign) –General structure of the running system –Interfaces of software (types, not classes) –Often: Best perspective Implementation (OOProgramming) –Structure of the implementation (classes) –Most often used Try to draw from a clear, single perspective T120B029

8 What are classes? –A class describes a set of objects with an equivalent role or roles in a system –Sources for objects: tangible real- world things, roles, events, interactions T120B029

9 Class A class is a description of a set of objects that share the same attributes, operations, relationships, and semantics. An attribute is a named property of a class that describes a range of values that instances of the property may hold. An operation is a service that can be requested from an object to affect behavior. T120B029

10 ? Why do we need class models? What is a good class model? How to identify classes? What classes consist of? What are associations and what types of associations exist? What are interfaces? T120B029

11 Identifying Classes –Identify class candidates by picking all nouns and noun phrases out of system requirements specification –Use singular form –Discard anything that does not seem appropriate: redundant, vague, event or operation, outside of scope, attribute T120B029

12 Identifying Objects –Objective: System must satisfy current requirements –Solution: Every required behavior must be provided by some objects –Objective: System must be easy to maintain and adapt to future requirements T120B029

13 Class Notation Name Attributes Operations T120B029

14 Alternative Class Notations Name Attributes Operations Responsibilities Name Attributes Operations Name italicsabstract T120B029

15 Attributes and Operations –Operations define the ways in which objects may interact Operation signatures – how are they defined? Attributes are the data contained in an object Both can be public, protected or private T120B029

16 Attributes Conceptual: Indicates that customer have names Specification: Customer can tell you the name and set it (short for get/set methods) Implementation: An instance variable is available Customer name address creditRating T120B029

17 Operations Services that a class knows to carry out Correspond to messages of the class (or IF) Conceptual level –principal responsibilities Specification level –public messages = interface of the class Normally: Don’t show operations that manipulate attributes T120B029

18 UML syntax for operations visibility name (parameter list) : return-type-expression + assignAgent (a : Agent) : Boolean –visibility: public (+), protected (#), private (-) Interpretation is language dependent Not needed on conceptual level –name: string –parameter list: arguments (syntax as in attributes) –return-type-expression: language-dependent specification T120B029

19 Operations vs. Responsibilities Conceptual: Operations should specify responsibilities, not IF, e.g.: –The Customer specifies the Orders –The Orders list the Customer * 1 Order dateReceived isPrepaid number : String price : Money Responsibilities - lists the customer Customer name address Responsibilities - specifies orders T120B029

20 Relationships connections between classes dependency generalization association T120B029

21 Associations (1) Associations correspond to verbs, as classes correspond to nouns Class A and class B are associated if –An object of class A sends a message to an object of class B –An object of class A creates an object of class B –An object of class A has an attribute whose vales are objects of or collections of objects of class B –An object of class A receives a message with an object of class B as an argument T120B029

22 Association(2) An association is a structural relationship within which classes or objects are connected to each other. (An association between objects is called a link.) CompanyPerson T120B029

23 Association Classes An association class has properties of both an association and a class. CompanyPerson Job description dateHired salary T120B029

24 Association Adornments name role multiplicity aggregation composition T120B029

25 Association Name describes nature of relationship: can also show direction to read name: CompanyPerson works for CompanyPerson works for T120B029

26 Association Roles(1) describe “faces” that classes present to each other within association class can play same or different roles within different associations CompanyPerson employee employer T120B029

27 Association Roles(2) Roles clarify participation of each class in association T120B029

28 Association Multiplicity(1) possible values same as for classes: explicit value, range, or * for “many” Example: a Person is employed by one Company; a Company employs one or more Persons CompanyPerson 1..* 1 T120B029

29 Multiplicity of an association: –An exact number –A range of numbers –An arbitrary, unspecified number (*) T120B029 Association Multiplicity(2)

30 Generalization and Specialization Generalization relationship between two classes indicates that one class in more specific than the other in representing similar objects How to check whether generalization exists: “every Instructor is a Person” Inheritance is a way to implement generalization T120B029

31 Generalization A generalization is a “kind of” or “is a” relationship between a general thing (superclass or parent) and a more specific thing (subclass or child). Shape RectangleCircle T120B029

32 Dependency A dependency is a “using” relationship within which the change in the specification of one class may affect another class that uses it. Example: one class uses another in operation Window handleEvent() Event T120B029

33 Aggregation and Composition Aggregation: an object of one class is a part of another class Composition: a strong form of aggregation – an object of one class is owned by an object of another class T120B029

34 Aggregation Aggregation is a “whole/part” or “has a” relationship within which one class represents a larger thing that consists of smaller things. Department Company T120B029

35 Composition Composition is a special form of aggregation within which the parts are inseparable from the whole. Frame Window T120B029

36 Realization A realization is a relationship between an interface and the class that provides the interface’s services. A class may realize many interfaces. Observer TargetTracker «interface» Observer update() T120B029

37 T120B029

38 An interface is a named collection of operations used to specify a service of a class without dictating its implementation. Observer «interface» Observer update() T120B029 Interfaces in UML (1)

39 An interface specifies some operations of a model element (a class) that are visible outside of a class An interface class cannot have any attributes T120B029 Interfaces in UML (2)

40 Interfaces in UML (3) Stereotype > InputStream {abstract} OrderReader Data InputStream Realization Dependency Generalization > DataInput close() T120B029

41 Interfaces in UML (4) OrderReader Data InputStream Dependency DataInput Interface Lollipops (“short-hand notation”) T120B029

42 Interface Relationships An interface may participate in generalization, association, and dependency relationships. Observer Tracker Periodic Observer Observation T120B029