Adaptive Plug and Play Components for

Slides:



Advertisements
Similar presentations
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Advertisements

Architecture Representation
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
Mira Mezini Universität Siegen Dynamic Component Gluing - Runtime Integration of Concerns Dynamic Component Gluing - Runtime Integration of Concerns Linda.
© Copyright Eliyahu Brutman Programming Techniques Course.
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
SOFTWARE ENGINEERING BIT-8 APRIL, 16,2008 Introduction to UML.
1. 2 IBM connections for ingredients to adaptive plug-and-play components (APPCs) Adaptive Programming developed with support from IBM: Cun Xiao, Ignacio.
Software Engineering Chapter 8 Fall Analysis Extension of use cases, use cases are converted into a more formal description of the system.Extension.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
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.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
GoF Sections Design Problems and Design Patterns.
Design Principle & Patterns by A.Surasit Samaisut Copyrights : All Rights Reserved.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
Chapter 2 Object-Oriented Paradigm Overview. Getting Acquainted with the Class Project Read the requirements specification carefully Make note of any.
Lecture 13.  Failure mode: when team understands requirements but is unable to meet them.  To ensure that you are building the right system Continually.
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.
Basic Concepts and Definitions
From Use Cases to Implementation 1. Structural and Behavioral Aspects of Collaborations  Two aspects of Collaborations Structural – specifies the static.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
From Use Cases to Implementation 1. Mapping Requirements Directly to Design and Code  For many, if not most, of our requirements it is relatively easy.
CLASSIFICATION OF DESIGN PATTERNS Hladchuk Maksym.
Design Engineering 1. Analysis  Design 2 Characteristics of good design 3 The design must implement all of the explicit requirements contained in the.
Engineering, 7th edition. Chapter 8 Slide 1 System models.
Chapter 2 Object-Oriented Paradigm Overview
GRASP – Designing Objects with Responsibilities
Design Patterns: MORE Examples
CompSci 280 S Introduction to Software Development
Design Patterns: Brief Examples
Use Case Modeling - II Lecture # 27.
Object-Oriented Analysis and Design
Architecting Web Services
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
Chapter ? Quality Assessment
Chapter 12: Collaboration Diagram - PART2
Chapter 11 Object-Oriented Design
Chapter 1 OBJECT-ORIENTED ANALYSIS AND DESIGN
Architecting Web Services
Grid Resource Allocation Agreement Protocol Working Group
OO Methodology OO Architecture.
Distribution and components
For University Use Only
Part 3 Design What does design mean in different fields?
Software Quality Engineering
Abstract descriptions of systems whose requirements are being analysed
Demeter Aspects Who We Are Aspectual Collaborations
The Object-Oriented Thought Process Chapter 08
UML: Unified modeling language
Adaptive Plug and Play Components for
Generic Programming using Adaptive and Aspect-Oriented Programming
Chapter 1 Object-Oriented Analysis and Design. Disclaimer Slides come from a variety of sources: –Craig Larman-developed slides; author of this classic.
Software Connectors – A Taxonomy Approach
System models October 5, 2005.
ISC321 Database Systems I Chapter 10: Object and Object-Relational Databases: Concepts, Models, Languages, and Standards Spring 2015 Dr. Abdullah Almutairi.
Chapter 20 Object-Oriented Analysis and Design
An Introduction to Software Architecture
Adaptive Plug and Play Components for
Chapter 6: Structured Vs. Object Oriented Analysis and Design.
APPCs revisited 2/25/2019 APPCs revisited.
Informatics 122 Software Design II
Design Yaodong Bi.
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Information Hidding Dr. Veton Kepuska.
Chapter 6: Architectural Design
COMPONENT – BASED SOFTWARE ENGINEERING MODULE 2 – SECOND SEMESTER MKHIZE, BSC HONS COMPUTER SCIENCES, DIP IT, ICDL.
From Use Cases to Implementation
Presentation transcript:

Adaptive Plug and Play Components for Evolutionary Software Development Based on paper by Mira Mezini and Karl Lieberherr appcs.ps in my ftp directory 11/24/2018 Mezini

The Problem Object-oriented languages do not provide adequate constructs to capture collaborations between several classes. Has been recognized in different forms in the object-oriented community: OO accommodates the addition of new variants of data types better than procedural programming but, the opposite is true when new operations on existing data types are needed visitor pattern: the matter of concern -- definition of new operations on an existing object structure (aggregation is involved besides inheritance) several works complain the lack of constructs for expressing collaboration-based designs 11/24/2018 Mezini

