Modeling Structure – Class Diagram. Class Diagram.

Slides:



Advertisements
Similar presentations
Conquering Complex and Changing Systems Object-Oriented Software Engineering Chapter 5, Analysis: Object Modeling.
Advertisements

UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object-oriented analysis (OOA) techniques are used to (1) study existing objects to see if they can be reused or adapted for new uses, and (2) define new.
Jerry Gao Ph.D.9/2001 The UML: Object-Oriented Modeling The Unified Modeling Language (UML) Instructor: Jerry Gao Ph.D. San Jose State University
Irwin/McGraw-Hill Copyright © 2004 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS6th Edition.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Irwin/McGraw-Hill Copyright © 2000 The McGraw-Hill Companies. All Rights reserved Whitten Bentley DittmanSYSTEMS ANALYSIS AND DESIGN METHODS5th Edition.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1 Introduction to Object-Oriented Programming.
Systems Analysis and Design in a Changing World, 6th Edition
Chapter 5: Modeling Systems Requirements: Events and Things
DeSiamorewww.desiamore.com/ifm1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
Object-oriented Design CSCI 5801: Software Engineering.
Systems Analysis and Design in a Changing World, Tuesday, Feb 27
Systems Analysis and Design in a Changing World, Fifth Edition
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
COP 3331 OBJECT-ORIENTED ANALYSIS AND DESIGN Bob Myers Department of Computer Science Week 6 Lecture.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Association Class Generalization/Specialization Whole-Part Page More Associations 1.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
Lab 04.
Using UML, Patterns, and Java Object-Oriented Software Engineering Chapter 2, Modeling with UML: Review Session (Optional)
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
7-1 © Prentice Hall, 2004 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
Domain Modeling Part2: Domain Class Diagram Chapter 4 pp part 2 1.
بسم الله الرحمن الرحيم ” اللهم أنت ربي لا إله إلا أنت خلقتني و أنا عبدك وأنا على عهدك ووعدك ما استطعت ، أعوذ بك من شر ما صنعت ، أبوء لك بنعمتك على و أبوء.
Chapter 8 Analysis & Modeling. Data Modeling examines data objects independently of processing focuses attention on the data domain creates a model at.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Modeling system requirements. Purpose of Models Models help an analyst clarify and refine a design. Models help simplify the complexity of information.
UML Diagrams: The Static Model Class Diagrams. The Static Model Define the static structure of the logical model Represent classes, class hierarchies.
DeSiamorePowered by DeSiaMore1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
5 Systems Analysis and Design in a Changing World, Fifth Edition.
Modeling System Requirements: Events and Things. Objectives Explain the many reasons for creating information system models Describe three types of models.
Msigwaemhttp//:msigwaem.ueuo.com/1 Database Management Systems (DBMS)  B. Computer Science and BSc IT Year 1.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
Static Modeling Chapter 8 Part of Requirements Modeling Designing Concurrent, Distributed, and Real-Time Applications with UML Hassan Gomaa (2001)
Class Modeling Design Class diagram. Classes The term “class ” refers to a group of objects that share a common attributes and common behaviour (operations).
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
(14-2) UML Instructor - Andrew O’Fallon CptS 122 (December 2, 2015) Washington State University.
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.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
22 August, 2007Information System Design IT60105, Autumn 2007 Information System Design IT60105 Lecture 8 Use Case Diagrams.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
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.
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.
Class Diagram Slide 1 1. Objective  Introduces the evolutionary approach for building classes  Explain how to identify objects and attributes of classes.
Inf 43: Introduction to Software Engineering May 7, 2016.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
5 Systems Analysis and Design in a Changing World, Fourth Edition.
5 Chapter 5: Modeling Systems Requirements: Events and Things Systems Analysis and Design in a Changing World.
UML Diagrams: Class Diagrams The Static Analysis Model
Lec-4 : Unified Modeling Language (UML)
Copyright © 2014 Hassan Gomaa and Robert Pettit
Software Lifecycle Activities
Class diagram Description
ER MODEL Lecture 3.
Introduction to UML Introduction to UML Shiyuan Jin September,23,2002
UML Diagrams: The Static Model Class Diagrams
Domain Class Diagram Chapter 4 Part 2 pp
Software Engineering Lecture #11.
Class Diagram Slide 1.
Class Diagram Slide 1.
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Information System Design
Presentation transcript:

Modeling Structure – Class Diagram

Class Diagram

Operations (behaviors) to fulfill the class’s responsibilities. Object class name Attributes

Steps in Developing a Class Diagram Identify object classes Identify associations Identify object attributes Organize object classes using inheritance Describe communication using sequence diagrams Group classes

