Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
FeatureIDE: Background
Thomas Thum, Jens MeinickeMarch 4, 2015
Feature-Oriented Programming (FOP)
I Introduced 1997 by Christian PrehoferI Based on Object-Oriented ProgrammingI Features realize functionalitiesI Features are cross-cutting to objectsI Features modularize fragments from certain classesI Fragment contains some methods/fields of a class belonging
to one functionalityI Goals: code traceability, software customization
Thomas Thum, Jens Meinicke FeatureIDE: Background 2
FOP ExampleKästner, Apel, Saake EPMD – Folie 6-48
Komposition durch Überlagerung von Bäumen
package util;class Calc {
int e0 = 0, e1 = 0, e2 = 0;
void enter(int val) {e2 = e1; e1 = e0; e0 = val;
}void clear() { e0 = e1 = e2 = 0;
}String top() {return String.
valueOf(e0);}
}
package util;class Calc {
void add() {e0 = e1 + e0; e1 = e2;
}}
package util;class Calc {
int e0 = 0, e1 = 0, e2 = 0;
void enter(int val) {e2 = e1; e1 = e0; e0 = val;
}void clear() {e0 = e1 = e2 = 0;
}String top() {//...
}void add() {e0 = e1 + e0; e1 = e2;
}}
● =
util
Calc
e0 e2e1 enter cleartop
util
Calc
add
util
Calc
e0 e2e1 enter cleartop add
● =
feature: CalcBase
feature: Add
feature: CalcAdd
http://wwwiti.cs.uni-magdeburg.de/iti_db/lehre/epmd/2009/slides/06_FOP.pdf
Thomas Thum, Jens Meinicke FeatureIDE: Background 3
Composition Engines
Feature Orientated Command-line tools used to compose fileswithin FeatureIDE:
I AHEAD (mixin): .jak (Java 1.4)http://userweb.cs.utexas.edu/˜schwartz/ATS.html
I FeatureC++: .cpp (C++)http://www.fosd.de/fcpp
I FeatureHouse: .java (Java 1.5), .cs (C#), .c/.h (C), .hs(Haskell), .jj (JavaCC), .als (Alloy), .xmi (UML)http://www.fosd.de/fh
Thomas Thum, Jens Meinicke FeatureIDE: Background 4
Composition Engines
Non Feature Orientated Command-line tools used to compose fileswithin FeatureIDE:
I AspectJ(Aspectorientated Java): .aj(Aspect File), .javahttp://www.eclipse.org/aspectj/
I DeltaJ(Deltaoriantated Java): .dj(Core and Delta Modules)http://sourceforge.net/projects/deltaj/
I Munge: Preprocessorhttp://sonatype.github.com/munge-maven-plugin/
I Antenna: Preprocessorhttp://antenna.sourceforge.net/
Thomas Thum, Jens Meinicke FeatureIDE: Background 5
Configuration
I Selection of featuresI Composition of features results in a program variantI Not all combinations are useful
Thomas Thum, Jens Meinicke FeatureIDE: Background 6
Feature Model
I Specifies valid combinations of featuresI Graphically represented by a feature diagramI Created for a particular domainI Describes a software product line (SPL)
GraphLibrary
Edges
Directed Undirected
Algorithms
Number Cycle
Cycle ⇒ Directed
NewCompound1
Layer1 Layer2
And-groupNewCompound1
Layer1 Layer2
Or-groupNewCompound1
Layer1 Layer2
Alternative-groupNewCompound1
Layer1 Layer2Mandatory
NewCompound1
Layer1 Layer2Optional
And-group
MandatoryOptional
Alternative-groupOr-group
Cross-tree constraints
Thomas Thum, Jens Meinicke FeatureIDE: Background 7
Feature Model
I Specifies valid combinations of featuresI Graphically represented by a feature diagramI Created for a particular domainI Describes a software product line (SPL)
GraphLibrary
Edges
Directed Undirected
Algorithms
Number Cycle
Cycle ⇒ Directed
NewCompound1
Layer1 Layer2
And-groupNewCompound1
Layer1 Layer2
Or-groupNewCompound1
Layer1 Layer2
Alternative-groupNewCompound1
Layer1 Layer2Mandatory
NewCompound1
Layer1 Layer2Optional
And-group
MandatoryOptional
Alternative-groupOr-group
Cross-tree constraints
Thomas Thum, Jens Meinicke FeatureIDE: Background 7
Feature Model
I Specifies valid combinations of featuresI Graphically represented by a feature diagramI Created for a particular domainI Describes a software product line (SPL)
GraphLibrary
Edges
Directed Undirected
Algorithms
Number Cycle
Cycle ⇒ Directed
NewCompound1
Layer1 Layer2
And-groupNewCompound1
Layer1 Layer2
Or-groupNewCompound1
Layer1 Layer2
Alternative-groupNewCompound1
Layer1 Layer2Mandatory
NewCompound1
Layer1 Layer2Optional
And-group
Mandatory
Optional
Alternative-groupOr-group
Cross-tree constraints
Thomas Thum, Jens Meinicke FeatureIDE: Background 7
Feature Model
I Specifies valid combinations of featuresI Graphically represented by a feature diagramI Created for a particular domainI Describes a software product line (SPL)
GraphLibrary
Edges
Directed Undirected
Algorithms
Number Cycle
Cycle ⇒ Directed
NewCompound1
Layer1 Layer2
And-groupNewCompound1
Layer1 Layer2
Or-groupNewCompound1
Layer1 Layer2
Alternative-groupNewCompound1
Layer1 Layer2Mandatory
NewCompound1
Layer1 Layer2Optional
And-group
Mandatory
Optional
Alternative-groupOr-group
Cross-tree constraints
Thomas Thum, Jens Meinicke FeatureIDE: Background 7
Feature Model
I Specifies valid combinations of featuresI Graphically represented by a feature diagramI Created for a particular domainI Describes a software product line (SPL)
GraphLibrary
Edges
Directed Undirected
Algorithms
Number Cycle
Cycle ⇒ Directed
NewCompound1
Layer1 Layer2
And-groupNewCompound1
Layer1 Layer2
Or-groupNewCompound1
Layer1 Layer2
Alternative-groupNewCompound1
Layer1 Layer2Mandatory
NewCompound1
Layer1 Layer2Optional
And-group
MandatoryOptional
Alternative-group
Or-group
Cross-tree constraints
Thomas Thum, Jens Meinicke FeatureIDE: Background 7
Feature Model
I Specifies valid combinations of featuresI Graphically represented by a feature diagramI Created for a particular domainI Describes a software product line (SPL)
GraphLibrary
Edges
Directed Undirected
Algorithms
Number Cycle
Cycle ⇒ Directed
NewCompound1
Layer1 Layer2
And-groupNewCompound1
Layer1 Layer2
Or-groupNewCompound1
Layer1 Layer2
Alternative-groupNewCompound1
Layer1 Layer2Mandatory
NewCompound1
Layer1 Layer2Optional
And-group
MandatoryOptional
Alternative-group
Or-group
Cross-tree constraints
Thomas Thum, Jens Meinicke FeatureIDE: Background 7
Feature Model
I Specifies valid combinations of featuresI Graphically represented by a feature diagramI Created for a particular domainI Describes a software product line (SPL)
GraphLibrary
Edges
Directed Undirected
Algorithms
Number Cycle
Cycle ⇒ Directed
NewCompound1
Layer1 Layer2
And-groupNewCompound1
Layer1 Layer2
Or-groupNewCompound1
Layer1 Layer2
Alternative-groupNewCompound1
Layer1 Layer2Mandatory
NewCompound1
Layer1 Layer2Optional
And-group
MandatoryOptional
Alternative-groupOr-group
Cross-tree constraints
Thomas Thum, Jens Meinicke FeatureIDE: Background 7
Feature-Oriented Software Development (FOSD)
GraphLibrary
Edges
Directed Undirected
Algorithms
Number Cycle
Cycle ⇒ Directed
Feature Model Feature Modules
Configurations Composer Program Variants
Thomas Thum, Jens Meinicke FeatureIDE: Background 8