Collaboration(Role)-Based Designs A methodology for decomposing object-oriented applications into a set of classes and a set of collaborations. Collaboration -- a distinct (relatively independent aspect of an application that involves several participants, or roles roles played by application classes each class may play different roles in different collaborations each role embodies a separate aspect of the overall class behavior 11/24/2018 Mezini

Collaboration(Role)-Based Designs Require to view oo applications in two different ways: (a) in terms of participants or types involved (b) in terms of the tasks or concerns of the design 11/24/2018 Mezini

Collaboration(Role)-Based Designs Require to view oo applications in two different ways: (a) in terms of participants or types involved (b) in terms of the tasks or concerns of the design Not supported at the language level ==> gap between implementation and design 11/24/2018 Mezini

Collaboration(Role)-Based Designs Why do we need language constructs that capture collaborations: unit of reuse is generally not a class, but a slice of behavior affecting several classes this is the core of application framework.s but: “because frameworks are described with programming languages, it is hard for developers to learn the collaborative patterns of a framework by reading it … it might be better to improve oo languages so that they can express patterns of collaboration more clearly” [R. Johnson, CACM, Sep. ‘97] 11/24/2018 Mezini

Collaboration(Role)-Based Designs Why do we need language constructs that capture collaborations: single methods often make sense in a larger context “oo technology can be a burden to the maintainer because functionality is often spread over several methods which must all be traced to get the "big picture".” [Wilde at al., Software, Jan ‘93] “object-oriented technology has not met its expectations when applied to real business applications and argues that this is partly due to the fact that there is no natural place where to put higher-level operations (such as business processes) 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 Software, April ‘98] 11/24/2018 Mezini

Language Constructs for Expressing Collaboration Requirements on the design: orthogonal to the standard object-oriented models - not substitute, rather complement classes support a decomposition granularity that lies between classes and package modules a la Oberon support parameterization of collaborations with class graph information flexible composition mechanisms to support reusing existing collaborations to build more complex collaborations 11/24/2018 Mezini

Pricing Policies Example example taken from Ian Holland’s thesis comes from the domain of order entry systems originated from an application system generator developed at IBM (‘70) called 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 customer’s specific requirements were recorded using a questionnaire the installation guide supplied with the questionnaire described the options and the consequences associated with questions on the questionnaire we consider only the pricing component of this application generator 11/24/2018 Mezini

A Collaboration Diagram for the Pricing Component PriceServerParty LineItemParty float basicPrice(ItemParty item) Integer discount(ItemParty item, Integer qty, Customer cust) quantity ItemParty Customer Float additionalCharges(Float unitPrice Integer: qty) ChargerParty ChargerParty Float cost(Integer qty, Float unitPrice, ItemParty item) Float cost(Integer qty, Float unitPrice, ItemParty item) 11/24/2018 Mezini

basicPr = pricer.basicPrice(item); discount = pricer.discount(item, qty, cust); unitPr = basicPr - (discount * basicPr); quotePr = uniPr + item.additionalCharges(unitPr, qty); return quotePr;} price() 1: basicPrice (item) 2: discount(item, qty,cust) lineItem: LineItemParty pricer: PriceServerParty 3: additionalCharges(unitPr, qty) item: ItemParty additionalCharges(…){ Integer total; forall ch in charges{ total = total + ch.cost(…)} return total} 3.1: ch=next() 3.2: cost(qty,unitPr,item) ChargerParty ch: ChargerParty ChargerParty 11/24/2018 Mezini

Pricing Policies Example design is fairly simple complexity is a problem with this application generator’s component, though: the pricing component is described in nearly twenty pages of the installation guide the complexity results from numerous, and arbitrary, pricing schemes in use by industry and by the representation of these schemes in the system 11/24/2018 Mezini

