Class diagram. Purpose of Structural Models Class diagrams represent –Generic Categories (classes) of things (objects) –Define relationships among Generic.

Slides:



Advertisements
Similar presentations
UML and Classes, Objects and Relationships [1]
Advertisements

Analysis Modeling.
CS 340 UML Class Diagrams. A model is an abstraction of a system, specifying the modeled system from a certain viewpoint and at a certain level of abstraction.
IS514Slide 1 IS514 Lecture Week 7 Class Diagrams II.
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
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 
PowerPoint Presentation for Dennis, Wixom & Tegarden Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
Systems Analysis and Design in a Changing World, 6th Edition
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
Structural Modeling: Class Diagrams Copyright © 2009 John Wiley & Sons, Inc. Copyright © 2005 Pearson Education Copyright © 2009 Kannan Mohan CIS 4800.
IS0514Slide 1 IS0517 Lecture Week 8 Class Diagrams III.
ZEIT2301 Design of Information Systems Structural Design: Class Diagrams School of Engineering and Information Technology Dr Kathryn Merrick.
Objects and Components. The adaptive organization The competitive environment of businesses continuously changing, and the pace of that change is increasing.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
The Software Development Life Cycle: An Overview Presented by Maxwell Drew and Dan Kaiser Southwest State University Computer Science Program.
IS0514Slide 1 IS0514 Lecture Week 5 Introduction to Object Orientation.
Summary Data Modeling SDLC What is Data Modeling Application Audience and Services Entities Attributes Relationships Entity Relationship Diagrams Conceptual,Logical.
Session 11 The Class Diagram: Aggregation and Generalization Written by Thomas A. Pender Published by Wiley Publishing, Inc. October 12, 2011 Presented.
Conceptual Data Modeling. What Is a Conceptual Data Model? A detailed model that shows the overall structure of organizational data A detailed model.
R McFadyen Chapter 7 Conceptual Data Modeling.
Programming in Java Unit 3. Learning outcome:  LO2:Be able to design Java solutions  LO3:Be able to implement Java solutions Assessment criteria: 
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.
Structural Modeling Chapter 7
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.
Object-Oriented Software Engineering Practical Software Development using UML and Java Chapter 5: Modelling with Classes.
Distributed Java Programming Distributed Java Programming Class #2 August 22, 2002.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
7-1 © Prentice Hall, 2004 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Domain Modeling Part2: Domain Class Diagram Chapter 4 pp part 2 1.
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.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
What is a Structural Model?
Structural Modeling Chapter 7. Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes in.
1 Structural Modeling Chapter 7. 2 Key Ideas A structural or conceptual model describes the structure of the data that supports the business processes.
Peyman Dodangeh Sharif University of Technology Fall 2014.
Domain Modeling Yonglei Tao.
Object Oriented Analysis and Design Class and Object Diagrams.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
PowerPoint Presentation for Dennis, Wixom & Tegardem Systems Analysis and Design Copyright 2001 © John Wiley & Sons, Inc. All rights reserved. Slide 1.
Structural Modeling. Introduction A Structural model is a formal way of representating the objects that are used and created by a business system One.
 Class diagrams show the classes of the system, their interrelationships (including inheritance, aggregation, and association), and the operations and.
Class Diagrams. Terms and Concepts A class diagram is a diagram that shows a set of classes, interfaces, and collaborations and their relationships.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
Slide 1 Systems Analysis and Design with UML Version 2.0, Second Edition Alan Dennis, Barbara Haley Wixom, and David Tegarden Chapter 7: Structural Modeling.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
ER Diagrams ● Many different notations are available ● From wikipedia:wikipedia: Entity-relationship modelwikipedia: Entity-relationship model ● How do.
Chapter 12 – Object-Oriented Design
Unified Modeling Language (UML)
Structural Modeling.
Chapter 5: Structural Modeling
Chapter 11 Object-Oriented Design
Analysis and Design with UML: Discovering Classes and Relationships
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Analysis and Design with UML: Discovering Classes and Relationships
Inheritance B.Ramamurthy 11/7/2018 B.Ramamurthy.
Advanced Java Programming
Analysis and Design with UML: Discovering Classes and Relationships
Object Oriented Analysis and Design
Engineering Quality Software
Copyright 2007 Oxford Consulting, Ltd
Analysis and Design with UML: Classes and Relationships
Summary Data Modeling SDLC What is Data Modeling
Object Oriented System Design Class Diagrams
2.1 Introduction to Object-Oriented Programming
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
From Class Diagram to Contract Diagram
Presentation transcript:

