Download presentation
Presentation is loading. Please wait.
Published byEthan Lucas Modified over 10 years ago
1
GenArch: Automatic Product Derivation in Multi-agent Systems Product Line Elder Cirilo
2
GenArch: A Model-Based Product Derivation Tool
3
© LES/PUC-Rio Motivation Product Derivation refers to the process of constructing a product from the set of assets specified or implemented for a SPL; Over the last years, instantiation/derivation tools have been proposed to facilitate the selection, composition and configuration of SPL code assets and their respective variabilities; Examples of tools: –Gears –Pure::variants
4
© LES/PUC-Rio Problem These tools are in general complex and heavyweight to be used by the mainstream developer community. Some deficiencies from the existing tools: –they incorporate a lot of new concepts from the SPL development area; –definition of many complex models and/or functionalities; –they are in general more adequate to work with proactive approaches.
5
© LES/PUC-Rio Our work This work proposes GenArch, a model-driven product derivation tool. It is centered on the definition of three models: (i) Feature model (ii) Architecture model (iii) Configuration model Our approach motivates: - the generation of initial versions of these models based on a set of code annotations;
6
© LES/PUC-Rio Approach Overview
7
© LES/PUC-Rio Approach Overview The purpose of each model of our approach Feature Model –Represent variabilities from the SPL architecture. Architecture Model –Offer a visual representation of code artifacts from the SPL architecture. Configuration Model –Define the mapping between features and code artifacts. It represents the configuration knowledge from a generative approach.
8
© LES/PUC-Rio Approach in Action Illustrate the tool functionalities through an example. Approach Steps: I. Annotating Java Code with Feature and Variabilities II. Generating and Refining the Approach Models III. Implementing Variabilities with Templates IV. Generating SPL Instances
9
9 © LES/PUC-Rio Framework JUnit Specification of unit tests. Implementation of Variabilities: –Framework OO > polimorphism –Aspect-Oriented Programming Existing variabilities: –Test suites and test cases –Graphical User Interface (Swing, AWT, Txt) –Test cases extensions (repetition, concurrent execution) >> Aspects
10
© LES/PUC-Rio I. Annotating Java Code with Feature and Variabilities Two kinds of annotations: @Feature and @Variability Examples: @Feature(name="TestCase", parent="TestSuite", type=FeatureType.mandatory) @Variability(type=VariabilityType.hotSpot, feature=TestCase) They are processed by a parser to generate initial versions of the models
11
11 © LES/PUC-Rio Example: TestCase class annotated
12
© LES/PUC-Rio II. Generating and Refining the Approach Models
13
13 © LES/PUC-Rio II. Generating and Refining the Approach Models Before After
14
14 © LES/PUC-Rio II. Generating and Refining the Approach Models
15
© LES/PUC-Rio Synchronization Implementation Assets & Models The following tasks are accomplished by GenArch (i) removing features from the feature model which are not longer used by the configuration model or some annotation in the code; (ii) removing mapping relationships in the configuration model elements that refer to non-existing features or implementation elements; (iii) removing implementation elements from the architecture model which do not exist anymore; (iv) automatic creation of @Feature annotations in implementation elements based on the existence of dependency relationships between a feature and an implementation element in the configuration model; and (v) changes in the original implementation elements (add, remove, move, rename) implies in the same changes in the architecture model related to the element.
16
III. Implementing Variabilities with Templates @Feature @Variability @Feature @Variability
17
III. Implementing Variabilities with Templates «IMPORT br::pucrio::inf::les::genarch::models::instance» «DEFINE Main FOR Instance» «FOREACH featureConfigurations (TestSuite",featureModel) AS fc» «FILE fc.attribute + ".java"» package junit.framework; public class «fc.attribute» extends TestSuite { } «ENDFILE» (...) «ENDDEFINE» Before
18
© LES/PUC-Rio III. Implementing Variabilities with Templates «IMPORT br::pucrio::inf::les::genarch::models::instance » «DEFINE Main FOR Instance» « FOREACH featureConfigurations (TestSuite",featureModel) AS fc» «FILE fc.attribute + ".java"» package junit.framework; public class «fc.attribute» extends TestSuite { public static Test suite() { TestSuite suite = new TestSuite(); «FOREACH fc.features AS child» suite.addTestSuite(«child.attribute».class); «ENDFOREACH» return suite; } «ENDFILE» (...) «ENDDEFINE» After
19
© LES/PUC-Rio IV. Generating SPL Instances Choose the Variable Features (Feature Model Instance)
20
© LES/PUC-Rio IV. Generating SPL Instances Load the Product Code in a Eclipse Project
21
© LES/PUC-Rio Architecture Overview
22
Multi-Level Customization in SPL Derivation
23
SPL Implementation Architecture Architecture-centric Software Product Lines Today: Frameworks-Based architectures –Components (Spring, OGSi) –Agents (JADE, JADEX) –Services (OASIS) –Events (Esper) Architecture realization –Massive use of XML and Configuration files Error-prone Product Derivation / Configuration
24
Multi-level Customization in SPL Derivation Spring Model Classes, Aspectos... JADEX Model XML Feature Model «IMPORT br::pucrio::inf::les::genarch::models::instance» «EXTENSION br::pucrio::inf::les::genarch::models::Model» «DEFINE Main FOR Instance» «FILE "User.agent.xml"-» (...) «LET domainModelElement(mas",user",domainModels) AS u» «FOREACH u.capabilities AS c» «c.fragment.content» «FOREACH» «ENDLET» (...) «ENDFILE» «ENDDEFINE»
25
DSAM Composition Domain-specific Architecture Models
26
Automatic Product Derivation in Multi-agent Systems Product Line
27
OLIS (JADEX/Spring) Spring Jadex
28
OLIS – Configuration Metrics XML files –10 JADEX files –4 Spring application context Lines of code –JADEX: 1144 –Spring: 382 –Total: 1526
29
MAS Model (I) Metamodel Agent Capability Goal Belief Plan Event Expression Goal Belief Plan Event Expression
30
MAS Model (II)
31
Spring Model (II)
32
Configuration Knowlege Mapping between domain elements e features expression Mapping between domain elements and implementation elements (Classes, Aspects, Fragments,...)
33
Template: JADEX Agent «IMPORT br::pucrio::inf::les::genarch::models::instance» «EXTENSION br::pucrio::inf::les::genarch::models::Model» «DEFINE Main FOR Instance» «FILE "User.agent.xml"-» (...) «LET domainModelElement(mas",user",domainModels) AS u» «FOREACH u.capabilities AS c» « c.fragment.content » « FOREACH » «ENDLET» (...) «ENDFILE» «ENDDEFINE» «IMPORT br::pucrio::inf::les::genarch::models::instance» «EXTENSION br::pucrio::inf::les::genarch::models::Model» «DEFINE Main FOR Instance» «FILE "User.agent.xml"-» (...) «LET domainModelElement(mas",user",domainModels) AS u» «FOREACH u.capabilities AS c» « c.fragment.content » « FOREACH » «ENDLET» (...) «ENDFILE» «ENDDEFINE»
34
Extension Points Domain Model Domain Model Extractor
35
Derivation Process Frameworks-Specifics Elements Classes, Aspects, Files... Core Assets Architecture Model Modeling GenArch Configuration Model Configuration Knowledge Product DSLs Templates Feature Model
36
Conclusions GenArch is lightweight tool that can be used to derivate SPL or Framework instances GenArch fit all the SPL adoption approach GenArch was used in a commercial scenario to derivate Mobile Games The GenArch can be extended incrementally
37
Future Works Integrate GenArch with more high level models –Business Process –Active Diagram Feature Model (GenArch) in Autonomic Computing –Use Feature model to manage self-adaptation in autonomic environments
38
GenArch: Automatic Product Derivation in Multi-agent Systems Product Line Questions?
40
Feature Model GenArch Agent/Service Maven/Ant Repository Runtime Environment Request a new feature Obtain Feature Metdata Deploy the derivate Agent/Service Derivate Derivate a script Agent/Service
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.