Distributed Java Programming 107-198 Distributed Java Programming Class #2 August 22, 2002.

Slides:



Advertisements
Similar presentations
Object-oriented modeling Class/Object Diagrams
Advertisements

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.
Lecturer: Sebastian Coope Ashton Building, Room G.18 COMP 201 web-page: Lecture.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
UML – Class Diagrams.
Essentials of interaction diagrams Lecture Outline Collaborations Interaction on collaboration diagrams Sequence diagrams Messages from an object.
7M701 1 Class Diagram advanced concepts. 7M701 2 Characteristics of Object Oriented Design (OOD) objectData and operations (functions) are combined 
IMSE 11 - UML Class Diagrams
7M822 UML Class Diagrams advanced concepts 15 September 2008.
Sharif University of Technology1 Design and Use-case Realization Software Engineering Laboratory Fall 2006.
Systems Analysis and Design in a Changing World, 6th Edition
7M822 UML Class Diagrams advanced concepts 14 October 2010.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
CET203 SOFTWARE DEVELOPMENT Session 1B Modelling and the Theory of Inheritance.
PRJ566: PROJECT PLANNING AND MANAGEMENT Class Diagrams.
Unified Modeling Language
Unified Modeling Language
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
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.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 8 Slide 1 Chapter 9 Structuring System Data Requirements.
Presented by: CHAN LAI SAN ( ) REBAH DAW SARREB ( ) FIDA AL-OBAISI ( ) 08 April 2008 (Tuesday 6pm – 7:30pm)
Object-Oriented Modeling Chapter 10 CSCI CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships.
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.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
CS3773 Software Engineering Lecture 04 UML Class Diagram.
Introduction to UML: Unified Modeling Language Ric Holt U Waterloo, March 2009 CS246.
12 September, 2007Information System Design IT60105, Autumn 2007 Information System Design IT60105 Lecture 11 Class and Object Diagrams.
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.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Class and Sequence diagrams UML notation SE-2030 Dr. Mark L. Hornick 1.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Object Oriented Analysis and Design Class and Object Diagrams.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Object-Oriented Analysis and Design CHAPTERS 9, 31: DOMAIN MODELS 1.
UML: A notation for capturing work products
CS212: Object Oriented Analysis and Design Lecture 33: Class and Sequence Diagram.
UML Class Diagram notation Indicating relationships between classes SE-2030 Dr. Mark L. Hornick 1.
Chapter 4 Basic Object-Oriented Concepts. Chapter 4 Objectives Class vs. Object Attributes of a class Object relationships Class Methods (Operations)
Class diagrams Terézia Mézešová.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
UML Fundamental Elements. Structural Elements Represent abstractions in our system. Elements that encapsulate the system's set of behaviors. Structural.
BTS430 Systems Analysis and Design using UML Design Class Diagrams (ref=chapter 16 of Applying UML and Patterns)
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
Distributed Java Programming Distributed Java Programming Class #1 August 20, 2002.
Introduction to Unified Modeling Language (UML) By Rick Mercer with help from The Unified Modeling Language User Guide, Grady Booch, James Rumbaugh, Ivar.
Software Modelling Class Diagram. Class Diagrams The main building block in object oriented modeling They are used both for general conceptual modeling.
UML Diagrams: Class Diagrams The Static Analysis Model
Object-Oriented Modeling
Business System Development
Unified Modeling Language
UML Class Diagrams (more notation)
Introduction to Unified Modeling Language (UML)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Object Oriented Analysis and Design
Domain Class Diagram Chapter 4 Part 2 pp
Software Engineering Lecture #11.
Systems Analysis and Design With UML 2
UML Class Diagram.
Introduction to Unified Modeling Language (UML)
Copyright 2007 Oxford Consulting, Ltd
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Object Oriented System Design Class Diagrams
UML  UML stands for Unified Modeling Language. It is a standard which is mainly used for creating object- oriented, meaningful documentation models for.
Presentation transcript:

Distributed Java Programming Distributed Java Programming Class #2 August 22, 2002

