Introduction to Object Orientation: in UML flavors. Fall 2004, CSC532

Similar documents
11 November

Using UML Part One Structural Modeling Diagrams

Analysis and Design with UML

Umbrello UML Modeller Handbook

How To Design Software

LAB 3: Introduction to Domain Modeling and Class Diagram

Lectures 2 & 3: Introduction to Modeling & UML. Getting started

Object Oriented Design

Chapter 8 The Enhanced Entity- Relationship (EER) Model

ATM Case Study OBJECTIVES Pearson Education, Inc. All rights reserved Pearson Education, Inc. All rights reserved.

Unit I Page No. 1 System Development Object Basics Development Life Cycle Methodologies Patterns Frameworks Unified Approach UML

History OOP languages Year Language 1967 Simula Smalltalk

Use Case Diagrams. Tutorial

An Introduction To UML Class Diagrams Classes

Software Project Management and UML

UML Tutorial: Part 1 -- Class Diagrams.

Tutorial - Building a Use Case Diagram

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

a. Inheritance b. Abstraction 1. Explain the following OOPS concepts with an example

Software Development in the Large!

Questions? Assignment. Techniques for Gathering Requirements. Gathering and Analysing Requirements

Software Engineering. System Models. Based on Software Engineering, 7 th Edition by Ian Sommerville

How To Develop Software

CS 487. Week 8. Reference: 1. Software engineering, roger s. pressman. Reading: 1. Ian Sommerville, Chapter 3. Objective:

Object-Oriented Systems Analysis and Design

Graphical Systems Modeling with UML / SysML Class diagrams

CSCI 253. Object Oriented Programming (OOP) Overview. George Blankenship 1. Object Oriented Design: Java Review OOP George Blankenship.

Concepts of Database Management Seventh Edition. Chapter 9 Database Management Approaches

2. Conceptual Modeling using the Entity-Relationship Model

OOP? What is OOP? Why? OOP in a nutshell. Stéphane Ducasse 2.1

Software Design Document (SDD) Template

Architecture. Reda Bendraou

Visio Tutorial 1BB50 Data and Object Modeling (DOM) How to make a UML Class Diagram 2004/2005

Object Oriented Software Models

Introduction to Programming Block Tutorial C/C++

System Modeling / Class Diagra Diagr m a Week 6

UML Class Diagrams. Lesson Objectives

Use Cases. Massimo Felici. Massimo Felici Use Cases c

Java (12 Weeks) Introduction to Java Programming Language

Object Oriented Programming. Risk Management

SERVICE-ORIENTED MODELING FRAMEWORK (SOMF ) SERVICE-ORIENTED SOFTWARE ARCHITECTURE MODEL LANGUAGE SPECIFICATIONS

High-level Design. What is software architecture?

UML PROFILING AND DSL

Managing Variability in Software Architectures 1 Felix Bachmann*

Applying Object-Oriented Principles to the Analysis and Design of Learning Objects

Software Development: An Introduction

Chap 1. Introduction to Software Architecture

Software Testing. Definition: Testing is a process of executing a program with data, with the sole intention of finding errors in the program.

IRA 423/08. Designing the SRT control software: Notes to the UML schemes. Andrea Orlati 1 Simona Righini 2

Chapter 2: Entity-Relationship Model. Entity Sets. " Example: specific person, company, event, plant

CSC 742 Database Management Systems

Aspects of Lyee Configuration Management

Types of UML Diagram. UML Diagrams OOAD. Computer Engineering Sem -IV

Chapter 2: Entity-Relationship Model. E-R R Diagrams

11 Tips to make the requirements definition process more effective and results more usable

How to make a good Software Requirement Specification(SRS)

(Refer Slide Time 00:56)

Decomposition into Parts. Software Engineering, Lecture 4. Data and Function Cohesion. Allocation of Functions and Data. Component Interfaces

Data Modeling Basics

AWS Service Catalog. User Guide

Adapted for a textbook by Blaha M. and Rumbaugh J. Object Oriented Modeling and Design Pearson Prentice Hall, 2005.

Enterprise Architecture Modeling PowerDesigner 16.1

Detecting Defects in Object-Oriented Designs: Using Reading Techniques to Increase Software Quality

Monfort College of Business Semester Course Syllabus ( )

