Invasive Software Composition. Uwe Aßmann Research Center for Integrational Software Engineering (RISE) PELAB IDA Linköpings Universitet

Similar documents
Invasive Software Composition

Uniform Composition of Software and Documents

Component-Based Software Engineering Introduction

Component-Based Software Engineering Introduction

CBSE, Prof. Uwe Aßmann 1

Component-Based Software Engineering (CBSE) 1) Introduction

Part V: Applications of Composition Systems 50. Transconsistent Composition for Active Documents and Component-Based Document Engineering (CBDE)

Component-Based Software Engineering (CBSE) 1) Introduction

Part II Black-Box Composition Systems 20. Finding UML Business Components in a Component-Based Development Process

Component-based Software

Component-Based Software Engineering (CBSE) 10. Introduction

Softwarearchitekturen der Zukunft

22) Generic Programming with Generic Components Full Genericity in BETA. Obligatory Reading. Literature

52. Staged Software Architectures with Staged Composition

The Koala Component Model for Consumer Electronics Software by: Ommering, Linden, Kramer, Magee. Presented by: Bridget Flaherty.

Component-Based Software Engineering (CBSE) 10. Introduction

Metamodeling and Metaprogramming

Reuse for the Reuse-Agnostic

Composition of XML Dialects: A ModelicaXML Case Study

RECODER - The Architecture of a Refactoring System

Modeling the Evolution of Aspect Configurations using Model Transformations

I3-D1 Report on the design of component model and composition technology for the Datalog and Prolog variants of the REWERSE languages

Metamodeling and Metaprogramming

OO Technology: Properties and Limitations for Component-Based Design

Component-based Architecture Buy, don t build Fred Broks

Architecture. Readings and References. Software Architecture. View. References. CSE 403, Spring 2003 Software Engineering

Software Architectures

Architecture. CSE 403, Winter 2003 Software Engineering.

Component models. Page 1

New Programming Paradigms

Transformational Design with

Composition Graphs: a Foundation for Reasoning about Aspect-Oriented Composition

52. Staged Software Architectures with Staged Composition - How to Build BIG Systems

Sven Apel Don Batory Christian Kastner. Gunter Saake. Feature-Oriented Software Product Lines. Concepts and Implementation.

31. Feature Models and MDA for Product Lines

Frustrated by all the hype?

Science of Computer Programming. Aspect-oriented model-driven skeleton code generation: A graph-based transformation approach

Metamodelling & Metaprogramming. Lena Buffoni

ASPECTIX: A QUALITY-AWARE, OBJECT-BASED MIDDLEWARE ARCHITECTURE

Object-Oriented Design

AOSA - Betriebssystemkomponenten und der Aspektmoderatoransatz

I3-D12 Typing composition of rule-based languages

Introduction. ADL Roles

The Art of Metaprogramming in Java. Falguni Vyas Dec 08, 2012

Raising the Level of Development: Models, Architectures, Programs

Principles of Programming Languages Topic: Scope and Memory Professor Louis Steinberg Fall 2004

Java 2 Platform, Enterprise Edition: Platform and Component Specifications

UNIT 5 - UML STATE DIAGRAMS AND MODELING

The Method for Verifying Software Architecture with FSP Model

Programming AspectJ with Eclipse and AJDT, By Example. Chien-Tsun Chen Sep. 21, 2003

Beyond Objects: Components 1

Idioms for Building Software Frameworks in AspectJ

The COMPOST, COMPASS, Inject/J and RECODER Tool Suite for Invasive Software Composition: Invasive Composition with COMPASS Aspect-Oriented Connectors

Describing the architecture: Creating and Using Architectural Description Languages (ADLs): What are the attributes and R-forms?

Utilizing a Common Language as a Generative Software Reuse Tool

1) What is the first step of the system development life cycle (SDLC)? A) Design B) Analysis C) Problem and Opportunity Identification D) Development

Odysseas Papapetrou and George A. Papadopoulos

