25/2/16. Software Design (UML) ClassName attributes operations A class is a description of a set of objects that share the same attributes, Operations.

Slides:



Advertisements
Similar presentations
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Advertisements

Informatics 43 – May 7, Restatement of Goals for Testing Want to verify software’s correctness  Need to test  Need to decide on test cases  No.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Class Diagram & Object Diagram
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Programming With Java ICS201 University Of Hail1 Chapter 12 UML and Patterns.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
© SERG Software Design (UML) Software Design Static Modeling using the Unified Modeling Language (UML) Material based on [Booch99, Rambaugh99, Jacobson99,
1 CSE 403 Design and UML Class Diagrams Reading: UML Distilled Ch. 3, by M. Fowler These lecture slides are copyright (C) Marty Stepp, They may not.
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
1 TCSS 360, Spring 2005 Lecture Notes Design Phase and UML Class Diagrams Relevant Reading: UML Distilled, Third Edition M. Fowler.
Introduction to UML Lian Yu Department of Computer Science and Engineering Arizona State University Tempe, AZ
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.
Software Construction Lecture 5 Class Diagrams. Agenda 2  Topics:  Examples of class diagrams  Navigation, visibility, named associations, and multiplicity.
© SERG Software Design (UML) Software Design Static Modeling using the Unified Modeling Language (UML) Material based on [Booch99, Rambaugh99, Jacobson99,
12-CRS-0106 REVISED 8 FEB 2013 CSG2H3 Object Oriented Programming.
DOMAIN MODEL CLASS DIAGRAM Prepared by: Fatimah Alakeel November, 2011.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Uml is made similar by the presence of four common mechanisms that apply consistently throughout the language. After constructing or developing the architecture.
1 Object Oriented Design and UML Class Relationships –Dependency –Aggregation –Inheritance Reading for this Lecture: L&L 6.4 – 6.5.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
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.
Software Design Software Design (UML) Static Modeling using the Unified Modeling Language (UML) Material based on [Booch99, Rambaugh99, Jacobson99, Fowler97,
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.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
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.
Database Design – Lecture 12 Object Oriented Database Design cont’d.
Class Diagram Chapter 21 Applying UML and Patterns Craig Larman.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Programming With Java ICS201 University Of Hail1 Chapter 12 UML and Patterns.
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.
Overview of Software Project Management Review – Class 5 UML diagrams cont Overview of Software Project Management - Communication CEN 4010 Class 6 – 09/15.
© SERG Software Design Static Modeling using the Unified Modeling Language (UML) Material based on [Booch99, Rambaugh99, Jacobson99, Fowler97, Brown99]
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
Informatics 43 – May 5, Restatement of Goals for Testing Want to verify software’s correctness  Need to test  Need to decide on test cases  No.
Inf 43: Introduction to Software Engineering May 7, 2016.
TCSS 305 (Stepp) OO Design with UML Class Diagrams
COMP 2710 Software Construction Class Diagrams
Lec-4 : Unified Modeling Language (UML)
Entity Relationship Model
Visit for more Learning Resources
Lecture on Design Phase and UML Class Diagrams
UNIT-III.
Unified Modeling Language (UML)
Object Oriented Programming
UML Class Diagrams: Basic Concepts
UML Class Diagram.
Unified Modelling Language
Understand and Use Object Oriented Methods
Static Modeling using the Unified Modeling Language (UML)
ITEC 3220A Using and Designing Database Systems
Class Diagrams Class diagram is basically a graphical representation of the static view of the system and represents different aspects of the application.
Class Diagram.
Introduction to UML Sources:
Static Modeling using the Unified Modeling Language (UML)
Object Oriented System Design Class Diagrams
Presentation transcript:

25/2/16

Software Design (UML) ClassName attributes operations A class is a description of a set of objects that share the same attributes, Operations and relationships Graphically, a class is rendered as a rectangle, usually including its name, attributes, and operations in separate, designated compartments.

Software Design (UML) ClassName attributes operations The name of the class is the only required tag in the graphical representation of a class. It always appears in the top-most compartment.

Software Design (UML) Person name : String address : Address birthdate : Date ssn : Id An attribute is a named property of a class that describes the object being modeled. In the class diagram, attributes appear in the second compartment just below the name-compartment.

Software Design (UML) Person name : String address : Address birthdate : Date / age : Date ssn : Id Attributes are usually listed in the form: attributeName : Type A derived attribute is one that can be computed from other attributes, but doesn’t actually exist. For example, a Person’s age can be computed from his birth date. A derived attribute is designated by a preceding ‘/’ as in: / age : Date

Software Design (UML) Person + name : String # address : Address # birthdate : Date / age : Date - ssn : Id Attributes can be: + public # protected - private / derived

Software Design (UML) Person name : String address : Address birthdate : Date ssn : Id eat sleep work play Operations describe the class behavior and appear in the third compartment.

Software Design (UML) Person name : String birthdate : Date ssn : Id eat() sleep() work() play() When drawing a class, you needn’t show attributes and operation in every diagram. Person name address birthdate Person eat play Person

Software Design (UML) A class may also include its responsibilities in a class diagram. A responsibility is a contract or obligation of a class to perform a particular service. SmokeAlarm Responsibilities -- sound alert and notify guard station when smoke is detected. -- indicate battery state

 Find classes – ◦ A good rule of thumb is that you should look for the three-to-five main classes right away  Find responsibilities - ◦ Ask yourself what a class does as well as what information you wish to maintain about it.  Define collaborators - ◦ A class often does not have sufficient information to fulfil its responsibilities. It must collaborate (work) with other classes to get the job done. Collaboration will be in one of two forms: a request for information or a request to perform a task.

UG Degree Collaborators Responsibilities Degree Applicant Based on course Requires exams PG Course Responsibilities Course Collaborators Application Degree Knows its name Knows its description Has requirements UG Degree(s) Exam Has applications Superclass

Software Design (UML) In UML, object interconnections (logical or physical), are modeled as relationships. There are three kinds of relationships in UML: dependencies generalizations associations

Software Design (UML) CourseSchedule add(c : Course) remove(c : Course) Course A dependency indicates a relationship between two or more elements. The dependency from CourseSchedule to Course exists because Course is used in both the add and remove operations of CourseSchedule.

Software Design (UML) Person A generalization connects a subclass to its superclass. It denotes an inheritance of attributes and behavior from the superclass to the subclass and indicates a specialization in the subclass of the more general superclass. Student

Software Design (UML) If two classes in a model need to communicate with each other, there must be link between them. An association denotes that link. Instructor Student

Software Design (UML) We can indicate the multiplicity of an association by adding multiplicity adornments to the line denoting the association. The example indicates that a Student has one or more Instructors: Instructor Student 1..*

Software Design (UML) The example indicates that every Instructor has one or more Students: Instructor Student 1..*

Software Design (UML) We can also indicate the behavior of an object in an association (i.e., the role of an object) using rolenames. Instructor Student 1..* learns fromteaches

Software Design (UML) We can also name the association. Team Student membership 1..*

Software Design (UML) We can specify dual associations. Team Student member of 1..* president of11..*

Software Design (UML) We can constrain the association relationship by defining the navigability of the association. Here, a Router object requests services from a DNS object by sending messages to (invoking the operations of) the server. The direction of the association indicates that the server has no knowledge of the Router. Router DomainNameServer

Software Design (UML) Associations can also be objects themselves, called link classes or an association classes. Warranty ProductRegistration modelNumber serialNumber warrentyCode

Software Design (UML) A class can have a self association. LinkedListNode next previous

Software Design (UML) We can model objects that contain other objects by way of special associations called aggregations and compositions. An aggregation specifies a whole-part relationship between an aggregate (a whole) and a constituent part, where the part can exist independently from the aggregate. Aggregations are denoted by a hollow-diamond adornment on the association. Car Engine Transmission

Software Design (UML) A composition indicates a strong ownership and coincident lifetime of parts by the whole (i.e., they live and die as a whole). Compositions are denoted by a filled-diamond adornment on the association. Window ScrollbarTitlebarMenu *

27 DVD MovieVHS MovieVideo Game Rental Item Rental Invoice 1..* 1 Customer Checkout Screen Simple Association Class Abstract Class Simple Aggregation Generalization Composition Multiplicity

28 StudentBody + main (args : String[]) + toString() : String 1100 Student - firstName : String - lastName : String - homeAddress : Address - schoolAddress : Address + toString() : String - streetAddress : String - city : String - state : String - zipCode : long Address