Object-Oriented Data Modeling

Getting Started With UML Class Modeling. An Oracle White Paper May 2007

3SL. Requirements Definition and Management Using Cradle

Use-Case Analysis. ! What is it? ! From where did it come? ! Now part of UML

Patterns in. Lecture 2 GoF Design Patterns Creational. Sharif University of Technology. Department of Computer Engineering

BCS HIGHER EDUCATION QUALIFICATIONS Level 6 Professional Graduate Diploma in IT. March 2013 EXAMINERS REPORT. Software Engineering 2

ER modelling, Weak Entities, Class Hierarchies, Aggregation

Software Architecture Document

How to Make a Domain Model. Tutorial

Service Oriented Architecture

Announcements. SE 1: Software Requirements Specification and Analysis. Review: Use Case Descriptions

III. Class and Object Diagrams

Agile Business Suite: a 4GL environment for.net developers DEVELOPMENT, MAINTENANCE AND DEPLOYMENT OF LARGE, COMPLEX BACK-OFFICE APPLICATIONS

Business Process Modeling with Structured Scenarios

SOMA, RUP and RMC: the right combination for Service Oriented Architecture

Structural Modeling and Analysis

Universität Karlsruhe (TH) Forschungsuniversität gegründet Inheritance Depth as a Cost Factor in Maintenance

Case studies: Outline. Requirement Engineering. Case Study: Automated Banking System. UML and Case Studies ITNP090 - Object Oriented Software Design

Electronic Healthcare Design and Development

Generating Aspect Code from UML Models

A terminology model approach for defining and managing statistical metadata

CPS211 Lecture: Class Diagrams in UML

Enterprise Architecture: Practical Guide to Logical Architecture

Scenario-based Requirements Engineering and User-Interface Design

Visible Business Templates An Introduction

2. Analysis. The goal of this is to understand the problem. The key question is What?.

Data Analysis 1. SET08104 Database Systems. Napier University

Data Flow Diagram (DFD) Tutorial Written Date : January 27, 2012

Object Oriented System Analyze and Design of Revenue Information System using UML

Rapid Development of Modular Dynamic Web Sites using UML

Lab Manual: Using Rational Rose

Chapter 13: Program Development and Programming Languages

A technical discussion on modeling with UML 06/11/03 Entity Relationship Modeling with UML

Unit 2.1. Data Analysis 1 - V Data Analysis 1. Dr Gordon Russell, Napier University

CHAPTER 6: TECHNOLOGY

Development of a Feature Modeling Tool using Microsoft DSL Tools.

Transcription:

Introduction to Object Orientation: in UML flavors Fall 2004, CSC532 1

Objective: Introduction to Object Orientation Understand the basic principle of object orientation Understand the basic concepts and terms of object orientation and the associated UML notation Appreciate the strengths of object orientation Understand some basic UML modeling mechanisms 2

Introduction to Object Orientation Topics Basic Principles of Object Orientation Basic Concepts of Object Orientation Strengths of Object Orientation General UML Modeling Mechanisms 3

Basic Principles of Object Orientation Object Orientation Abstraction Encapsulation Modularity Hierarchy 4

What is Abstraction? A model that includes most important aspects of a given problem while ignoring less important details Salesperson Customer Product An example of an order processing abstraction 5

What is Encapsulation Hide implementation from clients Clients depend on interface 6

What is Modularity? The breaking up of something complex into manageable pieces Order Processing System Order Entry Order Fulfillment Billing 7

What is Hierarchy? Level of abstraction Increasing abstraction Bank Account Asset Security Real Estate Decreasing Abstraction Savings Checking Stock Bond 8

Object Class Attributes Operation Interface (Polymorphism) Components Package Subsystem Relationships Basic Concepts Of Object Orientation 9

What is an Object? Informally, an object represents an entity, either physical, conceptual, or software Physical entity Conceptual entity Software entity truck Chemical Process Linked List 10

A More Formal Definition An object is a concept, abstraction, or thing with sharp boundaries and meaning for an application An object is something that has State Behavior Identity 11

An Object Has State The state of an object is one of the possible conditions in which an object may exist The state of an object normally changes over time Represented by: Attribute values + Links (relationship instances) Name Joy Clark Employee ID 567138 Professor Clark Date hired March 21, 1987 12 Status Tenured

