Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Class Syntax Basic Class Diagrams.

Slides:



Advertisements
Similar presentations
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Use Cases CS/SWE 421 Introduction to Software.
Advertisements

ESE Einführung in Software Engineering 7. Modeling Behaviour Prof. O. Nierstrasz.
Analysis Modeling Static Modeling.
UML Class and Sequence Diagrams Violet Slides adapted from Marty Stepp, CSE 403, Winter 2012 CSE 403 Spring 2012 Anton Osobov.
UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
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.
Sharif University of Technology1 Design and Use-case Realization Software Engineering Laboratory Fall 2006.
UML Notations Activity diagrams State diagrams Class diagrams Use-case diagrams.
1 Object-Oriented Modeling Using UML CS 3331 Fall 2009.
The Unified Modeling Language (UML) Class Diagrams.
Object-Oriented Analysis and Design
Objectives Design Class Diagrams Issues in system design Generalization Review UML papers.
Chapter 9 Domain Models. Domain Model in UML Class Diagram Notation A “visual dictionary”
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
OBJECT ORIENTED PROGRAMMING LECTURE 12 Instructor: Rashi Garg Coordinator: Gaurav Saxena.
Page 1 What is the UML? UML stands for Unified Modeling Language The UML combines the best of the best from – Data Modeling concepts (Entity Relationship.
What is a domain model? “A domain model captures the most important types of objects in the context of the business. The domain model represents the ‘things’
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Class Syntax Basic Class Diagrams.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Class Syntax Basic Class Diagrams.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Objects, Classes, and Basic Class Diagrams.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Introduction to Objects Objects,
Conceptual Data Modeling. What Is a Conceptual Data Model? A detailed model that shows the overall structure of organizational data A detailed model.
Page 1  Copyright © 1997 by Rational Software Corporation Computer System Business Process Order Item Ship via “ Modeling captures essential parts of.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Use Cases CS/SWE 421 Introduction to Software.
Association Class Generalization/Specialization Whole-Part Page More Associations 1.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Today in OOAD  The Domain Model Artifact UML Classes  EU-Bid Domain Model Exercise  EU-Lease Domain Model Assignment Guest Speaker  Kate Cunningham,
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
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.
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.
University of Toronto at Scarborough © Kersti Wain-Bantin CSCC40 classes 1 classes a class describes a group of objects with: similar properties (attributes)
Design Model Lecture p6 T120B pavasario sem.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
Domain Classes – Part 1.  Analyze Requirements as per Use Case Model  Domain Model (Conceptual Class Diagram)  Interaction (Sequence) Diagrams  System.
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.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Use Cases CS/SWE 421 Introduction to Software.
Page 1  Copyright © 1997 by Rational Software Corporation Putting the UML to Work The ESU University wants to computerize their registration system –
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
INFO 620Lecture #71 Information Systems Analysis and Design Design Class Diagrams and others INFO 620 Glenn Booker.
Chapter 16 UML Class Diagrams.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Unified Modeling Language Introduction.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Unified Modeling Language Introduction.
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.
Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Introduction to the Unified Modeling Language.
WELCOME TO OUR PRESENTATION UNIFIED MODELING LANGUAGE (UML)
Data Modeling Using the Entity- Relationship (ER) Model
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Object-Oriented Analysis and Design
Introduction to the Unified Modeling Language
Unified Modeling Language
Today’s Objectives Define the Problem Domain
UML Unified Modelling Language
Object Oriented Analysis and Design
Use Cases CS/SWE 421 Introduction to Software Engineering Dan Fleck
UML Class Diagram.
Introduction to the Unified Modeling Language
Use Cases CS/SWE 421 Introduction to Software Engineering Dan Fleck
Introduction to the Unified Modeling Language
Objects, Classes, and Basic Class Diagrams
Objects, Classes, and Basic Class Diagrams
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
Presentation transcript:

Generalizable Element Namespace Model Element name visibility isSpecification Classifier isRoot Constraint Body Coming up: Class Syntax Basic Class Diagrams CS/SWE 421 Introduction to Software Engineering Dan Fleck (Slides adapted from Dr. Stephen Clyde with permission)

Tool Issue (Jan 28, 2010) n Netbeans 6.8 is out and the old UML plugin is no longer maintained or working in 6.8 n Another option: Visual Paradigm Community Edition ( ) n Install Netbeans 6.8 n Install SDE 5.2 Community Edition n Register for Community (free) license n Start Netbeans n Create a project (any type) n Tools-> Start SDE CE-NB

Coming up: Class Names Class Syntax n A box divided into compartments –Name –Attributes –Operations –Responsibilities (rarely seen) –Used-defined compartments (rarely seen) Student major: String gpa: Real standing: String add(Class Section) drop(Class Section) -- The set of students known to the registration system -- An exception occurs if gpa falls below 2.0

Coming up: Exercise – Class Identification Class Names n The name should be a noun or noun phrase n The name should be singular and description of each object in the class n The name should be meaningful from a problem-domain perspective –“Student” is better than “Student Data” or “S-record” or any other implementation driven name

Coming up: Attributes Exercise – Class Identification n Identify meaningful classes in the Elevator System

Coming up: Attributes from an Analysis Perspective Attributes n Attributes represent characteristics or properties of classes n They are place holders or slots that hold values n The values they hold are other objects (or primitive types)

Coming up: Attribute Syntax Attributes from an Analysis Perspective n An attribute relates an object to some other object n It has the same semantics as an association joe: Student name: String = “Joe Jones” joe: Student Joe Jones : String Is basically the same as... name 1

Coming up: Operations Attribute Syntax visibility: public “+”, protected “#”, or private “-” name: capitalize first letter of each word that makes up the name, except for the first multiplicity: number, range, or sequence of number or ranges. type: build-in type or any user-defined class initial-value: any constant and user-defined object property-string: e.g, changeable, addOnly, frozen [visibility] name [multiplicity] [:type] [=initial-value] [{property-string}]

Coming up: Operation Syntax Operations Student major: String GPA: Real standing: String add(Class Section) drop(Class Section) Class Section name: String capacity: Integer add(Student) drop(Student) checkPrerequisites(Students) Prerequisite <has takes> Course

Coming up: Type of Relationships in Class Diagrams Operation Syntax visibility: “+”, “#”, “-” name: verb or verb phase, capitalize first letter of every word, except first parameter-list: coma separated list of parameters return-type: primitive type or user-defined type property-string: isQuery, sequential, guarded, concurrent [visibility] name [(parameter-list)] [:return- type] [{property-strong}]

Coming up: Associations Type of Relationships in Class Diagrams Relation A consolidated snippet of the UML Meta-model Association Generalization Dependency Aggregation Binary AssociationN-ary Association

Coming up: Associations Associations n An association is a structural relationship that specifies that objects of class may be connected to objects of another class n Associations typically represent “long-lived” relationships ( –e.g. In a library system a Person always has a name (association), but may infrequently have a book (dependency)

Coming up: Association Names Associations Student Class Section Course Semester Instructor Department takes> is registered for> teaches> sponsors> <works for is instance of> is held during>

Coming up: Navigation Association Names n Associations may be named –The names should communicate the meaning of the links –The names are typically verb phases –The name should include an arrow indicating the direction in which the name should be read –The direction on the name does NOT change navigability!

Coming up: Navigation Navigation n The navigation of associations can be –uni-directional –bi-directional –unspecified n Navigation is specified by the arrow, not the label Class Section Course Instructor Department teaches> sponsors> <works for is instance of>

Coming up: Generalization Navigation n The navigation of association without an arrowhead is assumed to be undefined n Navigation has less value when modeling from a conceptual perspective –Why? n Navigation is more important during specification and implementation perspectives –Why?

Coming up: Exercise – Simple Associations Generalization n Generalization is another kind of relationship in UML n In a Java implementation what is this? StudentPerson Graduate Student

Coming up: Class Diagrams Exercise – Simple Associations n From an analysis perspective: –Identify meaningful associations and generalization/specializations among classes in the Elevator System

Coming up: Multiplicity Constraints Class Diagrams n Class Diagrams describe –the types of objects in a system –their properties (attributes and operations) –relationships between objects n They can also include –Grouping concepts like packages –Constraints –Various kinds of annotations

Coming up: Questions Multiplicity Constraints Student Class Section Course Semester Instructor Department takes> is registered for> teaches> sponsors> <works for is instance of> is held during> 1..* *

Questions n From the previous diagram –How many classes can a student take? –Do you have to be registered in any classes to be a student? –Do I need to teach this class to be an Instructor? Do I need to teach ANY classes? –Can a class have no students? Is that valid? Coming up: Multiplicity Constraints

Coming up: Dependencies Multiplicity Constraints n A multiplicity constraint can be –a single number –a “*”, meaning an arbitrarily large number or simply “many” –a range, denoted by “min..max” –a sequence of single numbers and ranges 1..2,7,10-20 This is also called the cardinality constraint

Coming up: Dependency Relationship Dependencies Relation A consolidated snippet of the UML Meta-model Association Generalization Dependency Aggregation Binary AssociationN-ary Association

Coming up: Dependencies Dependency Relationship n It says that one modeling component “uses” another. n If the later changes then, the former may have to change as well

Coming up: Aggregations (is part of) Dependencies n Syntax: –a dashed link with an straight-line arrowhead point to a component on which there is a dependency n Dependencies can be defined among: classes, notes, packages, and other types of components n Can dependencies go both ways? n Any problems with having lots of dependencies?

Coming up: Aggregation Aggregations (is part of) Relation A consolidated snippet of the UML Meta-model Association Generalization Dependency Aggregation Binary AssociationN-ary Association

Coming up: Composition (very similar to aggregation) Aggregation n Aggregation: is a special kind of association that means “part of” n Aggregations should focus on single type of composition (physical, organization, etc.) 1 1 * 4..* Pizza Order Slice Crust Sauce Serving Cheese Serving Topping Serving

Coming up: Lets look at BookstoreExample4.jpg Composition (very similar to aggregation) n Think of composition as a stronger form of aggregation. Composition means something is a part of the whole, but cannot survive on it’s own. BuildingRoom

Lets look at BookstoreExample4.jpg n Does John McCain (who has 7 houses) have a problem using this system? n If Barack Obama decides to create a Federal sales tax, how would we change the system? n Why is there a display method in Item, Book, MusicCD and Software? n An ItemOrder is part of how many Orders? n Can you explain how a search works using this diagram? Coming up: Class Exercise

Class Exercise n Lets create the WeGrow class diagram Coming up: Safety System Example

Safety System Example n A safety software system for housing areas: –enables its owner to configure it during installation, –controls through its sensors the environmental areas against fire and burglary and –interacts with the owner through the keypad of the system control panel. n During installation, the system programming and configuration is carried out by using the numerical and functional keys of the control panel. Each sensor in the system is identified by a number and a type (fire or burglary). The system stores two passwords (each of them is up to six digits) used for the system activation/deactivation and a telephone number used for emergency calls when an alarm event arises. The system polls the fire sensors for M seconds, then disables them for other N seconds. After that, the system resumes the same cycle. The Ready indicator is lighting when the sensors are polled and is turned o ff when the sensors are disabled. When a sensor indicates an event, the system launches an alarm signal. After K seconds, the system calls the security forces office and provides it with information about the event nature and location. In order to log in, the owner enters the password and presses Enter. If any of the six digits is wrong the password is ignored by the system and the sensors’s state doesn’t change. The owner can cancel the password with the Clear key. If a sensor is activated, the system is armed and the Armed indicator on the control panel is turn on. In the case of the sensor deactivation, the Armed indicator is turn o ff. Moreover, the system logs all events. Each logged event is characterized by its type and the date and time of its occurrence. The event list can be delivered by pressing the MEM key. Coming up: Questions Example specification from:

Coming up: More Questions Questions n What’s the difference between an attribute and an association with another class? For example, should “grade” be an attribute or a link to another class called “Grade”? n When during the software engineering life cycle should you build classes diagrams?

Coming up: What’s important More Questions n How do you know when a class diagram is complete? n How can you manage change control on all the class diagrams for project? n What do you do with class diagrams after a system has been built and delivered?

What’s important n Understading the 3 main parts of the class box n Generalization/Specialization n Associations and multiplicity constraints n Aggregation (and composition) understand how to use them, but don’t worry about the differences between them – too subtle Coming up: Bonus Slide!

Bonus Slide! n If you’re interested in Auto-generating UML, Netbeans has an option to do it. –Install the UML plugin –Right-click on a project –Choose “Reverse Engineer” –Go to the new UML project –Select a package and choose to generate a new UML diagram n This may not be true anymore with the new plugin! End of presentation