Structural Modeling: Class Diagrams Copyright © 2009 John Wiley & Sons, Inc. Copyright © 2005 Pearson Education Copyright © 2009 Kannan Mohan CIS 4800.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

Behavioral Modeling: State Diagrams CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College Copyright © 2009 John Wiley & Sons,
Object-Oriented Analysis and Design: Object Modeling – Class Diagrams
Systems Analysis and Design 8th Edition
Chapter 22 Object-Oriented Systems Analysis and Design and UML Systems Analysis and Design Kendall and Kendall Fifth Edition.
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.
L3-1-S1 OO Concepts © M.E. Fayad SJSU -- CMPE Software System Engineering Dr. M.E. Fayad, Professor Computer Engineering Department, Room.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design Copyright 2000 © John Wiley & Sons, Inc. All rights reserved. Slide 1 The.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
Slide 1 Systems Analysis & Design CS183 Spring Semester 2008 Dr. Jonathan Y. Clark Course Website:
Chapter 14 (Web): Object-Oriented Data Modeling
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation (Adapted) Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra,
Chapter 14: Object-Oriented Data Modeling
BACS 287 Basics of Object-Oriented Programming 1.
Object-Oriented Systems Analysis and Design Using UML
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
Unified Modeling Language, Version 2.0
5 Systems Analysis and Design in a Changing World, Fourth Edition.
Object Orientation Yaodong Bi, Ph.D. Department of Computer Sciences University of Scranton October 18, 2015October 18, 2015October 18, 2015.
Lab 04.
Structural Modeling. Objectives O Understand the rules and style guidelines for creating CRC cards, class diagrams, and object diagrams. O Understand.
Behavioral Modeling: Sequence and Communication Diagrams Copyright © 2009 John Wiley & Sons, Inc. Copyright © 2005 Pearson Education Copyright © 2009 Kannan.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
1 © Prentice Hall, 2002 Chapter 14: Object-Oriented Data Modeling Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B. Prescott, Fred R.
© 2011 Pearson Education 1 Chapter 13 (Online): Object-Oriented Databases Modern Database Management 10 th Edition, International Edition Jeffrey A. Hoffer,
Systems Analysis & Design 7 th Edition Chapter 5.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
Systems Analysis and Design 8 th Edition Chapter 6 Object Modeling.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
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.
PowerPoint Presentation for Dennis & Haley Wixom, Systems Analysis and Design, 2 nd Edition Copyright 2003 © John Wiley & Sons, Inc. All rights reserved.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 3rd Edition Copyright © 2009 John Wiley & Sons, Inc. All rights.
CIS 112 Exam Review. Exam Content 100 questions valued at 1 point each 100 questions valued at 1 point each 100 points total 100 points total 10 each.
Object-Oriented Data Modeling
Design Model Lecture p6 T120B pavasario sem.
Design CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College Copyright © 2009 John Wiley & Sons, Inc. Copyright © 2008 Course.
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.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Slide 1 Systems Analysis and Design With UML 2.0 An Object-Oriented Approach, Second Edition Chapter 2: Introduction to Object-Oriented Systems Analysis.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Modeling the Static Structure: Relationships ©SoftMoore ConsultingSlide 1.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Object-Oriented Systems Analysis and Design Using UML Systems Analysis and Design,
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
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.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Activity Diagrams Copyright © 2009 John Wiley & Sons, Inc. Copyright © 2005 Pearson Education Copyright © 2009 Kannan Mohan CIS 4800 Kannan Mohan Department.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
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.
Cmpe 589 Spring 2006.
Object-Oriented Modeling
DATA REQIREMENT ANALYSIS
Object-Oriented Modeling with UML
The Object-Oriented Thought Process Chapter 1
Object Orientation Yaodong Bi, Ph.D. Department of Computer Sciences
Domain Class Diagram Chapter 4 Part 2 pp
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Copyright 2007 Oxford Consulting, Ltd
From Class Diagram to Contract Diagram
Presentation transcript:

