Reuse la nivel arhitectural. Copy-paste “reuse” P1 P2 P3 P4 Copy-paste Copy-paste+modificari Dezavantaj: conduce la duplicare de cod => imposibil de intretinut,

Slides:



Advertisements
Similar presentations
Component-Based Software Engineering Main issues: assemble systems out of (reusable) components compatibility of components.
Advertisements

ARCHITECTURES FOR ARTIFICIAL INTELLIGENCE SYSTEMS
Ch:8 Design Concepts S.W Design should have following quality attribute: Functionality Usability Reliability Performance Supportability (extensibility,
Domain Engineering Silvio Romero de Lemos Meira
Chapter 4 Quality Assurance in Context
Basic Concepts in Component-Based Software Engineering
OASIS Reference Model for Service Oriented Architecture 1.0
Rational Unified Process
Page 1 Building Reliable Component-based Systems Ivica Crnkovic Chapter 9 Component Composition and Integration.
DAIMIHenrik Bærbak Christensen1 Product Lines Architectural Reuse.
- 1 - Component Based Development R&D SDM Theo Schouten.
1 FM Overview of Adaptation. 2 FM RAPIDware: Component-Based Design of Adaptive and Dependable Middleware Project Investigators: Philip McKinley, Kurt.
Course Instructor: Aisha Azeem
Architectural Design Establishing the overall structure of a software system Objectives To introduce architectural design and to discuss its importance.
Software Product Line Architectures (SPLA) Nipun Shah
Architecture and Software Product Lines A software architecture represents a significant investment of time and effort, usually by senior talent. So it.
Domain-Specific Software Engineering Alex Adamec.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 11 Slide 1 Architectural Design.
Computer Systems & Architecture Lesson Software Product Lines.
Component-Based Software Engineering (CBSE) Speaker: Jerry Gao Ph.D. San Jose State University URL:
Architectural Mismatch or Why it’s hard to build systems out of existing parts.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse 2.
Problems with reuse – Increased maintenance costs; lack of tool support; not-invented- here syndrome; creating, maintaining, and using a component library.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 18 Slide 1 Software Reuse.
Software Engineering Muhammad Fahad Khan
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 14Slide 1 Design with Reuse l Building software from reusable components.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 19 Slide 1 Component-based software engineering 1.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Chapter 10 Architectural Design.
An Introduction to Software Architecture
Software Models (Cont.) 9/22/2015ICS 413 – Software Engineering1 -Component-based software engineering -Formal Development Model.
Software Architecture – An Overview The software architecture of a system is the composition of software components, the structures that interconnect them,
 To explain the importance of software configuration management (CM)  To describe key CM activities namely CM planning, change management, version management.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 07. Review Architectural Representation – Using UML – Using ADL.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
By Xiangzhe Li Thanh Nguyen.  Introduction  Terminology  Architecture  Component  Connector  Configuration  Architectural Style  Architectural.
Design engineering Vilnius The goal of design engineering is to produce a model that exhibits: firmness – a program should not have bugs that inhibit.
1 Computer Systems & Architecture Lesson Building Systems from Off-the-Shelf Components.
 Repository Model  Client-Server Model  Layered Model  Modular decomposition styles  Object Models  Function Oriented Pipelining  Control Styles.
Software Product Line Material based on slides and chapter by Linda M. Northrop, SEI.
07/09/04 Johan Muskens ( TU/e Computer Science, System Architecture and Networking.
FDT Foil no 1 On Methodology from Domain to System Descriptions by Rolv Bræk NTNU Workshop on Philosophy and Applicablitiy of Formal Languages Geneve 15.
Distribution and components. 2 What is the problem? Enterprise computing is Large scale & complex: It supports large scale and complex organisations Spanning.
Chapter 6 – Architectural Design Lecture 1 1Chapter 6 Architectural design.
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Review of Parnas’ Criteria for Decomposing Systems into Modules Zheng Wang, Yuan Zhang Michigan State University 04/19/2002.
Slide 1 Service-centric Software Engineering. Slide 2 Objectives To explain the notion of a reusable service, based on web service standards, that provides.
Software Reuse Course: # The Johns-Hopkins University Montgomery County Campus Fall 2000 Session 4 Lecture # 3 - September 28, 2004.
Architectural Mismatch: Why reuse is so hard? Garlan, Allen, Ockerbloom; 1994.
LECTURE 5 Nangwonvuma M/ Byansi D. Components, interfaces and integration Infrastructure, Middleware and Platforms Techniques – Data warehouses, extending.
Software Reuse. Objectives l To explain the benefits of software reuse and some reuse problems l To discuss several different ways to implement software.
Chapter 17 - Component-based software engineering
Java Beans Sagun Dhakhwa.
Distribution and components
Chapter 25: Architecture and Product Lines
Chapter 16 – Software Reuse
Paxos Made Simple Autor: Puşcaş Radu George
Architecture with Components
Chapter 5 Designing the Architecture Shari L. Pfleeger Joanne M. Atlee
Software open source in industria software
Sistemul de control intern managerial
Software Architecture in Practice
An Introduction to Software Architecture
Chapter 7 –Implementation Issues
Architecture with Components
Chapter 17 - Component-based software engineering
Chapter 16 – Software Reuse
Architectural Mismatch: Why reuse is so hard?
Presentation transcript:

Reuse la nivel arhitectural

Copy-paste “reuse” P1 P2 P3 P4 Copy-paste Copy-paste+modificari Dezavantaj: conduce la duplicare de cod => imposibil de intretinut, mai ales daca fiecare produs evolueaza ulterior independent Exemplu: a fost copiat in P2, P3 si P4. In P2 si P4 a fost si modificat. La un moment ulterior, acest element trebuie actualizat, din diferite posibile motive (descoperire bug, evolutie platforma hw, inlocuire biblioteca de care depinde, etc.) => 4 proiecte diferite in care trebuie efectuata modificarea si testarea ! Observatie: La Tema2, aprox 60% dintre studenti au optat pentru aceasta modalitate de “reuse” !!!!

Product Line reuse P1P2P3P4 Reusable core assets

Software Product Lines Definitie: –“A set of software-intensive systems sharing a common, managed set of features that satisfy the specific needs of a particular market segment or mission, and that are developed from a common set of core assets in a prescribed way. “ [Bass] Motivatie: –Pentru o familie de sisteme, avantajele sunt: Reducerea costului mediu de productie per produs din familie Reducerea timpul mediu de lansare a unui nou produs din familie –Exemple de succes cu Software Product Lines [Bass]: Nokia: de 7 ori mai multe modele de telefoane noi pe an HP: crestere a productivitatii de 6 ori, scaderea timpului mediu de lansare a unui nou produs de 7 ori

Ce se reutilizeaza ? Design Artifacts –Requirements –Architectural design –Elements (code) –Modeling and analysis –Testing Project Artifacts –Project planning –Processes, methods, and tools –People –Exemplar systems –Defect elimination Reusable Core Assets for a Product Line

Scoping Scope of a Product Line: defineste ce produse fac parte din familie si care nu Scoping: bazat pe predictii: ce produse va dezvolta in viitorul previzibil Strategii: –Narrow scoping: numar redus de puncte de variabilitate –Broad scoping: numar mare de puncte de variabilitate Problema esentiala rezolvata de scoping: gasirea acelor elemente comune (commonalities) care pot contribui la reducerea costurilor de productie pentru intreaga familie –Nu orice elemente comune merita sa fie facute parte din core: Exemplu: Philips: linii de productie diferite pentru video electronic systems si digital video communication: diferentele existente intre cerintele celor 2 categorii de clienti au condus la concluzia ca sunt mai eficiente abordari separate

Proiectarea arhitecturala pentru o Product Line Mai mult decat proiectarea arhitecturala a unui singur sistem: –arhitectura face parte din reusable core assets –Trebuie sa identifice asemanarile si diferentele intre membrii familiei in urmatoarele aspecte: behavior, quality attributes, platform, network, physical configuration, middleware, scale factors, etc. –Variation points: de regula, variabilitatea este limitata in cadrul unei familii la anumite puncte fixe unde se poate alege din mai multe alternative; Un membru al familiei este definit de combinatia de alternative selectate pentru toate variation points. Rolul proiectarii arhitecturale intr-o Product Line: –Identificarea de variation points –Suport pentru implementarea variation points –Evaluarea aspectelor care se preteaza pentru abiordare de tip Software Product Line

Identificarea Variation Points Activitate continua, noi variation points pot apare si dupa ce o prima varianta a fost implementata Tipuri de variatii suportate: –Features, platforms, user interfaces, qualities, target markets Variation points: independente sau legate unele de altele (de ex: tipul de user interface poate depinde de platforma, care poate depinde de target market) Pentru identificarea si modelarea variation points: este util un model deasupra arhitecturii, model care tine de domeniul problemei rezolvate de familia de programe: Domain Engineering -> Feature Modelling

Variability & commonality Example: Enchilada Product Line Enchilada GarnishTortilla Sauce Filling Tortilla Sauce Filling RedGreenPork BeefChicken or xor Mandatory features Optional features Alternative features covered with wrapped around Domain engineering -> Feature tree: Base architecture Product engineering -> Core assets: Base architecture Common components

Suport pentru implementarea Variation Points 1. Suport arhitectural –Includerea sau omiterea unor elemente Mecanisme: controlul procesului de build, compilare conditionata –Includerea unui numar diferit de elemente replicat Mecanisme: de ex, pentru o versiune high-capacity a unui produs, la build se vor include automat mai multe replici ale unui anumit server –Selectia unor versiuni diferite de elemente care au aceleasi interfete dar realizeaza diferite nivele ale atributelor de calitate Mecanisme: Compile / build / runtime 2. Modificari in codul sursa –Specializarea sau generalizarea unor clase 3. Suport general pentru variabilitate la runtime –Parametrii deconfigurare –Reflection –Overloading

Strategii de adoptare a unei Software Product Line Direction of adoption: –Top Down: managerial decision first –Bottom Up: developers use this approach Growth of product line: –Proactive Se porneste de la definirea domeniului familiei de produse (scoping) Necesita o buna cunoastere a stadiului actual si tendintelor in: application domain si marketing –Reactive Se construieste un nou membru al familiei, pornind de la cei existenti Arhitectura este extinsa incremental si core assets sunt stabiliti in urma a ceea ce rezulta a fi comun (nu planificat) making

Comparatie strategii Proactive: –Investitie mare initial, dar apoi nu mai necesita multe modificari Reactive: –Investitie mica initial, modificari continue Number of products cost payoff Number of products cost payoff Proactive Product Line No Product Line Reactive Product Line No Product Line

Categorii de reuse arhitectural In cadrul aceleiasi organizatii: “eu scriu, eu reutilizez” –Software Product Lines (Product Families) –re-utilizarea sistematica a arhitecturii software, a unor componente si a altor artefacte pentru producerea planificata a unei familii de sisteme asemanatoare. Intre organizatii: “eu scriu, altii (poate) reutilizeaza” sau “eu reutilizez ce au scris altii (necunoscuti)” –Components (Off-the-Shelf) –Proiectarea unui sistem nou se face prin cautarea de componente existente, produse independent de catre terti, si integrarea acestora

Component Based Development Build from scratchBuy/get components (design) (fit into a design) Control complet Flexibilitate Rezolvare imediata Timp Cost intretinere Evaluare/testare Licente Lipsa de flexibilitate Avem de construit un sistem cu functionalitatile {F} si calitatile {Q}. Cum procedam ? Avantaje Dezavantaje

Ce este o componenta? “A software component is a unit of composition with contractually specified interfaces and explicit context dependencies. A software component can be deployed independently and is subject to composition by third parties” Clemens Szyperski

Ce este o componenta ? O componenta este un element de program care: –Poate fi utilizata de alte elemente de program (denumite clienti) –Autorii componentei nu cunosc care vor fi clientii –Autorii clientilor trebuie sa poata utiliza componenta doar pe baza informatiilor furnizate de autorii acesteia (specificatii de interfete si dependente externe)

Architectural Mismatch Not all components work together ! Architectural mismatch: stems from mismatched assumptions a reusable component makes about the system structure of which it is part Types of assumptions: –Provides assumptions: describe the services a component provides to its clients –Requires assumptions: describe the services that a component must have in order to function correctly –ALL assumptions should be specified in order to avoid mismatch ! Mismatching assumptions may refer to: Components –interfaces –infrastructure –control model –data model Connectors –protocols –data model [ Garlan, Allen, Ockerbloom: Architectural mismatch or Why it’s hard to buid systems out of existing parts ?] System topology Construction –dependencies –initialization

Architectural mismatch What can you do about interface mismatch? [Bass] –Avoid it by carefully specifying and inspecting the components for your system. –Detect those cases you have not avoided, by careful qualification of the components. –Repair those cases you have detected by adapting the components.

Detecting architectural mismatch Component qualification : the process of determining whether a commercial component satisfies various "fitness for use" criteria. Possible component qualification processes: prototype integration of candidate components as an essential step in qualifying a component. This integration step discovers subtle forms of interface mismatch that are difficult to detect, such as resource contention. Carrying out this evaluation starts with the observation that, for each service offered by a component, a set of requires assumptions must be satisfied in order to provide that service. Qualification: is the process of –discovering all of the requires assumptions of the component for each of the services that will be used by the system. Might be documented by the component provider or might need to be discovered by component evaluator –making sure that each requires assumption is satisfied by some provides assumption in the system.

Repairing architectural mismatch What can you do to repair mismatch: 1.Change the code of one or both mismatched components – usually not possible in blackbox components 2.Drop mismatching component and write your own 3.Insert code that reconciles their interaction in a way that fixes the mismatch: Wrappers Bridges Mediators Choosing between 2 and 3: from case to case, decide what is easier (cheaper)

Wrappers The term wrapper implies a form of encapsulation whereby some component is encased within an alternative abstraction. It simply means that clients access the wrapped component services only through an alternative interface provided by the wrapper. Wrapping can be thought of as yielding an alternative interface to the component. We can interpret interface translation as including: –Translating an element of a component interface into an alternative element –Hiding an element of a component interface –Preserving an element of a component's base interface without change clientComp InterfBInterfA

Wrapper - example Component: provides access to graphics-rendering services, where the programmatic services are made available as Fortran libraries and the graphics rendering is done in terms of custom graphics primitives. Client: wants to access Component as a CORBA object Wrapper: CORBA's interface description language (IDL) can be used to specify the new interface that makes the component services available to CORBA clients rather than through linking with Fortran libraries. The repair code for the "provides assumptions" interface is the C++ skeleton code automatically generated by an IDL compiler. Also included in the repair code is hand-written code to tie the skeleton into component functionality.

Bridges A bridge translates some requires assumptions of one arbitrary component to some provides assumptions of another. The key difference between a bridge and a wrapper is that the repair code constituting a bridge is independent of any particular component. Also, the bridge must be explicitly invoked by some external agent—possibly but not necessarily by one of the components the bridge spans. This last point should convey the idea that bridges are usually transient and that the specific translation is defined at the time of bridge construction (e.g., bridge compile time). Bridges typically focus on a narrower range of interface translations than do wrappers because bridges address specific assumptions. CompBBridge InterfB CompA InterfA Glue Code (external agent)

Bridge - example Assume that we have two legacy components, one that produces PostScript output for design documents and another that displays PDF (Portable Document Format) documents. We wish to integrate these components so that the display component can be invoked on design documents. Bridge: translates PostScript to PDF. The bridge can be written independently of specific features of the two hypothetical components—for example, the mechanisms used to extract data from one component and feed it to another. This brings to mind the use of UNIX filters, although this is not the only mechanism that can be used. A script could be written to execute the bridge. It would need to address component-specific interface peculiarities for both integrated components. Thus, the external agent/shell script would not be a wrapper, by our definition, since it would address the interfaces of both end points of the integration relation. Alternatively, either component could launch the filter. In this case, the repair mechanism would include a hybrid wrapper and filter: The wrapper would involve the repair code necessary to detect the need to launch the bridge and to initiate the launch.

Mediators Mediators exhibit properties of both bridges and wrappers. The major distinction between bridges and mediators, however, is that mediators incorporate a planning function that in effect results in runtime determination of the translation (recall that bridges establish this translation at bridge construction time). A mediator is also similar to a wrapper insofar as it becomes a more explicit component in the overall system architecture. That is, semantically primitive, often transient bridges can be thought of as incidental repair mechanisms whose role in a design can remain implicit; in contrast, mediators have sufficient semantic complexity and runtime autonomy (persistence) to play more of a first-class role in a software architecture. To illustrate mediators, we focus on their runtime planning function since this is the key distinction between mediators and bridges. Client1 Mediator InterfB Comp InterfA Client2 InterfC

Mediators example Intelligent data fusion: Component: a sensor that generates a high volume of high-fidelity data. At runtime, different information consumers may arise that have different operating assumptions about data fidelity. Client1: a low-fidelity consumer requires that some information be "stripped" from the data stream. Client2: Another consumer may have similar fidelity requirements but different throughput characteristics that require temporary buffering of data. In each case, a mediator can accommodate the differences between the sensor and its consumers.

Component Based Development Process identify preliminary architecture identify potential places for reuse establish selection criteria functionalities, qualities, cost search for applicable components evaluate components select component update architecture