Smith’s Aerospace © P. Bailey & K. Vander Linden, 2006 Classes and Objects Patrick Bailey Keith Vander Linden Calvin College.

Slides:



Advertisements
Similar presentations
Stereotypes Stereotypes provide the capability to create a new kind of modeling element. –They can be used to classify or mark modeling elements. –A type.
Advertisements

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.
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
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
Object-Oriented Analysis and Design
Chapter 14: Object-Oriented Data Modeling
Dilbert © United Feature Syndicate, Inc.. © Keith Vander Linden, Analysis ● Principles Principles ● Specification Specification – Unified modeling.
UML Unified Modeling Language. What is UML? Unified Modeling Language (UML) is a standardized, general-purpose modeling language in the field of software.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Architecture: Component and Deployment Diagrams Patrick Bailey Keith Vander Linden Calvin College.
Page 1 What is the UML? UML stands for Unified Modeling Language The UML combines the best of the best from – Data Modeling concepts (Entity Relationship.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2006 The Unified Modeling Language Patrick Bailey Keith Vander Linden Calvin College.
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.
Databases : Data Modeling 2007, Fall Pusan National University Ki-Joune Li.
© 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.
Chapter 16 Applying UML and Patterns Craig Larman
1 Class Diagrams: The Essentials. 2 Terms and Concepts A class is... The most important building block of any object-oriented system. A description of.
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.
UML The Unified Modeling Language A Practical Introduction Al-Ayham Saleh Aleppo University
What is Object-Oriented?  Organization of software as a collection of discreet objects that incorporate both data structure and behavior.
Object-Oriented Data Modeling
Design Model Lecture p6 T120B pavasario sem.
Object Oriented Analysis: Associations. 2 Object Oriented Modeling BUAD/American University Class Relationships u Classes have relationships between each.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Chapter 4 Extended Entity-Relationship (EER)Model Incorporates Set-subset Relationships Incorporates Generalization Hierarchies Constraints: Coverage Constraints:
Class diagrams Terézia Mézešová.
Chapter 16 UML Class Diagrams 1CS6359 Fall 2012 John Cole.
Chapter 16 UML Class Diagrams.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
CSCI 3428: Software Engineering Tami Meredith UML Unified Modeling Language.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Procedural Activity Patrick Bailey Keith Vander Linden Calvin College.
Object-Oriented Software Engineering Practical Software Development using UML and Java Modelling with Classes.
1 ODB Design Handling Inheritance in ODL M. Akhtar Ali School of Informatics.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Class Diagrams Revisited. Parameterized Classes Parameterized Classes - are used to represent relationships between templates.
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.
Unified Modeling Language (UML)
UML Diagrams: Class Diagrams The Static Analysis Model
Object-Oriented Modeling
Business System Development
DATA REQIREMENT ANALYSIS
The Movement To Objects
Object-Oriented Analysis and Design
Class Diagrams.
Systems Analysis and Design With UML 2
Software Architecture & Design Pattern
UML UML Data Modeling.
UML Class Diagrams: Basic Concepts
UML Diagrams: The Static Model Class Diagrams
Object Oriented Analysis and Design
Object Oriented Analysis and Design
Lec 3: Object-Oriented Data Modeling
Software Engineering Lecture #11.
Chapter 20 Object-Oriented Analysis and Design
Appendix A Object-Oriented Analysis and Design
Understand and Use Object Oriented Methods
Systems Analysis – ITEC 3155 Modeling System Requirements – Part 2
Copyright 2007 Oxford Consulting, Ltd
Object Oriented System Design Class Diagrams
Appendix A Object-Oriented Analysis and Design
The generalization of class
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:

Smith’s Aerospace © P. Bailey & K. Vander Linden, 2006 Classes and Objects Patrick Bailey Keith Vander Linden Calvin College

Smith’s Aerospace © P. Bailey & K. Vander Linden, Classes and Objects ● Objects are entities that have attributes, behavior and state. ● Classes are sets of objects with common properties and behavior. ● Classes and their interrelationships implement the 3 key elements of object- oriented programming:

Smith’s Aerospace © P. Bailey & K. Vander Linden, Class and Object Diagrams ● Rhapsody combines classes and objects into a single object model diagram. ● Class diagrams: – Are the most common UML diagram – Model classes and the static relationships between them ● Object diagrams: – Model a snapshot of the system objects at some time

Smith’s Aerospace © P. Bailey & K. Vander Linden, Example: Class Diagram Example adapted from Fowler, 2003

Smith’s Aerospace © P. Bailey & K. Vander Linden, Outline ● Class Diagrams – Classes Classes – Relationships Relationships ● Object Diagrams Object Diagrams ● UML Profiles UML Profiles ● Class Diagrams and Code Class Diagrams and Code ● Using Object Model Diagrams Using Object Model Diagrams

Smith’s Aerospace © P. Bailey & K. Vander Linden, Classes ● Classes to model entities in the domain. ● One way to discover classes is to identify noun phrases in domain narratives or descriptions. ● Classes have two features: – Attributes – Operations

Smith’s Aerospace © P. Bailey & K. Vander Linden, Attributes ● Attributes describe properties of classes. ● Syntax: visibility name: type multiplicity = default {property-string}

Smith’s Aerospace © P. Bailey & K. Vander Linden, Classes vs. Attributes ● Not all “entities” should be modeled as classes. ● Classes tend to have: – retained or persistent attributes – multiple attributes – common attributes ● Attributes tend not to have these characteristics.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Operations ● Operations describe services that class objects can perform. ● Operation syntax: visibility name (parameter-list): return-type {property-string} ● Parameter syntax direction name: type = default-value

Smith’s Aerospace © P. Bailey & K. Vander Linden, Relationships ● Relationships link classes together. ● UML supports three types of inter-class relationships: – Association – Generalization – Dependency

Smith’s Aerospace © P. Bailey & K. Vander Linden, Association Associations indicate communication between class objects, with features: – Multiplicity – Directionality – Association Type

Smith’s Aerospace © P. Bailey & K. Vander Linden, Attributes vs. Associations ● Attributes and associations: – both represent structural properties of classes – are presented differently in class diagrams ● Use association to represent relationships between more significant classes. ● Use attributes to represent primitive properties and less significant classes.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Multiplicity ● Association relationships indicate how many objects may fill the property. ● They are specified with min..max on both participants in the relationship.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Directionality ● Associations can be: – Uni-directional – Bi-directional ● Directions can be shown with arrows.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Types of Associations Association relationships can have specialized forms: – Aggregation – Composition

Smith’s Aerospace © P. Bailey & K. Vander Linden, Generalization ● Generalization indicates that all sub-class objects must also be super-class objects. ● Don’t overuse it. ● Distinguish: – Generalization – Classification

Smith’s Aerospace © P. Bailey & K. Vander Linden, Dependency ● A dependency indicates that changes to one class will require changes to another. ● There are a number of different types of dependencies.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Interfaces and Abstract Classes UML provides a short-hand notation for interface dependencies.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Classes and Objects ● UML specifies both: – Class diagrams – Object diagrams ● Object diagrams represent snapshots of the system objects at some time. ● Rhapsody combines the two diagram types into a single Object Model Diagram.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Example Example adapted from Douglass, 2004

Smith’s Aerospace © P. Bailey & K. Vander Linden, UML and Real-Time Systems ● Profiles specialize UML using: – Stereotypes – Tagged values ● The OMG has approved profiles for: – Quality of service – Schedulability, performance and time

Smith’s Aerospace © P. Bailey & K. Vander Linden, Example Example adapted from Douglass, 2004

Smith’s Aerospace © P. Bailey & K. Vander Linden, UML and Data Modeling ● Relational databases are frequently modeled using non-object-oriented languages (e.g., ERDs). ● UML Class diagrams can model OO databases.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Example

Smith’s Aerospace © P. Bailey & K. Vander Linden, Code Generation UML tools help you link UML models with generated code: – Code generation – Reverse engineering – Round-trip engineering

Smith’s Aerospace © P. Bailey & K. Vander Linden, Example

Smith’s Aerospace © P. Bailey & K. Vander Linden, Reverse Engineering ● Reverse engineering UML class diagrams works pretty well for object-oriented code. ● It’s less effective for non-object-oriented code.

Smith’s Aerospace © P. Bailey & K. Vander Linden, Using Object Model Diagrams ● Class diagrams are very common. ● Don’t feel that you must: – Model everything – Use all of the language features ● Don’t forget to build behavioral models.