UML1.5. Details of Class Definition. A Simple model of an insurance business. Koichiro Ochimizu, JAIST. Static Modeling 1. Schedule.

Similar documents
The UML Class Diagram

11 November

Umbrello UML Modeller Handbook

UML Class Diagrams. Lesson Objectives

Laboratory Assignments of OBJECT ORIENTED METHODOLOGY & PROGRAMMING (USING C++) [IT 553]

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

CASE TOOLS. Contents

Data Analysis 1. SET08104 Database Systems. Napier University

Structural Design Patterns Used in Data Structures Implementation

Designing Real-Time and Embedded Systems with the COMET/UML method

UML Tutorial: Part 1 -- Class Diagrams.

CompuScholar, Inc. Alignment to Utah's Computer Programming II Standards

Glossary of Object Oriented Terms

Lecture 12: Entity Relationship Modelling

Java (12 Weeks) Introduction to Java Programming Language

Database Design Methodology

Chapter 8 The Enhanced Entity- Relationship (EER) Model

An Introduction To UML Class Diagrams Classes

How To Design Software

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

Graphical Systems Modeling with UML / SysML Class diagrams

Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model

Java CPD (I) Frans Coenen Department of Computer Science

Lab Manual: Using Rational Rose

III. Class and Object Diagrams

PART-A Questions. 2. How does an enumerated statement differ from a typedef statement?

KITES TECHNOLOGY COURSE MODULE (C, C++, DS)

Classes and Objects in Java Constructors. In creating objects of the type Fraction, we have used statements similar to the following:

A SYSTEMATIC APPROACH FOR COMPONENT-BASED SOFTWARE DEVELOPMENT

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

Best of Both Worlds - A Mapping from EXPRESS-G to UML

BCS2B02: OOP Concepts and Data Structures Using C++

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

A Pattern-based Framework to Address Abstraction, Reuse, and Cross-domain Aspects in Domain Specific Visual Languages *

Java Interview Questions and Answers

UML for C# Modeling Basics

XV. The Entity-Relationship Model

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

Efficient Data Structures for Decision Diagrams

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

The C Programming Language course syllabus associate level

Object Oriented Programming. Risk Management

Part 1 Foundations of object orientation

CSE 1020 Introduction to Computer Science I A sample nal exam

Multichoice Quetions 1. Atributes a. are listed in the second part of the class box b. its time is preceded by a colon. c. its default value is

Case Study: Design and Implementation of an Ordering system using UML, Formal specification and Java Builder

PROJECT MANAGEMENT METHODOLOGY OF OBJECT- ORIENTED SOFTWARE DEVELOPMENT

Design and UML Class Diagrams

Object-Oriented Data Modeling

Object Oriented Software Models

Tool Support for Software Variability Management and Product Derivation in Software Product Lines

Introduction. UML = Unified Modeling Language It is a standardized visual modeling language.

Certified PHP/MySQL Web Developer Course

CHAPTER 1 Introduction

IV. The (Extended) Entity-Relationship Model

A Brief Analysis of Web Design Patterns

Java Software Structures

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

Design and UML Class Diagrams. Suggested reading: Practical UML: A hands on introduction for developers

COMP 378 Database Systems Notes for Chapter 7 of Database System Concepts Database Design and the Entity-Relationship Model

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

Examples of Design by Contract in Java

History OOP languages Year Language 1967 Simula Smalltalk

1. Visual Paradigm for UML

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

13 Classes & Objects with Constructors/Destructors

CSC 742 Database Management Systems

Authorized Signature Options Quick Reference

C++ Programming Language

The Entity-Relationship Model

How To Draw A Cell Phone Into A Cellphone In Unminimal Diagram (Uml)

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

A brief overview of developing a conceptual data model as the first step in creating a relational database.

Syllabus M.C.A. Object Oriented Modeling and Design usung UML

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

Modeling the User Interface of Web Applications with UML

Using UML Part One Structural Modeling Diagrams