An Object Has Behavior Behavior determines how an object acts and reacts to requests from other objects Behavior is represented by the set of messages it can respond to (the operations the object can perform) Assign Prof. Clark (Returns: conformation) Registration System Algebra 101 Course 13

An Object Has Identity Each object has a unique identity, even if its state is identical to that of another object Prof. J. Clark Teaches algebra Prof. J. Clark Teaches algebra Prof. J. Clark Teaches algebra 14

Representing Objects An object is represented as rectangles with underlined names : Professor Class Name Only ProfessorClark : Professor ProfessorClark Object Name Only Class and Object Name 15

Example: Objects Intro to OO 180 World History 200 Algebra 110 English 101 Geology 110 Geology 110 Music History 200 16

What is a Class? A class is a description of a group of objects with common properties (attributes), behavior (operations), relationships, and semantics An object is an instance of a class A class is an abstraction in that emphasizes relevant characteristics 17

Sample Class Properties Name Location Days offered Credit hours Start time End time Class Course Behavior Add a student Delete a student Get course roster Determine if it is full 18

Representing Classes A class is represented using a compartmented rectangle Professor 19

Class Compartments A class is comprised of three sections The first section contains the class name The second section shows the structure (attributes) The third section shows the behavior (operations) Professor Name empid create() change() save() delete() 20

Class Compartments (cont.) The second and third sections may be suppressed if they need not be visible on the diagram Professor Name empid create() change() save() delete() Professor Name empid Professor create() change() save() delete() Professor Professor 21

Example: Class CourseOffering Intro to OO 180 World History 200 Algebra 110 English 101 Geology 110 Geology 110 Music History 200 22

Classes of Objects How many class can you see? 23

The Relationship Between Classes and Objects A class is an abstract definition of an object It defines the structure and behavior of each object in the class It serves as a template for creating objects Objects may be grouped into classes Professor Professor Smith Professor Jones Professor Mellon 24

What is Attribute? Class Attribute CourseOffering number starttime endtime Object Attribute Value :CourseOffering Number=110 starttime=900 endtime=1100 :CourseOffering Number=104 starttime=1300 endtime=1500 25

What is Operation? Class Operation :CourseOffering addstudent() deletestudent() getstarttime() getendtime() 26

What is Polymorphism? The ability to hide many different implementations behind a single interface Manufacture A Manufacture B Manufacture C OO Principle: Encapsulation 27

What is an Interface? Interface formalize polymorphism Interface support plug-and-play architecture <<interface>> Shape Draw Move Scale Rotate Tube Pyramid Cube 28

Interface Representations Tube Elided/Iconic Representation Pyramid ( lollipop ) Cube Canonical (Class/Stereotype) presentation <<interface>> Shape Draw Move Scale Rotate Tube Pyramid Cube 29

What is a Component? A non-trivial, nearly independent, and replaceable part of a system that fulfills a clear function in the context of a welldefined architecture 30

What is a Component?(Cont.) A component may be A source code component A run time component or An executable component Source File Name <<DLL>> Component Name <<EXE>> Executable Name 31

Source Code Coponents Visualize compilation dependencies between source code files Account.h Account.cpp Report.cpp 32

Executable and Run-time Components Visualizing all of the pieces of an executable release, their interfaces, and their relationships <<EXE>> ATM Iaccount Ibank <<DLL>> Account Bank 33

Interfaces and Components Interfaces can be realized by components Implementation Model Source File Component Interface Name 34

What is a Package? A package is a general purpose mechanism for organizing elements into groups A model element which can contain other model elements Package Name Uses Organize the model under development A unit of configuration management 35

What is a Subsystem? A cross between a package (can contain other model elements) and a class (has behavior) Realizes one or more interfaces which define its behavior Realization Subsystem <<subsystem>> interface Subsystem Name 36

Subsystems and Components Components are the physical realization of an abstraction in the design Subsystems can be used to represent the component in the design Current Interface Design Model <<subsystem>> Component Name Component Interface Implementation Model Component Name 37

Relationships Association Aggregation Composition Dependency Generalization Realization 38

Relationships: Association Models a semantic connection among classes Association name and/or Role name Association name Professor Works for University Class Association Role Names Professor Employee Employer University 39