Structural Modeling: Class Diagrams Copyright © 2009 John Wiley & Sons, Inc. Copyright © 2005 Pearson Education Copyright © 2009 Kannan Mohan CIS 4800 Kannan Mohan Department of CIS Zicklin School of Business, Baruch College

Classes, Attributes, & Operations Classes Templates for instances of people, places, or things Attributes Properties that describe the state of an instance of a class (an object) Operations Actions or functions that a class can perform

Rules of Thumb Limited responsibilities and collaboration – About 3 to 5 responsibilities No class stands alone Watch out for – – Too many small classes or too few large classes – Deep inheritance trees – 3 or more levels – Functoids – Too many classes with ‘DoIt’ methods – normal procedural function disguised as a class – Omnipotent classes – such as ‘system’ or ‘controller’

Finding Analysis Classes Noun/verb analysis on documents CRC card analysis

Front-Side of a CRC Card

Back-Side of a CRC Card

More Elements of Class Diagrams

Association Example

Multiplicity How many instances of one class may relate to a single instance of an associated class at any point in time? 1..1, 1..n, 0..n, etc.

Multiplicity Company employs many persons A person is employed by one company Are these reasonable constraints? Depends on the system and requirements Documents business rules

Navigability Messages sent in the direction of the arrow Company sends messages to Person CompanyPerson 11..* employs OrderProduct 1..* Not navigable A Product object does not store a list of Orders An Order object stores a list of Products Navigable sourcetarget navigability

Association Class CompanyPerson 1..* employs CompanyPerson 1..* Job salary:double the association class consists of the class, the association and the dashed line association class CompanyPerson Job salary:double **11

Association Class Example

Reflexive/Recursive Associations A class is associated with itself Manager/Subordinate – “Role” names Works for

Aggregation Part-whole’ relationship – Engine is ‘a part of’ car – Chassis is ‘a part of’ car A special form of association Composition – Parts live inside the whole and are destroyed if the whole is destroyed Shared aggregation – Parts can become parts of different wholes (Team - persons)

Generalization / Specialization

Abstract Classes Methods are not implemented, only signatures are specified They are implemented in specialized sub-classes Cannot create instances of abstract classes Those classes to which you can create instances of, are called as concrete classes Draw method does not have an implementation in the super class Why do we need this? Interface uniformity among sub-classes

Levels of Abstraction What is wrong with this model? Vehicle JaguarXJSTruck

Polymorphism Many forms A polymorphic operation has many implementations What about overriding concrete operations? Shape draw( g : Graphics ) getArea() : int getBoundingArea() : int SquareCircle draw( g : Graphics ) getArea() : int draw( g : Graphics ) getArea() : int polymorphic operations concrete subclasses abstract superclass Canvas * 1 A Canvas object has a collection of Shape objects where each Shape may be a Square or a Circle shapes

Multiple Inheritance In single inheritance we discriminated based on one attribute (say type of transaction – cash, credit and check) In Multiple inheritance we discriminate based on more than one attribute Sales Manager inherits properties and methods from both Sales staff and Manager

Best Practices Favor object composition over class inheritance – White box reuse/inheritance vs. black box reuse/composition – Encapsulation and interfaces respected in composition Design to an interface, not to an implementation – Commit to an interface defined by the abstract class (Gamma et al, 1994)

Comparing Traditional and OO: Traditional Viewpoint Focus on procedures Functionality is vested in procedures (modules) Data and Procedures separated Data exist to be operated upon by procedures Procedures know about the structure of data Responsibility of what can be done to a piece of data is implicit

Traditional View – An Example If CUST.credit > CUST.balance ORD.status = “Approved” else ORD.status=“Not Approved” CUST ORD PRODUCT DEPT Procedure Data

Object-Oriented View – An Example CUSTOMER If Balance < Limit Status = “Good” Else Status = “bad” ORDER If Answer= “Good” Self.status= “Approved” Else Self.status=“Not Approved” What is your credit status? Good

How many classes?

Summary How do we identify classes, relationships, attributes, and behavior for a given case? What are different types of relationships? What is multiplicity and how do we specify it? How do we create a domain class diagram using a CASE tool? Explain the following: – Class, object, message, method What is abstraction? What is encapsulation and why is it important?