C++ INTERVIEW QUESTIONS

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

Chapter 5. Regression Testing of Web-Components

Entity-Relationship Model

SWAN 15.1 Advance user information What s new in SWAN? Introduction of the new user interface. Last update: 28th April 2015

2. Conceptual Modeling using the Entity-Relationship Model

Programming Language Constructs as Basis for Software Architectures

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

Automatic Test Data Generation for TTCN-3 using CTE

CSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions

Printer Connection Manager

Communication Diagrams

9.0 eportal Element of the ecommerce website

Chapter 4 OOPS WITH C++ Sahaj Computer Solutions

System Modeling / Class Diagra Diagr m a Week 6

Contents. 9-1 Copyright (c) N. Afshartous

Object Oriented Analysis and Design - Advantages of UML

ASSET CASE MANAGEMENT 3-1 STRUCTURE OF SYSTEM FUNCTIONS

Incorporating Aspects into the UML

UML TUTORIALS THE COMPONENT MODEL

An eclipse-based Feature Models toolchain

AXIGEN Mail Server Reporting Service

UML Modeling Guidelines

Transcription:

UML.5 Details of Class Definition Koichiro OCHIMIZU School of Information Science JAIST Schedule March 6th 3:00 Static Modeling (details of class specification) 4:30 Dynamic Modeling (state machine diagram, communication diagram) March 7th Case Study of Elevator Control System 3:00 Problem Definition, Use case Model) 4:30 Finding Analysis Classes by developing the consolidated communication diagram March 8th 3:00 Sub System Design 4:30 Task Design March 3th 3:00 Performance Analysis 4:30 History and Perspectives of Object Oriented Technologies A Simple model of an insurance business 0.. 0.... Customer Visibility Invoice + amount : Real + date : Date + customer : String + specification : String - administration : String + public can access it from the other classes It violates information hiding principle - private cannot access it from other classes # protected can access it from sub classes Default values Invoice + amount : Real + date : Date = Current date + customer : String + specification : String - administration : String = Unspecified Assigned at the same time an object of the class is created A class-scope attribute or a class variable Invoice + amount : Real + date : Date = Current date + customer : String + specification : String - administration : String = Unspecified - number of invoices : Integer A class variable (underlined) is shared by all objects of the class Static Modeling

Property string Invoice + amount : Real + date : Date = Current date + customer : String + specification : String - administration : String = Unspecified - number of invoices : Integer + status : Status = unpaid, paid} Property string show the possible values explicitly Java implementation public class Invoice public double amount; public Date date = new Date(); public String customer; static private int number_of_invoices = 0; // Constructor, called every time an object is created public Invoice() // Other initialization number_of_invoices++; Increment the class attribute } // Other methods go here Signature + registration number : String - data : Data + speed : Integer + direction : Direction - administration : String + drive(speed: Integer, direction: Direction) + getdata(): Data Signature: a return-type, a name, zero or more parameters Class-scope operation size : Size pos : Position figcounter : Integer getcounter(): Integer Access class-scope attributes Creation of objects Visibility of Operation size : Size pos : Position + + scale(percent: Integer = 25) + returnpos(): Position Default values of parameter size : Size pos : Position + + resize(percentx: Integer = 25, percenty: Integer = 25) + returnpos(): Position figure.resize(0,0) percentx=0, percenty=0 figure.resize(37) percentx=37, percenty=25 figure.resize() percentx=25, percenty=25 Static Modeling 2

Java implementation - x: Integer = 0 - y: Integer = 0 + public class private int x = 0; private int y = 0; public void // Java code for drawing the figure } fig = new (); fig2 = new (); fig.; fig2.; UML notations Representation of Relationships between Classes Association Navigable Association Dependency Generalization Aggregation: whole-part association Composition: the same life span G.Booch, J.Rumbaugh, I. Jacobson, The Unified Modeling Language User Guide, Addison Wesley, 999. Multiplicity A class diagram describing an business.. owns 0.. Policy 0.. owned by Company 0.. owns 0.. 0.... Customer Object Diagram Recursive Association Author name: String age: Integer 0.. Use.. Computer name: String memory: Integer Node wife husband Bob:Author Bob s PC: Computer Connects married to name = Bob J age = 32 name = Dell466 memory = 64 Static Modeling 3