UniAspect: A Language-Independent Aspect-Oriented Programming Framework

Appendix A - Glossary(of OO software term s)

Composite Pattern. IV.4 Structural Pattern

Recalling the definition of design as set of models let's consider the modeling of some real software.

AJDT: Getting started with Aspect-Oriented Programming in Eclipse

Automatic Code Generation for Non-Functional Aspects in the CORBALC Component Model

Chapter 7. Modular Refactoring. 7.1 Introduction to Modular Refactoring

Data Structures and Algorithms Design Goals Implementation Goals Design Principles Design Techniques. Version 03.s 2-1

Generic Modeling using UML extensions for variability

EuroPLoP 2003 Focus Group: Patterns for Component Composition and Adaptation

2. Metamodelling and Metaprogramming

UNIT I. 3. Write a short notes on process view of 4+1 architecture. 4. Why is object-oriented approach superior to procedural approach?

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

A Component Framework for HPC Applications

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

AOP 101: Intro to Aspect Oriented Programming. Ernest Hill

An Introduction to Software Architecture. David Garlan & Mary Shaw 94

Multi-Dimensional Separation of Concerns and IBM Hyper/J

09. Component-Level Design

Development of E-Institute Management System Based on Integrated SSH Framework

10.1 Big Objects, Business Objects, and UML Components

Developing Software Applications Using Middleware Infrastructure: Role Based and Coordination Component Framework Approach

COURSE DETAILS: CORE AND ADVANCE JAVA Core Java

UML Modeling I. Instructor: Yongjie Zheng September 3, CS 490MT/5555 Software Methods and Tools

Information systems modeling. Tomasz Kubik

Technische Universität Dresden Institut für Software- und Multimediatechnik

Distributed Objects. Object-Oriented Application Development

Constraint-based Generation of Connectors

41. Composition Filters - A Filter-Based Grey-Box Component Model

An Architecture-Based Approach for Component-Oriented Development

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

Chapter 6 Object Persistence, Relationships and Queries

Department of Computer

Challenges in component based programming. Lena Buffoni

Oracle Fusion Middleware 11g: Build Applications with ADF I

Application Servers in E-Commerce Applications

Perl Scripting. Students Will Learn. Course Description. Duration: 4 Days. Price: $2295

SYLLABUS CHAPTER - 1 [SOFTWARE REUSE SUCCESS FACTORS] Reuse Driven Software Engineering is a Business

First-class Implementations

Beginning Groovy, Grails and Griffon. Vishal Layka Christopher M. Judd Joseph Faisal Nusairat Jim Shingler

Transcription:

Invasive Software Composition Uwe Aßmann Research Center for Integrational Software Engineering (RISE) PELAB IDA Linköpings Universitet

Contents A little history of software composition Comparison criteria for composition How it is realized for Invasive Software Composition Future software composition systems 3

Software Composition Component Model Composition Technique Composition Language 4

Historical Approaches to Components

Blackbox Composition Components Connectors Component-based applications Composition recipe 6

Aspect Systems Aspect Separation View Systems Composition Operators Software Composition Systems Composition Language Aspect/J Composition Filters Hyperslices Invasive Composition Metaclass Composition Piccola Architecture Systems Architecture as Aspect Darwin ACME Classical Component Systems Standard Components.NET CORBA Beans EJB Object-Oriented Systems Objects as Run-Time Components C++ Java Modular Systems Modules as Compile- Modula Ada-85 Time Components

Most Advanced: Software Architecture Systems Interface Port Role Component Connector Component 8

Architecture can be exchanged independently of components Reuse of components and architectures is fundamentally improved Port 1 Component Port Component Port 2 Port Component 9

