1 2 Z C1 C2 C3 C4 C5 Collab-1 Collab-2Collab-3 Collab-4 OOAD Implementation C1 C2 C3 C4 C5 No language constructs that capture collaborations.

Slides:



Advertisements
Similar presentations
Parametric Aspects. A way to design-pattern implementation (...and others)? Jordi Alvarez Open University of Catalonia Barcelona - Spain
Advertisements

Giving a formal meaning to “Specialization” In these note we try to give a formal meaning to specifications, implementations, their comparisons. We define.
Mira Mezini Universität Siegen Dynamic Component Gluing - Runtime Integration of Concerns Dynamic Component Gluing - Runtime Integration of Concerns Linda.
Liang,Introduction to Java Programming,revised by Dai-kaiyu 1 Chapter 10 Object-Oriented Modeling.
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
UML CASE Tool. ABSTRACT Domain analysis enables identifying families of applications and capturing their terminology in order to assist and guide system.
1 CS1001 Lecture Overview Object Oriented Design Object Oriented Design.
CS 2511 Fall  Abstraction Abstract class Interfaces  Encapsulation Access Specifiers Data Hiding  Inheritance  Polymorphism.
Developed by Reneta Barneva, SUNY Fredonia Component Level Design.
Generative Programming. Generic vs Generative Generic Programming focuses on representing families of domain concepts Generic Programming focuses on representing.
INTRODUCTION TO JAVA PROGRAMMING Chapter 1. What is Computer Programming?
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Classes in C++ Bryce Boe 2012/08/15 CS32, Summer 2012 B.
PPL Syntax & Formal Semantics Lecture Notes: Chapter 2.
Inheritance using Java
Design Patterns.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Implementation Yaodong Bi. Introduction to Implementation Purposes of Implementation – Plan the system integrations required in each iteration – Distribute.
1. 2 IBM connections for ingredients to adaptive plug-and-play components (APPCs) Adaptive Programming developed with support from IBM: Cun Xiao, Ignacio.
Aspect Oriented Programming (AOP) in.NET Brent Krueger 12/20/13.
Demeter Interfaces: AP without Surprises Prof. Karl Lieberherr and Therapon Skotiniotis, Jeffrey Palm.
©Ian Sommerville 2000 Software Engineering, 6th edition. Slide 1 Component-based development l Building software from reusable components l Objectives.
Integrating Independent Components with On-Demand Remodularization based on OOPSLA 2002 paper by Mira Mezini Klaus Ostermann Prepared by Karl Lieberherr.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Unified Modeling Language, Version 2.0
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
Design Patterns. Patterns “Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution.
Object-Oriented Modeling Chapter 10 CSCI CSCI 1302 – Object-Oriented Modeling2 Outline The Software Development Process Discovering Relationships.
University of Southern California Center for Systems and Software Engineering Model-Based Software Engineering Supannika Koolmanojwong Spring 2013.
Generative Programming. Automated Assembly Lines.
GoF Sections Design Problems and Design Patterns.
Chapter 8 Object Design Reuse and Patterns. Object Design Object design is the process of adding details to the requirements analysis and making implementation.
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
Demeter Interfaces: AP without Surprises Prof. Karl Lieberherr and Therapon Skotiniotis, Jeffrey Palm.
Advanced Object-Oriented Design Patterns and Architectures Part One COEN396A John Xiao
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 11 Object-Oriented.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Object-Oriented Design.
The State Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Analysis Yaodong Bi. Introduction to Analysis Purposes of Analysis – Resolve issues related to interference, concurrency, and conflicts among use cases.
The Strategy Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
 2001 Lodewijk Bergmans University of Twente Pattern Languages.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
AOP/cross-cutting What is an aspect?. An aspect is a modular unit that cross-cuts other modular units. What means cross-cutting? Apply AOP to AOP. Tease.
UML Course Instructor: Rizwana Noor. Overview  Modeling  What is UML?  Why UML?  UML Diagrams  Use Case  Components  Relationships  Notations.
Banaras Hindu University. A Course on Software Reuse by Design Patterns and Frameworks.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Testing in OO Environment The reasons for testing is not any different for any of the design and implementation methodologies, including OO methodology.
Kyung Hee University Class Diagramming Notation OOSD 담당조교 석사과정 이정환.
Object Oriented Programming and Data Abstraction Earl Huff Rowan University.
Lecture 2 Intro. To Software Engineering and Object-Oriented Programming (1/2)
SE 510 Principles and Applications of Software Design Aspect Oriented Programming October 5, 2005 Jeff Webb.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Design Patterns: MORE Examples
Design Patterns: Brief Examples
Design Patterns Lecture part 2.
Chapter 11 Object-Oriented Design
Demeter Aspects Who We Are Aspectual Collaborations
Adaptive Plug and Play Components for
Generic Programming using Adaptive and Aspect-Oriented Programming
Creating and Using Classes
Lecture 6 Project review
ADAPTIVE PROGRAMMING Sezen ERDEM December 2005.
Adaptive Plug and Play Components for
Object Oriented Analysis and Design
Adaptive Plug and Play Components for
CIS601: Object-Oriented Programming in C++
Chapter 6: Programming Languages
APPCs revisited 2/25/2019 APPCs revisited.
What Is Good Software(Program)?
Informatics 122 Software Design II
Presentation transcript:

