Kate Gregory Week 5 Static Object Model –Attributes –Methods –Associations –Visibility Lab 3 available –Rating your group.

Slides:



Advertisements
Similar presentations
Week 2 Concepts normally in week 1 Software Development Life Cycle Use Cases Lab project Lab 1 Kate Gregory.
Advertisements

UML Class Diagram. UML Class Diagrams2 Agenda What is a Class Diagram? Essential Elements of a UML Class Diagram Tips.
Kate Gregory1 Week 3 Lab 1 due now Finding Classes in your System CRC Cards Collaboration Diagrams Lab 2.
UML Class Diagram and Packages Written by Zvika Gutterman Adam Carmi.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 14 (Web): Object-Oriented Data Modeling
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.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
Class Diagram & Object Diagram
Marcelo Santos – OOAD-CDT309, Spring 2008, IDE-MdH 1 Object-Oriented Analysis and Design - CDT309 Period 4, Spring 2008 Object-oriented concepts.
Object-Orientated Design Unit 3: Objects and Classes Jin Sa.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 Class and Object Diagrams PRACTICAL OBJECT-ORIENTED DESIGN WITH.
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Lecture a: Additional UML Models: Package, Activity, Deployment Lecture b: Generalization, Aggregation and Additional Domain Model Notation Copyright W.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
Chapter 14: Object-Oriented Data Modeling
Chapter 3 Data Modeling Using the Entity- Relationship (ER) Model Dr. Bernard Chen Ph.D. University of Central Arkansas.
Data Modeling Using the Entity-Relationship Model
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.
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.
Introduction to Sequence Diagrams
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
PowerPoint Presentation for Dennis, Wixom, & Tegarden Systems Analysis and Design with UML, 4th Edition Copyright © 2012 John Wiley & Sons, Inc. All rights.
Presented by: CHAN LAI SAN ( ) REBAH DAW SARREB ( ) FIDA AL-OBAISI ( ) 08 April 2008 (Tuesday 6pm – 7:30pm)
UML Diagrams: Class Diagrams The Static Analysis Model Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
CSC 395 – Software Engineering Lecture 13: Object-Oriented Analysis –or– Let the Pain Begin (At Least I’m Honest!)
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
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.
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.
Unit 1 INTRODUCTION TO MODELING AND CLASS MODEL Ref : L7-UML.PDF.
Kate Gregory1 Week 4 Lab 2 due now Why document? Unified Modeling Language Class diagrams.
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.
The Static Analysis Model Class Diagrams Prof. Hany H. Ammar, CSEE, WVU, and Dept. of Computer Science, Faculty of Computers and Information, Cairo University.
Kate Gregory Week 10 State diagrams Activity Diagrams Summary and Conclusion / The Future Critique discussion Lab 4 is marked.
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.
Initial Design of Entity Types for the COMPANY Database Schema Based on the requirements, we can identify four initial entity types in the COMPANY database:
5 Systems Analysis and Design in a Changing World, Fifth Edition.
Week 9 Lab 4 due now Design Patterns Good Design Modules and Packages –Deployment diagram –Component diagram SOLID Principles Metrics Lab 5 available –
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.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved COS240 O-O Languages AUBG,
Kate Gregory Week 8 Midterm discussion Interaction / Sequence Diagrams Design Patterns RAII Lab 4.
Design Model Lecture p6 T120B pavasario sem.
Kate Gregory Week 6 Lab 3 due now –Rating your group Inheritance Multiple Inheritance Polymorphism Midterm Review.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
 Week08.  Review Schedule Weeks 8-14  This week o Review last class o Introduce Class Diagrams o ICE-03 Sheridan SYST Engineering Quality Systems.
