From UML to Java and return (object-oriented modeling II)

Size: px
Start display at page:

Download "From UML to Java and return (object-oriented modeling II)"

Transcription

1 From UML to Java and return (object-oriented modeling II) Bruce Eckel, Thinking in Java, 4th edition, PrenticeHall, New Jersey, cf. José Valente de Oliveira 6-1 Previously on OOP Problem: given a square, generate the tangential inner circumference UML Ponto Circunferência Quadrado 1

2 What class should be responsible for a given task? Q1: What should be the class responsible for checking whether two points really define a square? Re: Square; it is its class invariant. Q2: What should be the class responsible for computing the distance between two points? Re: Point. Why? Q3: What should be the class responsible for computing the center and radius of the circunference, given a square? Re: Two hypothesis: Square or Circunference. In general, we decide in favour of the class that have all the required information to solve the task. In this case, we decide by Square. jvo@ualg.pt José Valente de Oliveira 3-3 An initial class diagram Quadrado lado origem validapontos geracircunferencia Ponto x y soma Circunferencia centro raio 2

3 From class diagram to code Quadrado lado validapontos geracircunferencia origem Ponto x y soma centro Circunferencia raio A possible client Call method String tostring() from class Circunferencia 3

4 class Circunferencia public class Circunferencia { private Ponto centro; private float raio; public Circunferencia(Ponto c, float r) { if (r<=0) { System.err.println("ERRO: Circunferencia com raio negativo."); System.exit(1); centro=c; raio=r; public String tostring() { return centro.tostring() + " " + raio; Class Quadrado - Constructor public class Quadrado { private Ponto origem; private int lado; public Quadrado (Ponto A, Ponto B) { if (validapontos(a, B)== false) { System.err.println("Erro: os pontos "+ A + " e " + B + " nao definem um quadrado"); System.exit(1); int x = Math.min(A.getX(), B.getX()); int y = Math.min(A.getY(), B.getY()); origem = new Ponto(x, y); lado = Math.abs(A.getX()-B.getX()); public boolean validapontos(ponto A, Ponto B) { int lado1 = Math.abs(A.getX()-B.getX()); int lado2 = Math.abs(A.getY()-B.getY()); return lado1 == lado2; origem 4

5 Class Quadrado conclusion public class Quadrado { // public Circunferencia geracircunferencia() { float raio = lado / 2.0f; Ponto centro = origem.soma(new Ponto((int) raio, (int) raio)); Circunferencia c = new Circunferencia (centro, raio); return c; The previous class Ponto, with minor changes class Ponto { private int _x_, _y_; public Ponto() { _x_ = 0; _y_ = 0; public Ponto(int x, int y) { setx(x); sety(y); public int getx() { return _x_; public int gety() { return _y_; public void setx(int x) { assert x>0; _x_ = x; public void sety(int y) { assert y>0; _y_ = y; public double dist(ponto that) { int dx = this.getx() - that.getx(); int dy = this.gety() - that.gety(); return Math.sqrt(dx*dx+dy*dy); 5

6 Refining class Ponto class Ponto { // public Ponto soma(ponto that) { int x = this.getx() + that.getx(); int y = this.gety() + that.gety(); return new Ponto(x, y); Ponto A = new Ponto (1, 2); Ponto B = new Ponto (2, 0); Ponto C = A.soma(B); System.out.println(C); // (3, 2) public String tostring() { return "("+getx() + "," + gety()+")"; Documenting the code with an UML generator jvo@ualg.pt

7 The initial client What changes are needed to run this new client code? 7

8 Changes version 1.0 Quadrado q = new Quadrado (P1, P2); public class Circunferencia { //Circunferencia c = q.geracircunferencia (q); private Ponto centro; Circunferencia c = new Circunferencia (q); private float raio; // public Circunferencia (Quadrado q) { raio = q.getlado() / 2.0f; centro = q.getorigem().soma (new Ponto((int) raio, (int) raio)); public class Quadrado { private Ponto origem; private int lado; // public int getlado () { return this.lado; public Ponto getorigem () { return this.origem; Changes version 2.0 Quadrado q = new Quadrado (P1, P2); public class Circunferencia { //Circunferencia c = q.geracircunferencia (q); private Ponto centro; Circunferencia c = new Circunferencia (q); private float raio; // public Circunferencia (Quadrado q) { Circunferencia c = q. geracircunferencia (); centro = c.getcentro(); raio = c.getraio(); 8

9 Object diagrams José Valente de Oliveira 3-17 Object Diagrams Several ways of representing objects in UML: write only the class name preceded by a colon and underlined : Student write the name of specific object with it s class onestudent : Student multiple objects : : Student 9

10 A possible object diagram (A class diagram) The object diagram for the given problem instance José Valente de Oliveira 3-19 Object Diagram Captures instances and associations at a given point in execution time 10

11 Class Diagram Where are we in OOM? Modeling and UML, an Introduction Classes and relationship between classes: association, composition, and agregation Introduction to UML class and object diagrams A complete example Notion of design pattern The Expert pattern jvo@ualg.pt José Valente de Oliveira

12 Patterns: a first notion Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides, Design Pattern Elements of Reusable Object-Oriented Software, Addison-Wesley, 1995 jvo@ualg.pt José Valente de Oliveira 3-23 Pattern Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice, (Christopher Alexander et al, A Pattern Language: Towns, Buildings, Construction, 1977) jvo@ualg.pt José Valente de Oliveira

13 Pattern Pattern is a named and well-known problem/solution pair that can be applied in new contexts, with advice on how to apply it in novel situations and discussion of its tradeoffs, implementations, variations, and so forth. (Craig Larman, Applying UML and Patterns, 1995) jvo@ualg.pt José Valente de Oliveira 3-25 The Expert pattern (padrão Especialista) Name: Problem: Solution: (advice) Expert What is a basic principle by which to assign responsibilities to objects? Assign a responsibility to the class that has the information needed to fulfill it. jvo@ualg.pt José Valente de Oliveira

14 The Expert pattern (padrão Especialista) Discussão: O Expert leva-nos habitualmente a programas onde o objeto no programa tem o comportamento que é normalmente encontrado no objeto do mundo real. O Expert promove o encapsulamento, uma vez que o objeto usa os seus próprios dados para realizar as suas tarefas. jvo@ualg.pt José Valente de Oliveira 3-27 Design patterns A design pattern captures design expertise abstracted from existing design examples Design patterns allow to reuse design expertise Design patterns allow one to study how experts do design jvo@ualg.pt José Valente de Oliveira

An introduction to Java II

An introduction to Java II An introduction to Java II Bruce Eckel, Thinking in Java, 4th edition, PrenticeHall, New Jersey, cf. http://mindview.net/books/tij4 jvo@ualg.pt José Valente de Oliveira 4-1 Java: Generalities A little

More information

Bruce Eckel, Thinking in Patterns with Java, cf. José Valente de Oliveira 10-1

Bruce Eckel, Thinking in Patterns with Java, cf.   José Valente de Oliveira 10-1 The desig patter Template Method Erich Gamma, Richard Helm, Ralph Johso, Joh Vlissides, Desig Patters Elemets of Reusable Object-Orieted Software, Addiso-Wesley, 1995, AKA GoF Bruce Eckel, Thikig i Patters

More information

w3.ualg.pt/~jvo/poo

w3.ualg.pt/~jvo/poo POO - Programação Orientada por Objetos OOP - Object-oriented programming 2015/2016 José Valente de Oliveira jvo@ualg.pt 1 www.ualg.pt w3.ualg.pt/~jvo/poo 1 http://www.fct.ualg.pt/gcal?curso=lei What is

More information

Interfaces Java. Overview. n Java interfaces. q Introduction. q Sintaxe. q UML notation. q Multi-inheritance of interfaces

Interfaces Java. Overview. n Java interfaces. q Introduction. q Sintaxe. q UML notation. q Multi-inheritance of interfaces Interfaces Java jvo@ualg.pt José Valente de Oliveira 11-1 Overview n Java interfaces q Introduction q Sintaxe q UML notation q Multi-inheritance of interfaces q (Some) Java pre-defined interfaces q Design

More information

Design Patterns. Gunnar Gotshalks A4-1

Design Patterns. Gunnar Gotshalks A4-1 Design Patterns A4-1 On Design Patterns A design pattern systematically names, explains and evaluates an important and recurring design problem and its solution Good designers know not to solve every problem

More information

Java Classes & Primitive Types

Java Classes & Primitive Types Java Classes & Primitive Types Rui Moreira Classes Ponto (from figgeom) x : int = 0 y : int = 0 n Attributes q Characteristics/properties of classes q Primitive types (e.g., char, byte, int, float, etc.)

More information

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar

Produced by. Design Patterns. MSc in Communications Software. Eamonn de Leastar Design Patterns MSc in Communications Software Produced by Eamonn de Leastar (edeleastar@wit.ie) Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie

More information

Lecture 13: Design Patterns

Lecture 13: Design Patterns 1 Lecture 13: Design Patterns Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2005 2 Pattern Resources Pattern Languages of Programming Technical conference on Patterns

More information

Pattern Resources. Lecture 25: Design Patterns. What are Patterns? Design Patterns. Pattern Languages of Programming. The Portland Pattern Repository

Pattern Resources. Lecture 25: Design Patterns. What are Patterns? Design Patterns. Pattern Languages of Programming. The Portland Pattern Repository Pattern Resources Lecture 25: Design Patterns Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Pattern Languages of Programming Technical conference on Patterns

More information

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming

Goals of Lecture. Lecture 27: OO Design Patterns. Pattern Resources. Design Patterns. Cover OO Design Patterns. Pattern Languages of Programming Goals of Lecture Lecture 27: OO Design Patterns Cover OO Design Patterns Background Examples Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2001 April 24, 2001 Kenneth

More information

CHAPTER 6: CREATIONAL DESIGN PATTERNS

CHAPTER 6: CREATIONAL DESIGN PATTERNS CHAPTER 6: CREATIONAL DESIGN PATTERNS SESSION III: BUILDER, PROTOTYPE, SINGLETON Software Engineering Design: Theory and Practice by Carlos E. Otero Slides copyright 2012 by Carlos E. Otero For non-profit

More information

Java Classes & Primitive Types

Java Classes & Primitive Types Java Classes & Primitive Types Rui Moreira Classes Ponto (from figgeom) x : int = 0 y : int = 0 n Attributes q Characteristics/properties of classes q Primitive types (e.g., char, byte, int, float, etc.)

More information

JCF: user defined collections

JCF: user defined collections JCF: user defined collections Bruce Eckel, Thinking in Java, 4th edition, PrenticeHall, New Jersey, cf. http://mindview.net/books/tij4 jvo@ualg.pt José Valente de Oliveira 20-1 Developing of a user-defined

More information

Design Patterns. An introduction

Design Patterns. An introduction Design Patterns An introduction Introduction Designing object-oriented software is hard, and designing reusable object-oriented software is even harder. Your design should be specific to the problem at

More information

CHAPTER 6: CREATIONAL DESIGN PATTERNS

CHAPTER 6: CREATIONAL DESIGN PATTERNS CHAPTER 6: CREATIONAL DESIGN PATTERNS SESSION I: OVERVIEW OF DESIGN PATTERNS, ABSTRACT FACTORY Software Engineering Design: Theory and Practice by Carlos E. Otero Slides copyright 2012 by Carlos E. Otero

More information

More on Design. CSCI 5828: Foundations of Software Engineering Lecture 23 Kenneth M. Anderson

More on Design. CSCI 5828: Foundations of Software Engineering Lecture 23 Kenneth M. Anderson More on Design CSCI 5828: Foundations of Software Engineering Lecture 23 Kenneth M. Anderson Outline Additional Design-Related Topics Design Patterns Singleton Strategy Model View Controller Design by

More information

26.1 Introduction Programming Preliminaries... 2

26.1 Introduction Programming Preliminaries... 2 Department of Computer Science Tackling Design Patterns Chapter 27: Proxy Design Pattern Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents 26.1 Introduction.................................

More information

Crash course on design patterns

Crash course on design patterns Crash course on design patterns Yann-Gaël Guéhéneuc guehene@emn.fr From Olivier Motelet s course (2001/10/17) École des Mines de Nantes, France Object Technology International, Inc., Canada Design patterns

More information

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate

be used for more than one use case (for instance, for use cases Create User and Delete User, one can have one UserController, instead of two separate UNIT 4 GRASP GRASP: Designing objects with responsibilities Creator Information expert Low Coupling Controller High Cohesion Designing for visibility - Applying GoF design patterns adapter, singleton,

More information

Patterns. Erich Gamma Richard Helm Ralph Johnson John Vlissides

Patterns. Erich Gamma Richard Helm Ralph Johnson John Vlissides Patterns Patterns Pattern-based engineering: in the field of (building) architecting and other disciplines from 1960 s Some software engineers also started to use the concepts Become widely known in SE

More information

Object Oriented Programming. Michał Bereta

Object Oriented Programming. Michał Bereta Object Oriented Programming Michał Bereta www.michalbereta.pl mbereta@pk.edu.pl Time and place Thursday, 18:00 20:15 Classroom 142 Institute of Informatics Warszawska street (Faculty of chemistry building)

More information

CSC7203 : Advanced Object Oriented Development. J Paul Gibson, D311. Design Patterns

CSC7203 : Advanced Object Oriented Development. J Paul Gibson, D311. Design Patterns CSC7203 : Advanced Object Oriented Development J Paul Gibson, D311 paul.gibson@telecom-sudparis.eu http://www-public.tem-tsp.eu/~gibson/teaching/csc7203/ Design Patterns /~gibson/teaching/csc7203/csc7203-advancedoo-l2.pdf

More information

Classes and Objects. Again: Distance between points within the first quadrant. José Valente de Oliveira 4-1

Classes and Objects. Again: Distance between points within the first quadrant. José Valente de Oliveira 4-1 Classes ad Objects jvo@ualg.pt José Valete de Oliveira 4-1 Agai: Distace betwee poits withi the first quadrat Sample iput Sample output 1 1 3 4 2 jvo@ualg.pt José Valete de Oliveira 4-2 1 The simplest

More information

James Newkirk

James Newkirk Private Interface Class Structural James Newkirk newkirk@oma.com Intent Provide a mechanism that allows specific classes to use a non-public subset of a class interface without inadvertently increasing

More information

Advanced Object Oriented PHP

Advanced Object Oriented PHP CNM STEMulus Center Web Development with PHP November 11, 2015 1/17 Outline 1 2 Diamond Problem Composing vs Inheriting Case Study: Strategy Design Pattern 2/17 Definition is when a class is based on another

More information

Programmazione. Prof. Marco Bertini

Programmazione. Prof. Marco Bertini Programmazione Prof. Marco Bertini marco.bertini@unifi.it http://www.micc.unifi.it/bertini/ Design patterns Design patterns are bug reports against your programming language. - Peter Norvig What are design

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 28 March 30, 2016 Collections and Equality Chapter 26 Announcements Dr. Steve Zdancewic is guest lecturing today He teaches CIS 120 in the Fall Midterm

More information

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1 Ingegneria del Software Corso di Laurea in Informatica per il Management Design Patterns part 1 Davide Rossi Dipartimento di Informatica Università di Bologna Pattern Each pattern describes a problem which

More information

Applying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1

Applying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1 Applying Design Patterns to accelerate development of reusable, configurable and portable UVCs. Accellera Systems Initiative 1 About the presenter Paul Kaunds Paul Kaunds is a Verification Consultant at

More information

Introducing Design Patterns

Introducing Design Patterns Introducing Design Patterns Prof. Dr. Eric Dubuis, @ Biel Course "UML and Design Patterns" of module "Software Engineering and Design", version October 2007 BFH/TI/UML and Design Patterns/Software Engineering

More information

Towards a Java Framework for Knowledge Representation and Inference

Towards a Java Framework for Knowledge Representation and Inference Towards a Java Framework for Knowledge Representation and Inference Adrian GIURCA University of Craiova, Faculty of Mathematics and Computer Science Email: giurca@inf.ucv.ro Abstract. The Knowledge Representation

More information

17. GRASP: Designing Objects with Responsibilities

17. GRASP: Designing Objects with Responsibilities 17. GRASP: Designing Objects with Responsibilities Objectives Learn to apply five of the GRASP principles or patterns for OOD. Dr. Ziad Kobti School of Computer Science University of Windsor Understanding

More information

PATTERNS AND SOFTWARE DESIGN

PATTERNS AND SOFTWARE DESIGN This article first appeared in Dr. Dobb s Sourcebook, March/April, 1995. Copyright 1995, Dr. Dobb's Journal. PATTERNS AND SOFTWARE DESIGN Patterns for Reusable Object-Oriented Software Richard Helm and

More information

Responsibilities. Using several specific design principles to guide OO design decisions.

Responsibilities. Using several specific design principles to guide OO design decisions. Designing Objects with Responsibilities Using several specific design principles to guide OO design decisions. Challenge Old-school advice on OOD After identifying i your requirements and creating a domain

More information

Chapter 10: Performance Patterns

Chapter 10: Performance Patterns Chapter 10: Performance Patterns Patterns A pattern is a common solution to a problem that occurs in many different contexts Patterns capture expert knowledge about best practices in software design in

More information

Design Patterns. Definition of a Design Pattern

Design Patterns. Definition of a Design Pattern Design Patterns Barbara Russo Definition of a Design Pattern A Pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem,

More information

Bugsquashing: Command - Pattern. Andreas Fetzer

Bugsquashing: Command - Pattern. Andreas Fetzer Bugsquashing: Command - Pattern Andreas Fetzer Class structure Command: Abstract superclass of all commands. Concrete Command: Specifies a concrete comand. Has the execute method in which the corresponding

More information

Patterns of learning

Patterns of learning Design patterns Patterns of learning Suppose we want to learn how to play chess. First, we need to learn the basic rules. Then we need to learn the basic strategy/ principles (value of pieces, etc.). To

More information

Tackling Design Patterns Chapter 3: Template Method design pattern and Public Inheritance. 3.1 Introduction... 2

Tackling Design Patterns Chapter 3: Template Method design pattern and Public Inheritance. 3.1 Introduction... 2 Department of Computer Science Tackling Design Patterns Chapter 3: Template Method design pattern and Public Inheritance Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents

More information

CPSC 310 Software Engineering. Lecture 11. Design Patterns

CPSC 310 Software Engineering. Lecture 11. Design Patterns CPSC 310 Software Engineering Lecture 11 Design Patterns Learning Goals Understand what are design patterns, their benefits and their drawbacks For at least the following design patterns: Singleton, Observer,

More information

C++ INTERFACE CLASSES STRENGTHENING ENCAPSULATION

C++ INTERFACE CLASSES STRENGTHENING ENCAPSULATION C++ INTERFACE CLASSES STRENGTHENING ENCAPSULATION Separating a class s interface from its implementation is fundamental to good quality object oriented software design/programming. However C++ (when compared

More information

6.3 Patterns. Definition: Design Patterns

6.3 Patterns. Definition: Design Patterns Subject/Topic/Focus: Analysis and Design Patterns Summary: What is a pattern? Why patterns? 6.3 Patterns Creational, structural and behavioral patterns Examples: Abstract Factory, Composite, Chain of Responsibility

More information

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8

Object Oriented Methods with UML. Introduction to Design Patterns- Lecture 8 Object Oriented Methods with UML Introduction to Design Patterns- Lecture 8 Topics(03/05/16) Design Patterns Design Pattern In software engineering, a design pattern is a general repeatable solution to

More information

Outline. Object Oriented Programming. Course goals. Staff. Course resources. Assignments. Course organization Introduction Java overview Autumn 2003

Outline. Object Oriented Programming. Course goals. Staff. Course resources. Assignments. Course organization Introduction Java overview Autumn 2003 Outline Object Oriented Programming Autumn 2003 2 Course goals Software design vs hacking Abstractions vs language (syntax) Java used to illustrate concepts NOT a course about Java Prerequisites knowledge

More information

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D. Software Design Patterns Jonathan I. Maletic, Ph.D. Department of Computer Science Kent State University J. Maletic 1 Background 1 Search for recurring successful designs emergent designs from practice

More information

Design Patterns For Object Oriented Software Development Acm Press

Design Patterns For Object Oriented Software Development Acm Press Design Patterns For Object Oriented Software Development Acm Press We have made it easy for you to find a PDF Ebooks without any digging. And by having access to our ebooks online or by storing it on your

More information

Model-View-Controller

Model-View-Controller CNM STEMulus Center Web Development with PHP November 11, 2015 1/8 Outline 1 2 2/8 Definition A design pattern is a reusable and accepted solution to a particular software engineering problem. Design patterns

More information

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

JOURNAL OF OBJECT TECHNOLOGY Online at  Published by ETH Zurich, Chair of Software Engineering. JOT, 2002 JOURNAL OF OBJECT TECHNOLOGY Online at www.jot.fm. Published by ETH Zurich, Chair of Software Engineering. JOT, 2002 Vol. 1, No. 2, July-August 2002 Representing Design Patterns and Frameworks in UML Towards

More information

Object-Oriented Software Development Goal and Scope

Object-Oriented Software Development Goal and Scope Object-Oriented Software Development Goal and Scope Koichiro Ochimizu Japan Advanced Institute of Science and Technologies School of Information Science Scope and Goal Goal enable you to understand basic

More information

Object-Oriented Design

Object-Oriented Design Object-Oriented Design Lecturer: Raman Ramsin Lecture 20: GoF Design Patterns Creational 1 Software Patterns Software Patterns support reuse of software architecture and design. Patterns capture the static

More information

As a programmer, you know how easy it can be to get lost in the details

As a programmer, you know how easy it can be to get lost in the details Chapter 1 Congratulations, Your Problem Has Already Been Solved In This Chapter Introducing design patterns Knowing how design patterns can help Extending object-oriented programming Taking a look at some

More information

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software

Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software Software Engineering - I An Introduction to Software Construction Techniques for Industrial Strength Software Chapter 9 Introduction to Design Patterns Copy Rights Virtual University of Pakistan 1 Design

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 36 April 23, 2014 Overriding and Equality HW 10 has a HARD deadline Announcements You must submit by midnight, April 30 th Demo your project to your

More information

Chapter 12 (revised by JAS)

Chapter 12 (revised by JAS) Chapter 12 (revised by JAS) Pattern-Based Design Slide Set to accompany Software Engineering: A Practitionerʼs Approach, 7/e by Roger S. Pressman Slides copyright 1996, 2001, 2005, 2009 by Roger S. Pressman

More information

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1

Ingegneria del Software Corso di Laurea in Informatica per il Management. Design Patterns part 1 Ingegneria del Software Corso di Laurea in Informatica per il Management Design Patterns part 1 Davide Rossi Dipartimento di Informatica Università di Bologna Pattern Each pattern describes a problem which

More information

Design Patterns. CSC207 Fall 2017

Design Patterns. CSC207 Fall 2017 Design Patterns CSC207 Fall 2017 Design Patterns A design pattern is a general description of the solution to a well-established problem using an arrangement of classes and objects. Patterns describe the

More information

The Object Recursion Pattern

The Object Recursion Pattern SilverMark, Inc. woolf@acm.org OBJECT RECURSION Object Behavioral Intent Distribute processing of a request over a structure by delegating polymorphically. Object Recursion transparently enables a request

More information

SSJ User s Guide. Package stat Tools for Collecting Statistics. Version: December 21, 2006

SSJ User s Guide. Package stat Tools for Collecting Statistics. Version: December 21, 2006 SSJ User s Guide Package stat Tools for Collecting Statistics Version: December 21, 2006 CONTENTS 1 Contents Overview........................................ 2 StatProbe........................................

More information

Outline. Logistics. Logistics. Principles of Software (CSCI 2600) Spring Logistics csci2600/

Outline. Logistics. Logistics. Principles of Software (CSCI 2600) Spring Logistics  csci2600/ Outline Principles of Software (CSCI 600) Spring 018 http://www.cs.rpi.edu/academics/courses/spring18/csci600/ Konstantin Kuzmin, kuzmik@cs.rpi.edu Office hours: Monday and Thursday 4:00 pm - 5:30 pm Mailing

More information

https://www.lri.fr/~linaye/gl.html

https://www.lri.fr/~linaye/gl.html Software Engineering https://www.lri.fr/~linaye/gl.html lina.ye@centralesupelec.fr Sequence 3, 2017-2018 1/50 Software Engineering Plan 1 2 3 4 5 2/50 Software Engineering ground Evolution of Program 3/50

More information

Learning patterns of application architecture by looking at code

Learning patterns of application architecture by looking at code Proceedings of the 11th WSEAS International Conference on COMPUTERS, Agios Nikolaos, Crete Island, Greece, July 26-28, 2007 577 Learning patterns of application architecture by looking at code PAULO SOUSA

More information

Coordination Patterns

Coordination Patterns Coordination Patterns 1. Coordination Patterns Design Patterns and their relevance for Coordination Oscar Nierstrasz Software Composition Group Institut für Informatik (IAM) Universität Bern oscar@iam.unibe.ch

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 25 November 1, 2017 Inheritance and Dynamic Dispatch (Chapter 24) Announcements HW7: Chat Client Available Soon Due: Tuesday, November 14 th at 11:59pm

More information

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004

Facade and Adapter. Comp-303 : Programming Techniques Lecture 19. Alexandre Denault Computer Science McGill University Winter 2004 Facade and Adapter Comp-303 : Programming Techniques Lecture 19 Alexandre Denault Computer Science McGill University Winter 2004 March 23, 2004 Lecture 19 Comp 303 : Facade and Adapter Page 1 Last lecture...

More information

Software Design And Modeling BE 2015 (w. e. f Academic Year )

Software Design And Modeling BE 2015 (w. e. f Academic Year ) Software Design And Modeling BE 2015 (w. e. f Academic Year 2018-2019) 1 The Team Prof. Ravi Patki, I 2 IT Hinjawadi Pune Prof. Sangita Jaibhaiye SCOE Prof. D.D.Londhe PICT Prof. P. A. Joshi, ZCOER 2 The

More information

4.1 Introduction Programming preliminaries Constructors Destructors An example... 3

4.1 Introduction Programming preliminaries Constructors Destructors An example... 3 Department of Computer Science Tackling Design Patterns Chapter 4: Factory Method design pattern Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents 4.1 Introduction.................................

More information

ADAPTER. Topics. Presented By: Mallampati Bhava Chaitanya

ADAPTER. Topics. Presented By: Mallampati Bhava Chaitanya ADAPTER Presented By: Mallampati Bhava Chaitanya Topics Intent Motivation Applicability Structure Participants & Collaborations Consequences Sample Code Known Uses Related Patterns Intent Convert the interface

More information

Creating an object Instance variables

Creating an object Instance variables Introduction to Objects: Semantics and Syntax Defining i an object Creating an object Instance variables Instance methods What is OOP? Object-oriented programming (constructing software using objects)

More information

Using Design Patterns in Java Application Development

Using Design Patterns in Java Application Development Using Design Patterns in Java Application Development ExxonMobil Research & Engineering Co. Clinton, New Jersey Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S.

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 20, 2014 Abstract

More information

Computer Science II. OO Programming Classes Scott C Johnson Rochester Institute of Technology

Computer Science II. OO Programming Classes Scott C Johnson Rochester Institute of Technology Computer Science II OO Programming Classes Scott C Johnson Rochester Institute of Technology Outline Object-Oriented (OO) Programming Review Initial Implementation Constructors Other Standard Behaviors

More information

CMSC 202H. Classes and Objects: Reusing Classes with Composition

CMSC 202H. Classes and Objects: Reusing Classes with Composition CMSC 202H Classes and Objects: Reusing Classes with Composition Code Reuse Effective software development relies on reusing existing code. Code reuse must be more than just copying code and changing it

More information

Design Patterns. CSC207 Fall 2017

Design Patterns. CSC207 Fall 2017 Design Patterns CSC207 Fall 2017 Design Patterns A design pattern is a general description of the solution to a well-established problem using an arrangement of classes and objects. Patterns describe the

More information

ITI Introduction to Computing II

ITI Introduction to Computing II ITI 1121. Introduction to Computing II Marcel Turcotte School of Electrical Engineering and Computer Science Inheritance Introduction Generalization/specialization Version of January 21, 2013 Abstract

More information

Outline. Design Patterns. Observer Pattern. Definitions & Classifications

Outline. Design Patterns. Observer Pattern. Definitions & Classifications Outline Design Patterns Definitions & Classifications Observer Pattern Intent Motivation Structure Participants Collaborations Consequences Implementation 1 What is a Design Pattern describes a problem

More information

6.170 Lecture 15 Design Patterns

6.170 Lecture 15 Design Patterns Outline 6.170 Lecture 15 Design Patterns Introduction to design patterns Creational patterns (constructing objects) Structural patterns (controlling heap layout) Behavioral patterns (affecting object semantics)

More information

Using a Declarative Chain of Responsibility Pattern to Write Robust, Self- Correcting Distributed Applications

Using a Declarative Chain of Responsibility Pattern to Write Robust, Self- Correcting Distributed Applications Using a Declarative Chain of Responsibility Pattern to Write Robust, Self- Correcting Distributed Applications Dan Stieglitz Principal Consultant Stieglitech, LLC dan@stieglitech.com Abstract Businesses

More information

Automating Regression Testing of Java Programs the JSnoopy Way

Automating Regression Testing of Java Programs the JSnoopy Way Automating Regression Testing of Java Programs the JSnoopy Way Theodore S. Norvell Electrical and Computer Engineering Memorial University of Newfoundland theo@engr.mun.ca Abstract As software systems

More information

GRASP Design Patterns A.A. 2018/2019

GRASP Design Patterns A.A. 2018/2019 GRASP Design Patterns A.A. 2018/2019 Objectives Introducing design patterns Introduzione ai design pattern Designing objects and responsibilities GRASP design patterns A long corridor A passage room Does

More information

25.1 Introduction Façade Design Pattern Identification Problem Structure Participants...

25.1 Introduction Façade Design Pattern Identification Problem Structure Participants... Department of Computer Science Tackling Design Patterns Chapter 25: Façade Design Pattern Copyright c 2016 by Linda Marshall and Vreda Pieterse. All rights reserved. Contents 25.1 Introduction.................................

More information

Tuesday, October 4. Announcements

Tuesday, October 4. Announcements Tuesday, October 4 Announcements www.singularsource.net Donate to my short story contest UCI Delta Sigma Pi Accepts business and ICS students See Facebook page for details Slide 2 1 Design Patterns Design

More information

Introduction to Inheritance

Introduction to Inheritance INHERITANCE Introduction to Inheritance Inheritance is a relationship between two or more classes where derived class inherites behaviour and attributes of pre-existing (base) classes Intended to help

More information

DOWNLOAD OR READ : OBJECT ORIENTED CONCEPT INTERVIEW QUESTIONS ANSWERS PDF EBOOK EPUB MOBI

DOWNLOAD OR READ : OBJECT ORIENTED CONCEPT INTERVIEW QUESTIONS ANSWERS PDF EBOOK EPUB MOBI DOWNLOAD OR READ : OBJECT ORIENTED CONCEPT INTERVIEW QUESTIONS ANSWERS PDF EBOOK EPUB MOBI Page 1 Page 2 object oriented concept interview questions answers object oriented concept interview pdf object

More information

Introduction To Design Patterns

Introduction To Design Patterns Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios. What Is A Design Pattern? A general and reusable solution to a commonly

More information

Building Java Programs

Building Java Programs Building Java Programs Chapter 8 Lecture 8-3: Encapsulation; Homework 8 (Critters) reading: 8.3-8.4 Encapsulation reading: 8.4 2 Encapsulation encapsulation: Hiding implementation details from clients.

More information

Design Patterns: Part 2

Design Patterns: Part 2 Design Patterns: Part 2 ENGI 5895: Software Design Andrew Vardy with code samples from Dr. Rodrigue Byrne and [Martin(2003)] Faculty of Engineering & Applied Science Memorial University of Newfoundland

More information

WS01/02 - Design Pattern and Software Architecture

WS01/02 - Design Pattern and Software Architecture Design Pattern and Software Architecture: VIII. Conclusion AG Softwaretechnik Raum E 3.165 Tele. 60-3321 hg@upb.de VIII. Conclusion VIII.1 Classifications VIII.2 Common Misconceptions VIII.3 Open Questions

More information

A Proposal For Classifying Tangled Code

A Proposal For Classifying Tangled Code A Proposal For Classifying Tangled Code Stefan Hanenberg and Rainer Unland Institute for Computer Science University of Essen, 45117 Essen, Germany {shanenbe, unlandr@csuni-essende Abstract A lot of different

More information

Applying the Observer Design Pattern

Applying the Observer Design Pattern Applying the Observer Design Pattern Trenton Computer Festival Professional Seminars Michael P. Redlich (908) 730-3416 michael.p.redlich@exxonmobil.com About Myself Degree B.S. in Computer Science Rutgers

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 28 March 30, 2018 Overriding Methods, Equality, Enums, Iterators Chapters 25 and 26 Method Overriding When a subclass replaces an inherited method

More information

Design Patterns (DP) In the beginning. It s not a course about DP (just a little) A lot of good design and efficient implementation is based on DP

Design Patterns (DP) In the beginning. It s not a course about DP (just a little) A lot of good design and efficient implementation is based on DP User Interface Design 2 Design Patterns IT Uppsala University Design Patterns (DP) It s not a course about DP (just a little) A lot of good design and efficient implementation is based on DP In order to

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 32 April 5, 2013 Equality and Hashing When to override: Equality Consider this example public class Point { private final int x; private final int

More information

Design Patterns. CSC207 Winter 2017

Design Patterns. CSC207 Winter 2017 Design Patterns CSC207 Winter 2017 Design Patterns A design pattern is a general description of the solution to a well-established problem using an arrangement of classes and objects. Patterns describe

More information

Review Software Engineering October, 7, Adrian Iftene

Review Software Engineering October, 7, Adrian Iftene Review Software Engineering October, 7, 2013 Adrian Iftene adiftene@info.uaic.ro Software engineering Basics Definition Development models Development activities Requirement analysis Modeling (UML Diagrams)

More information

Patterns for polymorphic operations

Patterns for polymorphic operations Patterns for polymorphic operations Three small object structural patterns for dealing with polymorphism Alexander A. Horoshilov hor@epsylontech.com Abstract Polymorphism is one of the main elements of

More information

Alternator. An Object Behavioral Design Pattern. John Liebenau

Alternator. An Object Behavioral Design Pattern. John Liebenau Alternator An Design Pattern John Liebenau lieb@itginc.com Copyright 1999, John Liebenau. Permission is granted to copy for the PLoP 1999 conference. All other rights reserved. July 23, 1999 Page 1 1.

More information

What is Design Patterns?

What is Design Patterns? Paweł Zajączkowski What is Design Patterns? 1. Design patterns may be said as a set of probable solutions for a particular problem which is tested to work best in certain situations. 2. In other words,

More information

Design patterns. OOD Lecture 6

Design patterns. OOD Lecture 6 Design patterns OOD Lecture 6 Next lecture Monday, Oct 1, at 1:15 pm, in 1311 Remember that the poster sessions are in two days Thursday, Sep 27 1:15 or 3:15 pm (check which with your TA) Room 2244 + 2245

More information

Node. Node getleft() Returns the left Node child of this Node (might be null)

Node. Node getleft() Returns the left Node child of this Node (might be null) 2005/6 # "! $ $ Node Java# interface Node#Node Node Node Method Summary Node getleft() Returns the left Node child of this Node (might be null) Node getright() Returns the right Node child of this Node

More information

Programming Languages and Techniques (CIS120)

Programming Languages and Techniques (CIS120) Programming Languages and Techniques (CIS120) Lecture 26 March 26, 2015 Inheritance and Dynamic Dispatch Chapter 24 public interface Displaceable { public int getx(); public int gety(); public void move

More information