1

2 Z C1 C2 C3 C4 C5 Collab-1 Collab-2Collab-3 Collab-4 OOAD Implementation C1 C2 C3 C4 C5 No language constructs that capture collaborations

3 “OO technology has not met its expectations when applied to real business applications partly due to the fact that there is no place where to put higher-level operations which affect several objects. … if built into the classes involved, it is impossible to get an overview of the control flow. It is like reading a road map through a soda straw'’ [Lauesen, IEEE Software, April ‘98]

4 Unit of reuse is generally not a class, but a slice of behavior affecting several classes Unit of reuse is generally not a class, but a slice of behavior affecting several classes ¶ Unit of encapsulation beyond single objects  Late binding beyond single classes

5 C1 C2 C3 C4 C5 Both difficult without constructs that capture collaborations

6 During implementation separate collaborations are mixed together During maintenance individual collaborations need to be factored out of the tangled code

7 Isn’t that at the core of application frameworks? Isn’t that at the core of application frameworks? Unit of reuse is generally not a class, but a slice of behavior affecting several classes Unit of reuse is generally not a class, but a slice of behavior affecting several classes

8 “because frameworks are described with programming languages, it is hard to learn the collaborative patterns of a framework by reading it … it might be better to improve oo languages so that they can express collaborations more clearly” [ Johnson, CACM, Sep. ‘97] Indeed, but...

9 C1 C2 C3 C4 C5 So, what? Forget about objects?

10 Let’s organize. Let’s have components on top of them. If we don’t follow certain principles, we easily end up with “hyper spaghetti’’ objects No. The point is merely that objects are too low-level.

11 C1 C2 C3 C4 C5 P1 P2 P3 C1 C3 C2 C4 APPL 1 n

12 origine: an application generator from IBM (‘70) Hardgoods Distributors Management Accounting System goal: encode a generic design for order entry systems which could be subsequently customized to produce an application meeting a customer’s specific needs

13 LineItemParty PriceServerParty ItemParty quantity float basicPrice(ItemParty item) Integer discount(ItemParty item, Integer qty, Customer cust) Float additionalCharges(Float unitPrice Integer: qty) Customer ChargerParty Float cost(Integer qty, Float unitPrice, ItemParty item)

14 lineItem: LineItemParty pricer: PriceServerParty item: ItemParty price() 1: basicPrice (item) 2: discount(item, qty,cust) 3: additionalCharges(unitPr, qty) ch: ChargerParty ChargerParty 3.1: ch=next() 3.2: cost(qty,unitPr,item) additionalCharges(…){ Integer total; forall ch in charges{ total = total + ch.cost(…)} return total} price() { basicPr = pricer.basicPrice(item); discount = pricer.discount(item, qty, cust); unitPr = basicPr - (discount * basicPr); quotePr = uniPr + item.additionalCharges(unitPr, qty); return quotePr;} design applies to several applications with different classes playing the participant roles

15 C1 C2 C3 C4 C5 P1 P2 P3 APPL 1 1 C2 C3 C4 C5 C1

16 * need to represent several pricing schemes: discounts depending on the number of ordered units, pre-negotiated prices possible, depending on the time of the year (high/low season), … etc. with the same role played by different classes in different schemes

17 written to the ICG similar to an OO program written to a concrete class graph expected interfaces minimal assumptions on application structure + P1 P P3 main-entry... meth 3,1... P2 P3 meth 3,j meth 1,k meth 1,1 main control flow of the collaboration