Relationship: Aggregation A special form of association that models a whole-part relationship between an aggregate (the whole) and its parts Whole Part Student Schedule Aggregation 40

Relationship: Composition A form of aggregation with strong ownership and coincident lifetimes The parts cannot survive the whole/aggregate Whole Part Student Schedule Aggregation 41

Association: Multiplicity and Navigation Multiplicity defines how many objects participate in a relationships The number of instances of one class related to ONE instance of the other class Specified for each end of the association Associations and aggregations are bidirectional by default, but it is often desirable to restrict navigation to one direction If navigation is restricted, an arrowhead is added to indicate the direction of the navigation 42

Association: Multiplicity Unspecified Exactly one Zero or more (many, unlimited) One or more Zero or one Specified range Multiple, disjoint ranges 1 0..* * 1..* 0..1 2..4 2,4..6 43

Example: Multiplicity and Navigation Multiplicity Student 1 0..* Schedule Navigation 44

Relationship: Dependency Class A relationship between two model elements where a change in one may cause a change in the other None-structural, using relationship Client Supplier Component Package Dependency relationship Client Supplier ClientPackage SupplierPackage Dependency relationship 45

Relationship: Generalization A relationship among classes where one class shares the structure and/or behavior of one or more classes Defines a hierarchy of abstractions in which a subclass inherits from one or more super classes Single inheritance Multiple inheritance Generalization is an is-a-kind of relationship 46

Example: Single Inheritance One class inherits from another Ancestor Superclass (parent) balance name number Account Withdraw() CreateStatement() Generalization Relationship Subclasses Checking Savings Withdraw() Descendents GetInterest() Withdraw() 47

Multiple Inheritance A class can inherit from several other classes FlyingThing Animal multiple inheritance Airplane Helicopter Bird Wolf Horse 48

What Gets Inherited? A subclass inherits its parent s attributes, operations, and relationships A subclass may: Add additional attributes, operations, relationships Redefine inherited operations (use caution) Common attributes, operations, and/or relationships are shown at the highest applicable level in the hierarchy 49

Example: What Gets Inherited Superclass (parent) GroundVehicle weight licensenumber register() owner 0..* 1 Person Generalization Subclasses Car size Truck tonnage gettax() Trailer 50

Relationship: Realization One classifier serves as the contract that the other classifier agrees to carry out Found between Interfaces and the classifiers that realize them Class Subsystem Client Interface Interface Interface Elided form Use cases and the collaborations that realize them Canonical form Use Case Use-Case Realization 51

Strengths of Object Orientation A single paradigm Facilitates architectural and code reuse Models more closely reflect the real world More accurately describe corporate data and processes Decomposed based on natural partitioning Easier to understand and maintain Stability A small change in requirements does not mean massive changes in the system under development 52

A simple Sales Order Example Order Product Ship via 53

Class Diagram for the Sales Example Sale seller buyer Item sold Shipping mechanism Salesperson Customer Product Vehicle Corporate Individual Truck Train 54

Effect of Requirements Change Suppose you need a new type of shipping vehicle Sale seller buyer Item sold Shipping mechanism Salesperson Customer Product Vehicle Corporate Individual Truck Train Airplane 55

Stereotypes Classify and extend the UML notational elements Define a new model element in terms of another model element May be applied to all modeling elements Represented with name in guillemets or as a different icon <<boundary>> MyBoundaryClass MyBoundaryClass 56

Example: Stereotypes <<boundary>> <<boundary>> <<trace>> DesignClass <<Processor>> Processor #1 <<Processor>> Processor #1 57

Notes A note can be added to any UML element Notes may be added to add more information to the diagram It is a dog eared rectangle The note may be anchored to an element with a dashed line MaintainScheduleForm There can be up to one MaintainScheduleForm per user session. 58

Properties A property, or specific attribute, of a UML element Also called tagged values Some properties are defined by UML Persistence Location (e.g., client, server) Properties can be created by UML modelers for any purpose PersistentClass {persistence} anobject: ClassA {location=server} 59

constraints Supports the addition of new rules or modification of existing rules Professor Member 1 1..* {subset} Department Head 1 1 Department 60

Group exercise Design class diagram for paid e-mail services must include relationships Ask questions if you need more input 5-10 min for customer interviews 10-15 min for team to work on the solution 61

62