Class diagram

Purpose of Structural Models Class diagrams represent –Generic Categories (classes) of things (objects) –Define relationships among Generic Categories (classes) of things (objects)

Classes Generic type of thing Objects are the individual things Classes are templates for creating instances or objects –Concrete –Abstract Typical examples: –Application domain, user interface, data structure, file structure, operating environment, document, and multimedia classes

Attributes Facts related to a type of thing –Attributes of a class –Class – Car Attribute may include: Make, Model, Engine size, etc Only attributes important to the task should be included

Operations Behavior types of things do –Class – Car, Operation – accelerate(), break(), etc Action that instances/objects can take – defined by the class Focus on relevant problem-specific operations (at this point) Quick Exercise – in 1 minute

Exercise 1 - Classes A Cinema shows films. Each film has a title, a producer, a director, a length, certificate and a genre. Patrons watch films at the cinema. Patrons are either adults or children and have a name and an age. To see a film a patron has to buy a ticket. A ticket has a price, a time and is for a film.

Exercise 1 – Solution Template ClassAttributes

Class Diagram Mechanism for visualising classes Became truly central within all object oriented methods A Class Diagram shows –Classes Attributes Operations –Relationships Which are consistent over time Shows the structure of things and ideas in a system

Basic Diagram Identify Classes Draw a rectangle for each class Name it

Add attributes and operations For each class identified Identify attributes –Facts associated with classes Identify operations/methods –Actions objects of the classes do Re-factor –Are the attributes in the right class? –Are the operations in the right class?

Simple Class Diagram Attributes Operations Class

Relationships Some Classes can be related Relationships have difference types Generalization / Specialization Aggregation Composition Association

Relationships Classes do not exist in isolation It is important to consider how they –Interact –Relate Tend to be VERBS Five principal types of relationships

Type One - Dependency Where one class must know about another Example: – Prospective student knows of a course Not commonly used Used more commonly in design / implementation –Java – import javax.swing.*; Car Wheel

Type Two - Association Classes associated with / related to one another Example –Student studies a course Very Commonly used “Default” type of relationship StudentCourse studies►

Type Three - Aggregation Classes made up of other classes “Part of” relationship Objects of classes that can exist in their own right Example –Student is a member of a seminar group Seminar Student memberOf ►

Type Four - Composition Class is an integral part of another “Integral part of” relationship Object of classes that cannot exist without the other Example: –Seminar is delivered for a Module SeminarModule deliveredFor ►

Type Five Inheritance Specialisation / generalisation between two classes Example –Part Time Student is a type of Student StudentPartTimeStudent

Visibility DescriptionSymbo l PublicIs directly accessible by an instance of any class + PrivateMay only be used by an instance of the class that includes it - Protecte d May be used either by an instance of the class that includes it or by a subclass of that class # PackageIs directly accessible only by instances of a class in the same package ~

Association Classes Sometimes the way in which objects of a class are associated is just as important as the objects of a class themselves Consider the association between Student and Module. Where should our system record the student’s marks on for each student on each module? StudentModule 1..*6 is taking  is taking mark : Integer association class

Constraints a constraint is a condition that has to be satisfied Use with care –Too much text on a diagram –Can be over used

Recursive Association - is allowed, and can be useful ! an employee, as a manager, may manage other employees; each employee may be managed by another employee employee  manages 0..* 0..1

Class v. Object Diagram Staff staffName staffID staffstartdate staffdept AkhtarAli:Staff staffName=Akhtar Ali staffID=313 staffstartdate= staffdept=SDE full symbol for an object is a box with 3 compartments class name attributes operations an instance symbol shows both instance and class name underlined with a colon to separate in an instance symbol, both attribute names and values are given

ที่มา IS0514, Business Systems Development Tools and Techniques, Northumbria University : Dr. M. Akhtar Ali