Architecture Systems ACME (Garlan, CMU) Darwin (Kramer, Magee, Imperial College) Unicon (Shaw, CMU) CoSy (ACE b.v., Amsterdam, commercialized for compilers of embedded systems, http://www.ace.nl) 10

Architecture Systems as Composition Systems Component Model Composition Technique Source or binary components Binding points: ports Adaptation and glue code by connectors Scaling by exchange of connectors Architectural language Composition Language 11

Aspect Systems Aspect Separation View Systems Composition Operators Software Composition Systems Composition Language Aspect/J Composition Filters Hyperslices Invasive Composition Metaclass Composition Piccola Architecture Systems Architecture as Aspect Darwin ACME Classical Component Systems Standard Components.NET CORBA Beans EJB Object-Oriented Systems Objects as Run-Time Components C++ Java Modular Systems Modules as Compile- Modula Ada-85 Time Components

Graybox Component Models

The Essence of the Last 5 Years Aspect-oriented Programming View-based Programming Component Integration 14

Structure Interfaces Light Plan Pipe Plan Integrated House

Debugging aspect Algorithm Persistence aspect Weaver-Tool Debugging aspect Persistence aspect Debugging aspect Debugging aspect Persistence aspect

Aspect Systems Aspect languages Every aspect in a separate language Domain specific Weaver must be build (is a compiler, much effort) Script based Weavers The weaver interprets a specific script or aspect program This introduces the aspect into the core 17

Example: Inject/J injectj.fzi.de Script based weaver (T. Genssler) More powerful composition language than Aspect/J Based on explicit static metaprogramming Navigations on classes and methods of the core Pattern matching Weaving in code at arbitrary places Builds on Java RECODER http://recoder.sf.net Useful for Automated refactorings Compositions Generative Programming 18

Inject/J script BeforeAfterExample { // Only visit classes in package Testpackage foreach class 'Testpackage.*' <=c> do { // In this class, visit all methods with no parameters foreach method '*()' <=m> do { // Now insert in some debug code in the method body... before ${ System.out.println("Entering <m.signature> in class <c.name>"); }$; after ${ System.out.println("Leaving.."); }$; } } } 19

Aspect Systems As Composition Systems Component Model Core- and aspect components Aspects are relative and crosscutting Bindung points: join points Composition Technique Adaptation and glue code by weaving Weaving Language Composition Language 20

Invasive Software Composition - A Fragment-Based Composition Technique

Invasive Composition Component Model Composition Technique Fragment Components Transformation Of Hooks Composition Language Standard Language 22

Invasive Composition Invasive composition adapts and extends components at hooks by transformation 23

The Component Model of Invasive Composition The component is a fragment container (fragment box) a set of fragments/tag elements Uniform representation of a software component a class, a package, a method an aspect a meta description a composition program 24

Fragment Components Have Hooks Hooks are variation points of a component: fragments or positions, which are subject to change Software variation points method entries/exits generic parameters 25

Implicit Hooks In Software Example Method Entry/Exit Method.entry Method.exit m (){ } abc.. cde.. Given by the programming language 26

Declared Hooks Declared Hooks are declared by the box writer as variables in the hook s tags. Declarations 27

Declaration of Hooks Language extensions with new keywords Markup Tags Standardized Names (Hungarian Notation) Comment Tags <superclasshook> X </superclasshook> class Set extends genericxsuperclass { } X SuperClass class Set /* @superclass */ 28

The Composition Technique of Invasive Composition Invasive Composition adapts and extends components at hooks by transformation A composer transforms unbound to bound hooks composer: box with hooks --> box with tags 29

The Composition Technique of Invasive Composition Static Metaprogram Composer Transformer Generator Uniform for declared and implicit hooks Invasively transformed code 30

MethodEntry MethodEntry MethodExit MethodExit m (){ } abc.. cde.. m (){ print( enter m ); abc.. cde.. print( exit m ); } component.findhook( MethodEntry ).extend( print(\ enter m\ ); ); component.findhook( MethodExit ).extend( print(\ exit m\ ); );

The Composition Language of Invasive Composition For combination of the basic composition operations Composition programs result Using standard languages XML itself Java Enables us to describe large systems Composition program size 1 System size 10 32

What Can You Do With Invasive Composition?

Atomic and Compound Composition Operators bind hook (parameterization) generalized generic program elements rename component, rename hook remove value from hook (unbind) extend 34 extend in different semantic versions Inheritance view-based programming intrusive data functors connect (bind hook 1 and 2) distribute aspect weaving Basic Composition Algebra

Composers Generalize Connectors (ADL Component Model) boxes + composers + declared hooks boxes + connectors + ports 35

Hooks for Communications (Ports) Can be declared by calls to standard methods (as in Linda) Output port Input port m (){ } out(d); in(e); m (){ // call e = p(d); } m (){ // event communication notifyobservers(d); e = listen_to(); } 36

Client Library Black box composition Invasive composition Subsystem Client Library Client Library Black box connection with glue code Invasive connection [TOOLS 2000] 37

Invasive Connection with CORBA import Library; public class Client { public order(string servername) { // Get the seller Library library = getlibrary(); // Order library.selectit(); library.buy(); } } import org.omg.corba.* import Library; public class Client extends CORBA.client { public order(string name) { // Initialize CORBA Broker ORB orb = ORB.init(args,new Properties()); // Get the seller Library faraway = orb.string_to_object(name); // Order faraway.schauenach(); faraway.order(); } } 38 hooks [TOOLS 2000]

Composers Can Be Used For Skeletons (Coordinator) coordinator Instead of functions or modules, skeletons can be defined over fragment components CoSy coordination schemes (ACE compiler component framework www.ace.nl) Compose basic components with coordinating operators 39

Composers Generalize Inheritance Operators (Classes as Components) boxes + composers + declared hooks boxes + mixin + feature lists 40

Composers Can Be Used For Inheritance Extension can be used for inheritance (mixins) inheritance := inherit copy first super document extend with second super document 41

Sound Extensions (Views That Do Not Destroy Contracts) Invasive Composition works if dependencies are Absent Forward flow Core components don't change Can be checked with slicing or analysis, or regression testing 42

Composers can be Used for AOP (Core and Aspect Components) Core Distributor Aspect Complex composers distribute aspect fragments over core fragments Distributors extend the core Distributors are more complex operators, defined from basic ones 43

Weavers As Distributors Algorithm Debugging aspect Persistency Op Op Op Op Op Distributor Op Persistency Debugging Debugging Persistency 44

Sound Aspects (Aspects That Do Not Destroy Contracts) Invasively transformed tags Invasively transformed tags Invasive Aspect Weaving works if dependencies are Absent Forward flow Core components don't change Can be checked with slicing or analysis, or regression testing 45

Simple Weavers distributeovermethods Weave a prologue and an epilogue into a class or package tree implemented as a navigator over the tree applies simple hook extensions on entry and exit hook Hungarian aspect boxes Carry an aspect with Hungarian notation Weavers weave with naming conventions 46

A Simple Weaver // Initialize composition system JavaCompositionSystem cs = new JavaCompositionSystem(outputPath); // Loading components. // The core component CompilationUnitBox cutobeextended = cs.createcompilationunitbox("democlass"); // The aspect ClassBox aspectclass = cs.createclassbox("beforeafteraspect.java"); // Now distribute the aspect over the core cutobeextended.distributemethods(aspectclass); // Export cs.printall(); 47

Weaving with Modular Join Point Adressing M. Karlsson's masters thesis JoinPoint Adressing Expression Algorithm Aspect Op Op Op Op Op Distributor Op Aspect 48 Aspect

The COMPOsition SysTem COMPOST COMPOST is the first system to support invasive composition for Java Library of static meta-programs Composition language Java Reifies concepts Boxes, Hooks, Composers and many other things 49

COMPOST for Everybody 0.78 is out (Uni Karlsruhe/Uni Linköping) http://www.the-compost-system.org We expect a new major version in April 2004 Contains refactoring engine RECODER as transformation subsystem http://recoder.sf.net Invasive Software Composition, U. Aßmann, Springer. Developed within the EASYCOMP project EU FET Basic Research Easy Composition in Future Generation Component Systems New component models for XML, COTS, runtime components (Uniform composition) We are refactoring towards a uniform XML version 50

Invasive Software Composition as Composition Technique

Invasive Composition: Component Model Graybox components instead of black box ones Composition interfaces with declared hooks Implicit composition interfaces with implicit hooks The composition programs produce the functional interfaces Resulting in efficient systems, because superfluous functional interfaces are removed from the system Content: source code binary components also possible, poorer metamodel Aspects are just a new type of component Fragment-based Parameterisation a la BETA slots Type-safe parameterization on all kinds of fragments 52

Invasive Composition: Composition Technique Adaptation and glue code: good, composers are program transformers and generators Aspect weaving Parties may write their own weavers No special languages Extensions: Hooks can be extended Soundness criteria of lambdan still apply Metamodelling employed Not yet scalable to run time 53

Composition Language Various languages can be used Product quality improved by metamodel-based typing of compositions Metacomposition possible Architectures can be described in a standard object-oriented language and reused An assembler for composition Other, more adequate composition languages can be compiled 54

Invasive Composition as Composition System Component model Source or binary components Greybox components Composition interfaces with declared an implicit hooks Composition technique Algebra of composition operators Uniform on declared and implicit hooks Standard Language Composition language 55

Unification of Development Techniques With the uniform treatment of declared and implicit hooks, several technologies can be unified: Generic programming Inheritance-based programming Connector-based programming View-based programming Aspect-based programming 56

Conclusions for ISC Fragment-based composition technology Graybox components Producing tightly integrated systems Components have composition interface From the composition interface, the functional interface is derived Composition interface is different from functional interface Overlaying of classes (role model composition) 57

Different Forms of Greyboxes

Refactoring as Whitebox Operation Refactoring works directly on the AST/ASG Attaching/removing/replacing fragments Whitebox reuse Refactorings Transformations 59

Weaving as Light-Grey Operation Aspect weaving and view composition works on implicit hooks (join points) Implicit composition interface Composition with implicit hooks Refactorings Transformations 60

Parameterization as Darker-Grey Operation Templates work on declared hooks Declared composition interface Composition with declared hooks Refactorings Transformations 61

Systematization Towards Greybox Component Models Composition with declared hooks Composition with implicit hooks Refactorings Transformations 62

Refactoring Builds On Transformation Of Abstract Syntax Refactoring 63

Invasive Composition Builds On Transformation Of Implicit Hooks Composer Invasively transformed code 64

Invasive Composition Builds On Transformation on Declared Hooks Composer Invasively transformed code 65

Future Composition Systems

What Is A Component? Cannot be stated in general Component models must be defined We must investigate composition techniques And languages Domain-specific ones (composition-oriented composition languages) General ones We should build frameworks for all component models Generic component models Generic composition technique Scalability! 67

Types of Composition Systems Software Composition Systems Blackbox Composition Systems Graybox Composition Systems (Integrational Systems) Turing-complete composition languages [Invasive Software Composition, Aßmann, Springer 2003] Uniform Composition Systems Supporting multiple languages Supporting XML Active documents Uniform treatment of software and data Based on software composition systems 68

Integrational Software Engineering Components Software composition Invasive composition Uniform composition operations Integrated system 69 Composition recipe

Integrational Systems Aspect Systems Aspect Separation Composition Language View Systems Composition Operators Many integration techiques Uniform on XML Software Composition Systems Composition Language Aspect/J Composition Filters Hyperslices Invasive Composition Metaclass Composition Piccola Architecture Systems Classical Component Systems Architecture as Aspect Standard Components Darwin ACME.NET CORBA Beans EJB Object-Oriented Systems Objects as Run-Time Components C++ Java Modular Systems Modules as Compile- Modula Ada-85 Time Components

The End http://www.easycomp.org http://www.the-compost-system.org http://recoder.sf.net http://injectj.fzi.de Invasive Software Composition, U. Aßmann, Springer. 71