Distributed Java Programming Agenda  Quick Review of Use Case Analysis  Class Diagrams  Simple Class Diagrams  Generalization (Inheritance)  Associations  Aggregation and Composition  Constraints  Packages  Sequence Diagrams

Distributed Java Programming What is a Class Diagram?  Attributes  Methods  Access levels of the said properties and methods.  Relationships that exist between object:  Associations  Inheritance A class diagram captures information about the objects that will be used in a in system. Specifically a class diagram captures information about an Objects attributes and properties:

Distributed Java Programming The Basic Object

Distributed Java Programming Access Levels + Public - Private # Protected

Distributed Java Programming Inheritance, Abstract Classes, Interfaces  Concrete and abstract classes you are extending functionality.  Interfaces – You are implementing functionality.  These notations capture generalization. The “is a” relationship between objects.

Distributed Java Programming Associations, Multiplicity and Navigability  A customer accesses one or more accounts.  An account contains zero or more transactions.  Transactions is only be navigable from Accounts.

Distributed Java Programming Associations  Associations are a means of representing relationships that exist between classes.  Captures “has a” relationships between objects.  Associations capture the multiplicity (sometimes referred to as the cardinality) between classes  An association can have names to help clarify the relationship between object instances.  Association ends can also have more human readable names (called roles) at each end of the association.

Distributed Java Programming Multiplicity  Multiplicity is very much like the concept of cardinality in an Entity-Relationship model.  0..1  1..1  10  0..*  When you are doing your modeling make sure you have methods that reflect the association being modeled.  Usually presence of multiplicity will be implemented by having a Java collection object in the class containing references to the children objects.

Distributed Java Programming Navigability  Used to enforce how and when objects are accessed.  Can be bi-directional. In the case of a bi- directional relationship an Order can see all of its line items, but each line item has a method that can be used to return back to original item.  Clearly marking associations, multiplicity and navigability in your diagram can significantly improve the readability of code.  It also makes for more complete code generation.

Distributed Java Programming Aggregation and Composition  Associations show relationships between objects in a system.  There are tighter forms associations:  Aggregation - Aggregation represents an object is “part-of” something. A good example of aggregation would be a car. A car could be considered an object that is made up of many other objects (engine, transmission, wheels).  Composition – Composition is a much stronger form of aggregation. The part object can not exist outside of the whole. For instance an account is made up of 0 or more transactions. However, a transaction can not exist outside the concept of an account. (I.E. I delete an account object, I also have to delete all of its transaction objects)

Distributed Java Programming Aggregation and Composition Examples In the above diagram we are showing two things:  To a bank a customer is composed of one or more accounts. To make the model stretch we could say that an account could belong to more than one customer (joint accounts, business partners, etc…) The open triangle represents composition.  With transactions we show aggregation. Here we say a transaction is part of an account, but it can not belong to more than one account.

Distributed Java Programming Constraints  A constraint is a simple notation in the diagram that demonstrates an important business rule that must be enforced.  Constraints often match the pre and post conditions defined in our use cases.  Do no go overboard with applying constraints. They should only be used for important, noteworthy events. Otherwise the class diagram gets to muddied.

Distributed Java Programming Granularity  Often times large class diagrams can be overwhelming.  UML provides a notation that allows you to group classes together into higher levels of units that are more understandable.  This notation is called a package in UML.

Distributed Java Programming Package Diagram  Packages hide details.  They capture dependencies. The above diagram shows that changes in package B might require changes in package A.  When generating code, packages are used to translate into Java class packages.

Distributed Java Programming In Summary  Use the 80% for object modeling.  Do not overanalyze.  The more detail you do catch in your model, the more the code will generate for you.  A class diagram is a living document, keep it up to date or it becomes useless.

Distributed Java Programming Tonight’s Lab The class will break into four groups. Each group will build a class diagram with properties and methods for a customer and their accounts.  Install Poseidon UML  Demonstrate Inheritance in your model  Properly capture the associations, multiplicity and navigability.  Generate source code and look at the results.

Distributed Java Programming Resources Martin Fowler UML Distilled Second Edition Safari.informit.com Poseidon UML UML Resource Center