Client Composite Clients use the Component class interface to interact with objects in the composite structure. If the recipient is a Leaf, then the request Is handled directly. If the recipient is a Composite, then it usually forwards requests to its child components, possibly performing additional operations before and/or after forwarding. Component Operation() Add(Component) Remove(Component) GetChild(int) children aleaf Object Diagram acomposite aleaf acomposite aleaf Leaf Operation() Composite Operation() Add(Component) Remove(Component) GetChild(int) E.Gamma, R.Helm, R.Johnson, J.Vlissides, Design Patterns, ADDISON-WESLEY, 995. forall g in children g.operation() aleaf aleaf aleaf E.Gamma, R.Helm, R.Johnson, J.Vlissides, Design Patterns, ADDISON-WESLEY, 995. Java Implementation Qualifier Company s 0.. refers to Contract Canvas // _.java file public class _ / Methods / // _Vector is a specialization of the // Vector class ensuring hard typing. Vector is a standard // Java class for dynamic arrays. private _Vector s; Canvas figure ID // _.java file public class _ / Methods / private _ refer_to one to many to one to one An insurance cannot have associations to both and person at the same time OR-association 0.. 0.. 0.... 0.... 0.. or} 0.... Company.. Company Ordered Association 0.... Customer ordered } Static Modeling 4

Association Class Ternary Association A class can be attached to an association Queue 0.. Elevator Control Button 3 Elevator The association class is not connected at any of the ends of the association policyholder 0.... 0.. policy What is an Aggregation? Aggregation Aggregation is a special case of association whole-part, is-part-of Special kinds of aggregation aggregation Shared Aggregation Composition Aggregation Navy This example is not so good. Contains Warship Aggregation Composition: The part has the same life span with the whole Shared Aggregation Composition Aggregation Team Text Members A team is composed of team members. One person could be a member of many teams. Window Listbox Button Menu Static Modeling 5

Another Expression of Aggregation Generalization Window Text Listbox Button Window Text Listbox Button Problem Fitness Vehicle Boat Property (reusability) Menu Menu Associations and Aggregation describe structure of the problem domain which we are interested in. Generalizations describe concepts which are common to several problem domains Inheritance Combination of Inheritance and Aggregation Class inheritance Interface Inheritance Canvas consists of consists of abstract} position: Pos abstract} Group Polygon consists of Line Circle Java Implementation Constrained Generalization abstract} position: Pos abstract} Group Polygon abstract public class abstract public void ; protected Pos position; public class Polygon extends public void ; / draw polygon code / Overlapping Disjoint Complete Incomplete Class B Class A constraint, constraint2,,} Class C } Static Modeling 6

Overlapping and Disjoint Complete and Incomplete Vehicle overlapping} Boat Complete} Man Woman Amphibian Refinement relationship Derivation Analysis Class Design Class hire 0.. Hire 0.. A refinement is a relationship between two descriptions of the same thing, but at different levels of abstraction. It can be also used to model different implementations of the same thing. Support Configuration Management. Support traceability In the model. / VIP customer Customer can be computed from other associations and attributes. The VIP customers are a derived association when makes s with many customers. Derived Attribute Subset Constraint Article Member of cost price sales price /profit Politician.. (subset} Party profit = sales price cost price } Party leader of Static Modeling 7

Array<,00> Template Parameterized class T, n:integer Array <<bind>><color,50> Color Array Exercise Review the content of my lecture by answering the following simple questions. Please describe the definition of each technical term.. What is a navigable association? 2. Please explain the difference of usage between association and generalization. 3. What is a dependency? 4. What is a multiplicity? 5. How can we implement many to many correspondence between objects in a program? Static Modeling 8