Lecture #2 on Object-Oriented Modeling

Similar documents
Object-Oriented Analysis and Design

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

LESSON PLAN SUB NAME : OBJECT ORIENTED ANALYSIS AND DESIGN UNIT SYLLABUS

CISC 322 Software Architecture

Course 3 7 March

Object-Oriented Software Development Goal and Scope

CHAPTER 1. Topic: UML Overview. CHAPTER 1: Topic 1. Topic: UML Overview

Software Development Methodologies

Object-Oriented Design

Chapter 2, lecture 1, Modeling with UML

MSc programme (induction week) Department of Informatics INTRODUCTION TO UML

3.0 Object-Oriented Modeling Using UML

Formal Specification of Software Systems

Programming Language Constructs as Basis for Software Architectures

1 Introduction. 1.1 Introduction

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

Model Driven Development Unified Modeling Language (UML)

The Unified Modeling Language User Guide

UML Primer. -Elango Sundaram

Information Systems Development Methodologies

Research Review on Basic Principles of Unified Modelling Language

Software Engineering

Chapter 2, Modeling with UML, Part 2

Unified Modeling Language

Programming Language Constructs as Basis for Software Architectures. Stefan Resmerita, WS2015

Ingegneria del Software Corso di Laurea in Informatica per il Management. Introduction to UML

DOWNLOAD OR READ : THE UNIFIED MODELING LANGUAGE UML98 BEYOND THE NOTATION BEYOND THE NOTATION FIRST INTERNATIONAL PDF EBOOK EPUB MOBI

Unified Modelling Language User Guide READ ONLINE

Topic 13 Object-oriented Analysis

Software Development. Modular Design and Algorithm Analysis

CMSC 132: Object-Oriented Programming II

Lecture Notes UML UNIT-II. Subject: OOAD Semester: 8TH Course No: CSE-802

The Unified Modeling Language User Guide (2nd Edition) By James Rumbaugh, Grady Booch READ ONLINE

Engineering Design w/embedded Systems

Introduction to Software Engineering. 5. Modeling Objects and Classes

Lecture 33 April 4, Unied Modelling Language. ECE155: Engineering Design with Embedded Systems Winter Patrick Lam version 1

CHAPTER 1. Objects, UML, and Java

Proposal of a Supporting Method for Diagrams Generation with the Transformation Rules in UML

UML & OO FUNDAMENTALS CSCI 4448/5448: OBJECT-ORIENTED ANALYSIS & DESIGN LECTURE 3 08/30/2011

Introduction to Software Engineering. 5. Modeling Objects and Classes

PRINCIPLES OF SOFTWARE BIM209DESIGN AND DEVELOPMENT 00. WELCOME TO OBJECTVILLE. Speaking the Language of OO

02291: System Integration

Chapter 12. UML and Patterns. Copyright 2008 Pearson Addison-Wesley. All rights reserved

Seite 1. "Formal specifications may become for software engineers what, say, differential equations are for engineers of other fields.

On UML2.0 s Abandonment of the Actors-Call-Use-Cases Conjecture

Unified Modeling Language (UML)

Teaching Encapsulation and Modularity in Object-Oriented Languages with Access Graphs

Object-Oriented Introduction

Systems Analysis & Design

L02.1 Introduction... 2

Exercise Unit 2: Modeling Paradigms - RT-UML. UML: The Unified Modeling Language. Statecharts. RT-UML in AnyLogic

CSE 308. UML Overview Use Case Diagrams. Reference. Class diagrams. Session 6 UML Intro/Use cases. Robert Kelly, B. Bruegge,

System Structure Modeling

Available online at ScienceDirect. Procedia Computer Science 56 (2015 )

Software Engineering Lab Manual

Course "Softwaretechnik" Book Chapter 2 Modeling with UML

1 Reference Material for these slides is taken from many UML reference books. However, the two I most often used are: UML Explained, by Kendall Scott,

MSO Lecture 1. Wouter Swierstra (adapted by HP) September 11, 2017

Session 8: UML The Unified Modeling (or the Unstructured Muddling) language?

Course "Softwaretechnik Modeling with UML Stephan Salinger

UML & OO Fundamentals. CSCI 4448/5448: Object-Oriented Analysis & Design Lecture 3 09/04/2012

On behalf of ASE crew, I welcome you onboard. We will cover this journey in roughly 50 minutes.

Introduction to Information Systems (IS)

OBJECT-ORIENTED MODELING AND DESIGN. Introduction