Pricing Policies with APPCs The price of an item may depend on: the type of the customer (government, educational, regular, cash, etc.), the time of the year (high/low demand season, whether cost-plus or discounting applies whether prior price negotiated prices involved, extra charges for th items such as taxes, deposits or surcharges … etc. 11/24/2018 Mezini

Language Constructs for Expressing Collaboration Requirements on the design: support parameterization of collaborations with class graph information Generic specification of the collaboration with respect to the class structure it will be applied to. This serves two purposes: (a) allow the same component to be used with several different concrete applications, and (b) allow a collaborative component to be mapped in different ways, i.e. with different class-to-participant mappings, into the same class structure. Loose coupling of behavior to structure to make collaborative components robust under changing class structures and thus better support maintenance 11/24/2018 Mezini

Language Constructs for Expressing Collaboration flexible composition mechanisms to support reusing existing collaborations to build more complex collaborations. Why? 11/24/2018 Mezini

Language Constructs for Expressing Collaboration Requirements on the design: flexible composition mechanisms to support reusing existing collaborations to build more complex collaborations. Why? Loose coupling among collaborations in the sense that their definition do not make explicit commitments to a particular structure of composition. The aim is to facilitate putting the same components into several compositions in a flexible manner. A composition mechanism that maintains the ``encapsulation'' and independence of collaborations when involved in compositions with other components. The aim is to avoid name conflicts and allow simultaneous execution of several collaborations even if these may share a common ``parent''’. 11/24/2018 Mezini

Pricing Policies with APPCs APPC Pricing Interface-to-Class-Structure Interface-to-Class-Structure: s1 = from lineItem: LineItemParty to item: ItemParty to charges: ChargesParty; s2 = from lineItem: LineItemParty to pricer: PricerParty; s3 = from lineItem: LineItemParty to customer: Customer; PricerParty [ Float basicPrice(ItemParty item); Integer discount(ItemParty item, Integer qty, Customer: customer); ] ChargesPart [ Float cost(Integer qty, Float unitP, ItemParty: item ); ] 11/24/2018 Mezini

Pricing Policies with APPCs APPC Pricing Behavior LineItemParty { public Float price (Integer qty ){ Float basicPrice, unitPrice; Integer discount; basicPrice = pricer.basicPrice(); discount = pricer.discount(item, qty, customer); unitPrice = basicPrice - (discount * basicPrice); return (unitprice + additionalCharges(unitPrice, qty)); } Float additionalCharges(float unitP, Integer qty) { Interger total = 0; during s1 { ChargesParty{total += cost(qty, unitP, item); } return total;} } } 11/24/2018 Mezini

Pricing Policies with APPCs Appl.cd HWProduct: <price> float <salePrice> float <taxes> {Tax} <discountTable> Table Tax: <percentage> float; Quote: <prod> HWProduct <quanttity> Integer <cust> Customer; Customer: <name> String …; 11/24/2018 Mezini

Pricing Policies with APPCs Appl.beh class HWProduct { float salePrice() {return salePrice}; float saleDiscount(Integer qty Customer c) {return 0}; float regular-price() {return price}; float regDiscount(HWProduct prod Integer qty Customer c) {return discountTable.lookUp(qty)}; } class Tax { float taxChange(Integer qty, float unitP HWProduct p) {unitPrice * percentage /100}} class Quote { integer quantity() {return quantity}; class Customer { float negProdPrice(HWProduct p) {…}; float regProdDiscount(HWProduct p Integer qty Customer c) {…} } 11/24/2018 Mezini

11/24/2018 Mezini

Pricing Policies with APPCs Let us generate different pricing schemes out of the generic pricing component specified by the pricing adjuster … Scheme 1: Regular Pricing each product has a base price which can be discounted depending on the number of the units ordered Scheme 2: Negotiated Pricing: A customer may have negotiated certain prices and discounts for particular items 11/24/2018 Mezini

Pricing Policies with APPCs Scheme 1: Regular Price Quote::+ {float regPrice() = Pricing with { LineItemParty = Quote; PriceParty = HWProduct [basicPrice = regPrice; discount = regDiscount;] ItemParty = HWProduct; ChargesParty = Tax [cost = taxCharge] } Let see what this is supposed to generate: 11/24/2018 Mezini

Pricing Policies with APPCs class Quote { …. public regPrice() { RegularPriceVisitor v = RegularPriceVisitor(); return {v.price (this);} } 11/24/2018 Mezini

Pricing Policies with APPCs class RegularPriceVisitor { public price (Quote host) { float basicPrice, quotePrice; Integer discount; Integer qty; qty = host.quantity(); basicPrice = host.prod.regPrice(); discount = host.prod.regDiscount(host.prod, qty, host.customer); unitPrice = basicPrice - (discount * basicPrice); return (unitPrice +.additionalCharges(unitPrice, qty); } private additionalCharges(float unitPrice, Integer qty) { float total = 0; for all tax in host.prod.taxes total = total + tax.taxCharge(float unitPrice, Integer qty) 11/24/2018 Mezini

Pricing Policies with APPCs Scheme 2: Negotiated Price Quote::+ {Float negPrice() = Pricing with { LineItemParty = Quote; PriceParty = Customer [basicPrice = negProdPrice; discount = negProdDiscount;] ItemParty = HWProduct; \\ ChargesParty = Tax\\ [cost = taxCharge] } 11/24/2018 Mezini

Composing APPCs APPC Marking { Interface s = from Graph to Adjacency to Vertex to Adjacency Behavior Adjacency { bool marked = false; myRole() { bool visited = marked; if (marked == false) { marked = true; next()}; return visited;} } 11/24/2018 Mezini

Composing APPCs APPC Connectivity { Interface s: from Graph to-stop Adjacency Behavior Integer count = 0; return count; Adjacency { myRole() { if ( next() == false ) { count += 1; } } } 11/24/2018 Mezini

Composing APPCs APPC DGCycleCheck { Interface s = from Graph to Adjacency to Vertex to Adjacency Behavior Stack stack = Stack new(); Adjacency { myRole() { if (stack.includes(this)) { System.out.printIn(``cycle'' + stack.print) } else { stack.add(this); } next(); stack.remove(this); } } 11/24/2018 Mezini

Composing APPCs Want to do connectivity and cycle check simultaneously 11/24/2018 Mezini

Instantiating APPCs Compositions ConnectivityAndCycleCheck = (Connectivity compose DGCycleCheck) (Marking) s = Network via Adjacency through neighbors via Node through <-source to Adjacency Network ::+ {connectivityAndCycleCheck() = ConnectivityAndCycleCheck(s} with {Network = Graph; Node = Vertex; } 11/24/2018 Mezini

APPCs Compositions 11/24/2018 Mezini