Class attributes subClass operations Class Diagram Object subClass

Relationships between classes 1.Associations 2.Composition/Aggregation 3.Generalization/Specialization Associations – relationship between classes – E.g, Employee works in Department – Specifies how many instances of one class may relate to a single instance of another class 1-to-1 association Optional association (0, 1, or many) – Company has President – Customer owns Credit Card 1-to-many association Many-to-Many association – Bank manages Account – Course has Student – Student attends Course

Showing Association An Association between two classes is shown by a simple line. It can be given a descriptive name and augmented with the Role played by each class and with the Cardinality of the relationship.

Associations Has-capital One-to-one association One-to-many association City name:String Workorder schedule() StickyNote x: Integer y: Integer z: Integer * Country name:String [From Bruegge, 2000]

Many-to-Many Associations Work on ** MechanicsPlane [From Bruegge, 2000]

Sample UML Cardinality Notations

Composition and Aggregation Hierarchies Whole/Part Relationships – Show components of more complex class – Composition is stronger relationship than aggregation Composition Hierarchy – Whole and part objects are created, live, die together – Often also has a physical association – Association between instances Aggregation Hierarchy – Part objects of aggregate object may be created and deleted independently of aggregate object – Often used for more abstract whole/part relationships than composite objects

Showing Aggregation If one class is contained within another a solid diamond is placed on the line next to the containing class. This is termed by value, Class2 it essentially a value within Class1. If the relationship is a simple aggregation then an empty diamond is used. This is termed by reference, Class1 refers to Class2.

Kereta Roda Enjin TempatDuduk Aggregation Example

weight Automobile serial number year manufacturer model color drive purchase Aggregation Example Engine horsepower volume on off 4,6 Wheel diameter number of bolts 2,4 Door open close Battery amps volts charge discharge * Brakelight on off [From Bruegge, 2000]

Some classes are similar but not identical – Have some attributes in common, others different Common attributes abstracted into generalized class(superclass) – E.g., Account (Account number, Balance) Different attributes are properties of specialized class(subclass) – E.g., Savings Account (Interest) IS A relationship between subclass and superclass – Savings Account IS A Account Generalization / Specialization Hierarchy

‘generalization’ showing inheritance Inheritance is shown by a line from the sub-class to the super- class with an arrow pointing to the super class. Super class Sub class

STAF Nama Alamat Gaji No.staf STAFPengeluaran Kiragaji cetakslipgaji STAFPentadbiran Kiragaji cetakslipgaji Pengurus Kiragaji cetakslipgaji Example : Inheritance

UML Representation of Generalization/Specialization walk() jump() talk() sleep() eat() etc.() last name first name birthdate gender Person enroll() displayGPA() GPA classification Student lecture() rank Teacher Arrowhead indicates generalization/specialization relationship

Inheritance Example Cell MuscleCellBloodCellNerveCell StriateSmoothRedWhitePyramidalCortical [From Bruegge, 2000]

* Light off on 1 1 Heater 1 Cooler 1 Environmental Controller Define_climate Terminate_climate * SystemLog Display RecordEvent Actuator startUp shutDown Temperature Example : Class Diagram

User Address Member# Name Subscribe Unsubscribe External Reader Ext. Library Name Borrower Items Borrowed Maximum Loans Library Item No. Copies ShelfNo Status Title Issue Return Shelve Book Author ISBN Pub. Date Publisher CAL Package Distributor Recorded Media Course Text Borrows Aggregation AssociationGeneralization Object /Class 0..* Example : Class Diagram

Summary – Class Relationship PlanAnalystPlanMetricsPlanGrowingPlanGardeningPlanControllerCoolerLightHeater FruitGrowingPlan FoodVitaminCalorie analyzes * * *1 ** *1 AGGREGATION ASSOCIATION GENERALIZATION / INHERITANCE COMPOSITION

Member Services System Class Diagram

Class Diagram for KMT Client

prepare() check() [check=“true”] remove() needsToReorder() [needsToReorder=“true”] enter new Reorder Item Delivery Item Order Entry window OrderOrder LineStock Item [check=“true”] enter new Sequence Diagram

ReOrderItem itemnumber quantity etc… DeliveryItem deliveryadress quantity etc… Order orderNumber date etc… prepare() OrderLine itemnumber quantity etc… StockItem orderNumber minQuantity date etc… needsToReorder(): boolean check(): boolean remove() is_for prepare() enter new()

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

Recap Af ter studying this chapter we learned to: –Understand how to structure requirements with class diagram. –Explain the element of class diagrams –Construct class diagrams.