CSE 308. UML Overview Use Case Diagrams. Reference. en.wikipedia.org/wiki/class_diagram. Robert Kelly, B. Bruegge,

UML Modeling. Sumantra Sarkar. 29 th June CIS 8090 Managing Enterprise Architecture

Object Oriented Modelling And Design With Uml Solution

What's New in UML 2.0

Domain Engineering And Variability In The Reuse-Driven Software Engineering Business.

Object Oriented Software Engineering Ivar Jacobson

UNIT-I Introduction of Object Oriented Modeling

Comparative Analysis of Architectural Views Based on UML

3F6 - Software Engineering and Design. Handout 1 Architecture of a Computer With Markup. Ed Rosten

How and Why to Use the Unified Modeling Language. among software components, architectural-based

JOURNAL OF OBJECT TECHNOLOGY Online at Published by ETH Zurich, Chair of Software Engineering. JOT, 2002

SE203b: OO Design for Software Engineers. Office: TEB349, Ext

Software Design, Modelling and Analysis in UML

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

Modelling with Classes. CITS1220 Software Engineering

Integrating Systems and Software Engineering Concepts in AP-233

Object-Oriented Design

i219 Software Design Methodology 1. Overview of software design methodology Kazuhiro Ogata (JAIST) Outline of lecture

UML 2.0 State Machines

SOFTWARE DESIGN COSC 4353 / Dr. Raj Singh

Software Engineering

Integrating UML and SOFL for Object-Oriented Design

Modern power systems have grown both in size

Object-Oriented Design

Software Component Relationships. Stephen H. Edwards. Department of Computer Science. Virginia Polytechnic Institute and State University

IT-2670: C/C++ PROGRAMMING LANGUAGE

2D1358 Object Oriented Program Construction in C++ Exercises & Labs. Course Registration / Accounts. Course Literature