Introduction to UML CS A470. What is UML? Unified Modeling Language –OMG Standard, Object Management Group –Based on work from Booch, Rumbaugh, Jacobson.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
advanced data modeling
12 OBJECT-ORIENTED DESIGN CHAPTER
Identifying Object Relationships, Attributes, and Methods
1 Introduction to Classes. 2 Terms and Concepts A class is... –The most important building block of any object- oriented system. –A description of a set.
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
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.
Inf 43: Introduction to Software Engineering May 7, 2016.
Data Modeling Using the Entity- Relationship (ER) Model
Object-Orientated Analysis, Design and Programming
UML Diagrams: Class Diagrams The Static Analysis Model
Object-Oriented Modeling
Visit for more Learning Resources
Chapter 5: Structural Modeling
Reference: COS240 Syllabus
OBJECT RELATIONSHIPS, ATTRIBUTES, AND METHODS
UML Class Diagram.
Information System Design
Presentation transcript:

Kate Gregory Week 5 Static Object Model –Attributes –Methods –Associations –Visibility Lab 3 available –Rating your group

See Me Send me if you did not hand in Lab 1 or 2 –Include your full name –Tell me what group you have joined Hands up now –if you are not in a group –if you are in a group of 1 or 2 Kate Gregory2

DateWeekTopicHand OutDue BackTest 6-Sep-131Administrivia / Overview / Motivation, benefits of OO 13-Sep-132Use CasesLab 1: Use cases 20-Sep-133CRC Cards, collab graphsLab 2: CRC cardslab 1 5% 27-Sep-13 4start class diaglab 2 5% 4-Oct-135Finish class diag, AssociationsLab 3: Class Diag 11-Oct-136Inh & Polymorphism / midterm reviewlab 3 5% 18-Oct-137midtermMidterm 25% 25-Oct-13Reading Break 1-Nov-138Interaction diag / Design PatternsLab 4: Interaction Diag 8-Nov-139Good Design / Modules & Packages / Deployment and component diagrams /Metrics / SOLID Lab 5: Critiqueslab 4 5% 15-Nov-1310State diagrams / Activity diagrams / Summary and Conclusion / The Future 22-Nov-1311Critiquescritique lab (before class) 15% 29-Nov-1312Critiques TBDFinal ExamFinal 40%

Kate Gregory Current car: Car Objects are not Attributes On a class diagram, do not list attributes that are objects. Every person has a car, but not: Person Date of birth: Date travel () Current car: Car

Kate Gregory Associations A reference from one class to another is an association. Most relationships between classes are associations. –A person has a car. –An employee reports to a supervisor –An invoice is filled with items

Kate Gregory Objects are not Attributes Person Date of birth: Date travel () Car Mileage: int has

Kate Gregory Guidelines For Identifying Associations Association often appears as a verb in a problem statement and represents relationships between classes. –A pilot flies a plane. –A manager approves a transaction Other phrases include part of, next to, works for, contained in, etc. Verbs help to qualify an association, links for passing messages

Kate Gregory Common Association Patterns Location Association: next To, part of, contained in, ingredient of etc. –each employee is part of a department. Communication association: talk to, order to. –a customer places an order with an operator.

Kate Gregory Binary Association Notation On a class diagram, binary association is a line connecting two classes Both ends may be connected to the same class

Kate Gregory Links to pass Messages Listing Description MLS Agent Phone No writeInfo()

Kate Gregory Multiplicity Multiplicity specifies the number of instances of associated classes for each instance of this class. It is given for roles within associations, parts within compositions, repetitions, and other purposes. A number or range of numbers is written on each end of the line –lower bound.. upper bound. (0..1, 2..5 etc) –Single number (0, 1, etc) –* to indicate any number including 0 –1..* to indicate 1 and up

Kate Gregory Single Multiplicity Exactly one province for each city.

Kate Gregory Unlimited Multiplicity Sometimes there is no limit on the number of objects in the association. Any number of cities in a province

Kate Gregory Fixed Multiplicity Sometimes a object must be associated with a fixed number of other objects obvious or business rules state limited number (2 teams, 4 agents)

Kate Gregory Range of Multiplicity The most common range is 0 to 1: a single optional value The person either has an employer or does not: in this model no-one has more than one employer

Kate Gregory Range of Multiplicity Another popular range is 1 or more, represented as 1..*