18 APPC Pricing { Interface Class Graph: // structural interface ==> textual representation of UML // class diagram LineItemParty = ItemParty PricerParty Customer ItemParty = ListOf(ChargerParty) // behavioral interface ==> set of expected interfaces LineItemParty { int quantity();} PricerParty { float basicPrice(ItemParty item); float discount(ItemParty item, int qty, Customer customer); } ChargerParty { float cost(int qty, float unitP, ItemParty item); }

19 Behavior Definition : int qty; float unitPprice ; //local variables LineItemParty { main-entry float price() { float basicPrice, int discount; qty = this.quantity(); basicPrice = pricer.basicPrice(item); discount = pricer.discount(item, qty, customer); unitPrice = basicPrice - (discount * basicPrice); return (unitPrice + item.additionalCharges());} } ItemParty { private float additionalCharges() { float total; while (charges.hasElement()) { nextCharge = chargerParties.next(); total =+ charge.cost(qty, unitP, this); return total; } }

20 P1 main-entry m 1,1 m 1,k... P2 P3 participant-to-class name map expected interface name map link-to-paths map

21 HWProductQuote cust Customer Tax prod taxes Tax Pricing APPC HWAppl::+ {float regularPrice () = Pricing with { LineItemParty = Quote; PricerParty = HWProduct { basicPrice = regPrice; discount = regDiscount }; ItemParty = HWProduct; ChargerParty = Tax ;}

22 HWProduct Quote cust Customer Tax prod taxes Tax Pricing APPC HWAppl::+ {float negotiatedPrice () = Pricing with { LineItemParty = Quote; PricerParty = Customer { basicPrice = negProdPrice; discount = negProdDiscount }; ItemParty = HWProduct; ChargerParty = Tax;}

23 higher-level collaboration lower-level collaboration

24 P1 P2 P3 P1 P6 P2 P5 P3 P4 P1 P2

25

26

27 LineItemParty float price() LineItemParty float price() OrderParty :OrderParty :LineItemParty lineItem :LineItemParty 1:lineItem = next() 2: price() total() may be any of the pricing schemes

28 Expected interface of one APPC mapped to main entry of another APPC. APPC Total { Interface-Class-Graph: OrderParty = Customer SetOf(LineItemParty) LineItemParty { float price(); } Behavior-Definition: OrderParty { main-entry float total() {... while lineItems.hasElements()) { total += nextLineItem.price(); } return total; } } HWAppl ::+ {float totalReg = Total with { OrderParty = Order; LineItemParty = Quote { price = regularPrice }; } Pricing APPC HWAppl::+ {float regularPrice () = Pricing with {... }

29 refinement base collaboration incrementally refine entire collaborations similar to individual classes

30 3.1: ch=next() lineItem: LineItemParty pricer: PriceServerParty item: ItemParty price()1: basicPrice (item) 2: discount(item, qty,cust) 3: additionalCharges(unitPr, qty) ch: ChargerParty ChargerParty 3.2: cost(qty,unitPr,item) price() { discount = pricer.discount(item, qty, cust); unitPr = basicPr - (discount * basicPr); return quotePr;} 4. stockTime 5. stockTimeLimit if (item.stockTime() > item.stockTimeLimit() {quotePr := quotePr - quotePr * 0.1;}

31 price() { basicPr = pricer.basicPrice(item);... return quotePr;} lineItem: LineItemParty pricer: PriceServerParty item: ItemParty price() 1: basicPrice (item) 2: discount(item, qty,cust) 3: additional Charges(unitPr, qty) ch: ChargerParty ChargerParty 3.1: ch=next()3.2: cost(qty,unitPr,item) 4. history() 5. freqReduction() if (customer.frequent()) { hist = customer.get History(); freqRed = item.freqReduction(hist); quotePr = quotePr * freqRed} customer: Customer

32 refinement (a) reuse refinements with different bases base collaboration

33 refinement base collaboration (a) reuse refinements with different bases

34 (b) combine several refinements of the same base without conflicts base collaboration refinement

35 Pricing AgingPricing FrequentCustomer Pricing Aging&FrequentCustomer Pricing

36 AgingPricing modifies Pricing { ¶ mixin-like behavior definition LineItemParty { price() { super.price(); reducedPrice (...); } reducedPrice (...); } } super not statically bound super not statically bound

37 ¶ mixin-like behavior definition (late binding of super) Pricing APPC AgingPricing modifies Pricing { price() {... super...} } AgingPricing modifies Pricing { price() {... super...} } FrequentPricing modifies Pricing { price() {... super...} } Pricing APPC

38 · static declaration of the assumed specialization interface Pricing APPC AgingPricing modifies Pricing { price() {... super reducedPrice} reducedPrice(); } FrequentPricing modifies Pricing { price() {... super reducedPrice } reducedPrice() }

39 Generic collaborations that can be reused with a family of applications Decoupled black-box composition of collaborations Larger-grained constructs that complement classes in modeling collaborations Definition of new collaborations as refinements of other collaborations

40 Formal semantics Library of APPCs to investigate their suitability in supporting component-oriented programming Separate compilation and Java Beans as underlying implementation technology

41 Adaptive Programming Rondo APPCs visitor pattern (GOF) role modeling with template classes (VanHilst & Notkin) mixin-layers (Smaragdakis & Batory) contracts (Holland) SOP (Harrison & Ossher) AOP (Kiczales & Lopes):

42