Construction of Software Model Graph and Analysing Object-Oriented Program(C#) Using Abstract Syntax Tree Method

Object-Oriented Software Engineering: Using UML, Patterns And Java (2nd Edition) By Allen H. Dutoit, Bernd Bruegge

Introduction. Chapter 1. What Is Visual Modeling? The Triangle for Success. The Role of Notation. History of the UML. The Role of Process

Module Outline. What is Object-Oriented? Some Possible Definitions. Why Object-oriented? Fundamentals of Object Orientation

Capturing the Essential: Use Case and Service Specification Modelling in UML

n HW5 out, due Tuesday October 30 th n Part 1: Questions on material we ll cover today n Part 2: BFS using your graph from HW4

The Music Notation Toolkit: A Study in Object- Oriented Development

: A FRAMEWORK FOR ARCHITECTURAL SPECIFICATION OF DISTRIBUTED SYSTEMS

Object Oriented Software Engineering Practical Software Development Using Uml And Java

Transcription:

Outline Lecture #2 on Object-Oriented Modeling Thierry Géraud EPITA Research and Development Laboratory (LRDE) 2006 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 1 / 38

Outline Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 2 / 38

Outline Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 2 / 38

Outline Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 2 / 38

Outline Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 2 / 38

Inheritance Consider that: inheritance is a key concept of object-orientation a lot of different kinds of inheritance exist with various meanings/semantics (read Meyer for details) the most prominent form is: class inheritance related to sub-typing mapping the is a relationship polymorphism of methods and abstract data types are also key concepts of object-orientation and rely on inheritance see also: http://en.wikipedia.org/wiki/inheritance_ (object-oriented_programming) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 3 / 38

Inheritance and Polymorphism Two points of view type theory: it defines the notion of sub-typing and sub-classing reflects (tries to reflect) this notion semantics: verifying is a is mandatory to get class inheritance however it is not enough to get proper inheritance having various semantics explain the different kinds of inheritance Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 4 / 38

Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 5 / 38

UML? The Unified Modeling Language: is an object modeling and specification language both textual and graphical is the language we should talk and understand comes from: James Rumbaugh (OMT) Grady Booch (Booch method) Ivar Jacobson (Objectory) Richard Soley (Object Management Group, OMG) see also: http: //en.wikipedia.org/wiki/unified_modeling_language Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 6 / 38

UML... This lecture does not aim at teaching UML! Resources from the Internet the official site: http://www.uml.org/ from Cetus (the OO portal): http://www.cetus-links.org/oo_uml.html at a glance (one single page): Allen Holub s UML Quick Reference http://www.holub.com/goodies/uml/index.html Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 7 / 38

Books on UML The Unified Modeling Language User Guide, by Grady Booch, James Rumbaugh, and Ivar Jacobson, 2nd ed., Addison-Wesley Professional, 2005. The Unified Modeling Language Reference Manual, by James Rumbaugh, Ivar Jacobson, and Grady Booch, 2nd ed., Addison-Wesley Professional, 2004. The Complete UML Training Course, by Grady Booch, James Rumbaugh, and Ivar Jacobson, Prentice Hall, 2000. and many more... Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 8 / 38

Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 9 / 38

Different Ways of Describing a Program three different ways FUNCTIONAL point of view: what is it doing? for instance, its list of main tasks or of more atomic functionalities... STATIC point of view: what s in it? for instance, a list of classes and the methods of every class, etc. DYNAMIC point of view: what happens? when you click on this button, then... Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 10 / 38

One Program, Three Axes consider that a program is in a space this space has three axes: functional static dynamic describing one axis is not sufficient you have to describe the three of them! all the axes are tightly linked altogether Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 11 / 38

One Program, One major axis? to specify (and/or describe) a program there is no major axis! however OO modeling is very static-oriented......because one models class hierarchies! Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 12 / 38

An Important Static Diagram entity/relationship diagram UML class diagram Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 13 / 38

Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 14 / 38

A Class in UML (1/3) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 15 / 38

A Class in UML (2/3) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 16 / 38

Relationships between Classes in UML (1/3) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 17 / 38

Relationships between Classes in UML (2/3) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 18 / 38

Relationships between Classes in UML (3/3) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 19 / 38

Inheritance Tree and Object in UML Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 20 / 38

Misc Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 21 / 38

Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 22 / 38

First draw entities and their relationships split your program into several diagrams so that one diagram shows one idea so that each diagram is comprehensive Then (and only then) show public stuff Afterwards (and on specific separate diagrams) depict details Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 23 / 38

Exercise < live! > Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 24 / 38

Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 25 / 38

Variable and Type C translation int i; i : int int i = 3; i : int = 3 there is no ambiguity when we write: variable : type = definition Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 26 / 38

Procedure C int f(float); int f(float arg); translation f : float -> int f : (arg : float) -> int the variable (entity; here a procedure) is named f the type of f is float -> int read: takes float and gives int Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 27 / 38

Type Definition C typedef def t; translation type t = def Consider that t is just an alias (a name) for the type def Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 28 / 38

Enumeration C typedef enum { monday, /*...*/ sunday } day; translation type day = enum monday,.., sunday Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 29 / 38

Structure (1/2) C struct bar { bool b; double d; }; translation type bar = { b : bool, d : double } The {... } notation means that we group a set of fields. Each field has a name (here b and d) and a type (resp. bool and double). Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 30 / 38

Structure (2/2) with: a struct is a product type type day = enum monday,.., sunday type month = enum january,.., december type ydate = { d : day, m : month } the values of ydate are: (monday, january) (tuesday, january)... (sunday, december) we have: card(ydate) = card(day) card(month) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 31 / 38

Union or variant (1/2) C union bar { bool b; double d; }; translation type bar = [ b : bool d : double ] The [... ] notation means that we have exactly one of the fields. Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 32 / 38

Union or variant (2/2) with: we have a sum type type ydate = [ d : day, m : month ] the values of ydate are: monday... sunday january... december) we have: card(ydate) = card(day) + card(month) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 33 / 38

Method C struct bar { int i; int f(float); }; translation type bar = { i : int, f : float -> int } The {... } notation means that we group a set of fields. Each field has a name (here i and d) and a type (resp. int and double). Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 34 / 38

About fields In: type bar = { i : int, f : float -> int }; we have two fields: τ 1 which is i : int and τ 2 which is f : float -> int we can write: bar = { τ 1, τ 2 } Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 35 / 38

Outline 1 2 3 4 Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 36 / 38

The Cornerstone (1/2) consider the function foo: and the variable v: foo : t -> void v : t what the relationship between the couple of types t and t should be so that the following call is valid? foo(v) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 37 / 38

The Cornerstone (2/2) we want: t to be included in t t to be substituted by t t to be a sub-type of t t <: t Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 38 / 38

Simple Test with: type t = { i : int, f : int -> float } foo : (arg : t) -> float = arg.f(arg.i) end is the following program correct? type t = { i : int, f : int -> float, b : bool } var : t // = initialization res : float = foo(var) Thierry Géraud Lecture #2 on Object-Oriented Modeling EPITA-LRDE 2006 39 / 38