Kate Gregory Range of Multiplicity Other than 0 to 1 and 1 or more, ranges are unusual. –A car has 2 to 5 doors… OK, but is “car door” likely to be an object? –A person has 0 to 5 credit cards… why can’t someone have 6? Push back when customers tell you ranges for relationships; make sure there’s a real business reason for the restriction and not some leftover from legacy software that couldn’t model reality

Kate Gregory Qualified Associations Sometimes multiplicity alone can’t describe the restrictions on a relationship –How many bank accounts does a customer have with each bank? –Can two of a customer’s accounts have the same number? As long as they’re with different banks

Kate Gregory Qualifier Bank Person account# *.

Kate Gregory OR Association An OR association indicates a situation in which only one of several potential associations may be in effect at one time for any single object. Person Company Car {or}

Kate Gregory Some Attributes Are Hard To Place Consider Company and Person –Person works for company –Where does the salary attribute go? Company? –Everyone makes the same salary Person? –All my jobs pay the same Salary is an attribute of the relationship

Kate Gregory Association Class An association class holds properties of the association An association class is shown as a class symbol attached by a dashed line to an association path. WorksFor Person employeremployee Company salary

Kate Gregory Association Class Association class is like a normal class with attributes and methods Adds extra information to the link House for SaleAgent Contract Expirydate commission

Kate Gregory Eliminate Unnecessary Associations Derived associations can be defined in terms of other associations. They are redundant; avoid.

Kate Gregory Eliminate Unnecessary Associations Implementation association. Defer implementation- specific associations to the design phase. –For example, if inventory is implemented by using an Array class, don’t show that relationship. Only show business relationships as determined by your analysis Ternary associations. Ternary or n-ary association is an association among more than two classes. Avoid. –Replace with a new class

Kate Gregory N-Ary Association Association among more than two classes. Difficult to understand GradeBook Student Course grade exam lab Year semester * * *

Kate Gregory Convert N-Ary Associations Create a class to represent the relationship GradeBook Student Course lab grade exam Year Session * * * *

Kate Gregory Association Class Replaces N-Ary House for SaleAgent Contract Expirydate commision Client * *

Kate Gregory Aggregation is a form of association representing a “part of” relationship. For example, players are part of a team. A hollow diamond is attached to the end of the path to indicate aggregation. “there is no single accepted definition of the differences between aggregation and association”, Fowler, UML Distilled, 1997 Aggregation

Kate Gregory Composition Composition is a form of aggregation with strong ownership to represent a component of a complex object. The “part” may belong to only one whole. –Compare a picture pasted into a Word document (composition) to a picture on a web page (aggregation) Cascading Destruction – can the part exist without the whole ? –A customer has a credit card. –A customer has a sales rep. –A window on the screen has a title, a scroll bar, menus, frame and so on.

Kate Gregory Composition Notation The UML notation for composition is a solid diamond at the “container” end of a path. Window TitleScroll barMenuFrame *

Kate Gregory Composition House for Salepicture

Kate Gregory Classes without Associations Sometimes a class is sitting all alone on the diagram Check the CRC cards –Collaborations generally can’t happen if objects can’t find each other –Those connections are associations –Sometimes connections are temporary, so don’t create an association –Think about the relationships between the real things these classes represent Look for words like “has”, “uses”, “owns”, “contains” A class without associations does not always need to be dropped –Another layer (e.g. user interface) may use it –Ask yourself if it’s really something in your system

Kate Gregory Cohesion and Coupling Only certain classes need to know about other classes -- this is coupling. The lower the coupling (number of connecting lines between classes) the better. Certain information should reside in the same location (class) – this is cohesion and makes classes self-sufficient. The higher cohesion, the better More on these in our metrics section later. Start to think about whether the classes you are shown exhibit high or low cohesion, and are tightly or loosely coupled.

Kate Gregory35 Remember what class diagrams are for Reference –Names of classes –Names of methods –Parameters to methods –Names of attributes Excellent summary of decisions Visual understanding of the system

Kate Gregory Next Week Inheritance Lab 3 Due –Think about concurrency issues –Rate your group members Read ahead if you like