University of Twente Meta Patterns Common Principles behind Design Patterns & OO Frameworks Lodewijk M.J. Bergmans.

Slides:



Advertisements
Similar presentations
Design Patterns.
Advertisements

Object-Oriented Application Frameworks Much of the cost and effort stems from the continuous re- discovery and re-invention of core concepts and components.
1 Copyright 1998 by Dragos Manolescu and Joseph W. Yoder Building Frameworks With Patterns “An Active Object-Model For A Dynamic Web-Based Application”
Framework is l Reusable Code, often domain specific (GUI, Net, Web, etc) l expressed as l a set of classes and l the way objects in those classes collaborate.
Design Patterns Introduction What is a Design Pattern? Why were they developed? Why should we use them? How important are they?
COP 3331 Object Oriented Analysis and Design Chapter 7 – Design by Abastraction Jean Muhammad.
Design Patterns for Object Oriented systems CSC 515 Ashwin Dandwate.
2 Object-Oriented Analysis and Design with the Unified Process Objectives  Explain how statecharts can be used to describe system behaviors  Use statecharts.
Page 1 Building Reliable Component-based Systems Chapter 16 - Component based embedded systems Chapter 16 Component based embedded systems.
Introduction To System Analysis and Design
1 CS 426 Senior Projects Chapter 19: Interfaces and Components [Arlow & Neustadt 2005] February 28, 2008.
Chapter 8, Object Design Introduction to Design Patterns
Copyright © Active Frameworks, Inc.. - All Rights Reserved - V2.0 Introduction - Page L1-1 PS95&96-MEF-L1-1 Dr. M.E. Fayad Creationa l Paradigm.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Feb. 23, 2004CS WPI1 CS 509 Design of Software Systems Lecture #5 Monday, Feb. 23, 2004.
Dept. of Computer Engineering, Amir-Kabir University 1 Design Patterns Dr. Noorhosseini Lecture 2.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Design Patterns.
Software Issues Derived from Dr. Fawcett’s Slides Phil Pratt-Szeliga Fall 2009.
Reuse Activities Selecting Design Patterns and Components
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Product Line Annotations with UML-F Wolfgang Pree Software Research Lab Univ. of Salzburg Austria Marcus Fontoura IBM Almaden Research, San.
OO Frameworks Department of Computer Science Kent State University.
COMP 121 Week 02. Agenda Review this week’s expected outcomesReview this week’s expected outcomes Review Guided Learning Activity solutionsReview Guided.
Design Patterns.
Design Patterns OOD. Course topics Design Principles UML –Class Diagrams –Sequence Diagrams Design Patterns C#,.NET (all the course examples) Design Principles.
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Unified Modeling Language, Version 2.0
Introduction To System Analysis and Design
R R R 1 Frameworks III Practical Issues. R R R 2 How to use Application Frameworks Application developed with Framework has 3 parts: –framework –concrete.
Architectural Design Identifying system components and their interfaces.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns IX Interpreter, Mediator, Template Method recap.
University of Twente Analysis Patterns. University of Twente Software Reuse  Reuse is difficult and expensive Often does not pay off (quickly) Because.
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
CSE 403, Spring 2008, Alverson Software Design “There are two ways of constructing a software design: one way is to make it so simple that there are obviously.
Part VII: Design Continuous
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
Object Oriented Programming
Advanced Object-Oriented Design Patterns and Architectures Part One COEN396A John Xiao
1 Chapter 5:Design Patterns. 2 What are design pattern?  Schematic description of design solution to recurring problems in software design and,  Reusable.
Chapter 19: Interfaces and Components [Arlow and Neustadt, 2005] University of Nevada, Reno Department of Computer Science & Engineering.
Design Patterns Introduction “Patterns are discovered, not invented” Richard Helm.
1 Unified Modeling Language, Version 2.0 Chapter 2.
Developing Product Line Components Jan Bosch Professor of Software Engineering University of Groningen, Netherlands
Design Patterns in Context ©SoftMoore ConsultingSlide 1.
CHAPTER 3 MODELING COMPONENT-LEVEL DESIGN.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 15. Review Interaction-Oriented Software Architectures – MVC.
 2001 Lodewijk Bergmans University of Twente Pattern Languages.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
(c) University of Washington05-1 CSC 143 Java Abstract Classes and Frameworks Reading: Ch. 11.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
1 Good Object-Oriented Design Dr. Radu Marinescu Lecture 4 Introduction to Design Patterns.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Design Patterns: MORE Examples
Chapter 10 Design Patterns.
Introduction to Design Patterns
lecture 08, OO Design Principle
Object-Oriented Design
Chapter 19: Interfaces and Components
Chapter 8, Design Patterns Introduction
Interfaces and Components
Presentation transcript:

University of Twente Meta Patterns Common Principles behind Design Patterns & OO Frameworks Lodewijk M.J. Bergmans

University of Twente IntroductionIntroduction This presentation is based on the work of Wolfgang Pree:  "Design Patterns for OO Software Development" (book)  "Meta Patterns - A Means for Capturing the Essentials of Reusable Object-Oriented Design" (ECOOP '94) Meta patterns describe a few generic structures and techniques that are repeatedly found in design patterns Relation to (GoF) design pattern catalog: vThese are solutions to design problems when attempting to construct flexible & adaptable frameworks vPree calls these: 'framework example design patterns'

University of Twente Hot spots a framework consists of two parts: va fixed, generic architecture of domain-knowledge  independent of specific applications vflexible, application-specific parts (hot spots)  ready as a library, or defined by the application programmer framework architecture: fixed part, (application-independent) hot spots: flexible parts, (application-tailorable)

University of Twente Template & Hook methods Template method: vdefines the fixed part vcalls the hook methods vimplements generic domain knowledge Hook method: vthe flexible part; to be (re-)defined vimplements application-specifics vcan be abstract method A (non-abstract) hook method can be again a template method itself mtmh1mh2 C1::mt C1::mh1 C1::mh2 C1

University of Twente Applying Templates & Hooks –1  Through subclassing: introduce a subclass C2 that (re-)defines method mh1 other hot spots (e.g. mh2) can be redefined as well adaptation without modifying the class C1::mt C1::mh2 mtmh1mh2 C1 C2 C2::mh1

University of Twente Applying Templates & Hooks –2  By invocation on another class classes interact through a fixed protocol ('contract') template method calls hook methods on another object different objects are possible through polymorphism this also allows for dynamic adaptation mtmh1mh2 C1C3 C4 ref... ref mh1.... ref mh2.

University of Twente Narrow Inheritance-Interface Principle We want a framework to be as flexible as possible: But the 'narrow inheritance-interface principle' (NIIP) says: vmake the adaptation interface as simple as possible

University of Twente Narrow Inheritance Interface Principle -2 NIIP attempts to: vavoid problems of white-box reuse vreduce effort in instantiating and adapting framework When invoking hook methods on another object: v'Narrow Calling Interface Principle' applies; minimize coupling by keeping protocols simple vbut because this is black box reuse (of the template class), this is less severe

University of Twente Composition Meta Patterns: Overview TH hook 1:1 Connection Pattern TH hooks 1:N Connection Pattern T H hook 1:1 Recursive Connection Pattern T H hooks 1:N Recursive Connection Pattern THhook 1:1 Recursive Unification Pattern THhook 1:N Recursive Unification Pattern TH Unification Pattern

University of Twente Exercise -1  Find the meta-patterns in the Bridge Pattern RefinedAbstr operation... Abstraction ConcrImpl1 operation Impl... Implementor ConcrImpl2 operationImpl... RefinedAbstr... impl impl operationImpl.... bridge operationImpl...

University of Twente Exercise-2Exercise-2  Find the meta-patterns in the Composite Pattern: Component{abstract} operation addComponent: removeComponent: getComponent: Composite operation addComponent: removeComponent: getComponent: components components do: [c | c operation. ] Client Leaf operation

University of Twente ConclusionsConclusions a framework should... vinclude a layer/part of domain knowledge that always applies.  this part is fixed and requires no hooks! vdefine hook methods and hook components for extending this layer with application-specific behavior  the hot spots... vadd domain knowledge by enforcing constraints on the (substituted) hooks  by explicit checks & subtyping  through interaction protocols vonly a few (OO) techniques for Template-Hook composition