Title: FODA expressions
1FODA expressions
- Pietu Pohjalainen
- MDE ja mallitransformaatiot
- Syksy 2007
2Feature Oriented Domain Analysis
- FODA is a method for modeling configurability
- Our example is taken from the book Generative
Programming Methods, Tools, and Applications
3Dimension
- A feature where all sub features are alternative
- Choose one, but exactly one
- Possible configurations for concept
- f1
- f2
- f3
4Dimension with optional features
- Feature of which all sub features are alternative
optional features - Choose zero, or exactly one
- Possible configurations
- ?
- f1
- f2
- f3
5Extension point
- Feature that has at least one optional sub
feature or at least one set of or-sub features - Possbile configurations
- f2
- f3
- f2, f3
- f1, f2
- f1, f3
- f1, f2, f3
6Extension point with optional features
- Feature of which all sub features are optional
- Possible configurations
- ?
- f1
- f2
- f3
- f1, f2
- f1, f3
- f2, f3
- f1, f2, f3
7Extension point with or-features
- Feature of which all direct sub features are
or-features - Possible configurations
- f1
- f2
- f3
- f1, f2
- f1, f3
- f2, f3
- f1, f2, f3
8Configuration model for a Car
9Integration to software
- FODA is a simple, yet surprisingly powerful
approach to modeling variability and
configurability - Using a modeling system requires software support
(IDE, file formats, etc..) - How does one integrate FODA diagrams to a
software that is being developed?
10Approaches to integration
- Build a GUI editor tool for FODA models start an
internet startup for selling the tool - Build a text-based DSL (FDL)
- Use existing language (de Jonge Visser)
- Use simpler language (FODA expressions)
11FODA Description Language FDL
- FDL allows the programmer to express FODA models
in a text-based form - Primitives
- all, one-of, more-of
- optional features expressed with ?
- allows also default values
12Car configuration in FDL
- Car
- all(carBody, Transmission, Engine, pullsTrailer?)
- Transmission
- one-of(automatic, manual)
- Engine
- more-of(electric, gasoline)
13FODA as Context free Grammars
- de Joost and Visser present FODA models as
context free grammars - Atomic features are presented as terminals
- Composite features are non-terminals
- Feature operators map to syntax operators
- Allows usage of standard compiler generator tools
14Car configuration as a CFG
- carBody Transmission Engine pullsTrailer? -gt
Car - automatic manual -gt Transmission
- (electric, gasoline) -gt Engine
15CFG is nice, but too complex?
- CFG approach gives already quite good
bang-for-buck - But still some problems
- Implementing CFG requires compiler/parser
expertise - Choosing from plethora of tools takes time
- Not always is full expressive power of CFG needed
16FODA Expressions
- Idea use less expressive language
- in FODA expressions, we take the regular
expressions as the base language - constraint regexps to match with FODA primitives
- use implementing languages regexp capabilities
- brings e.g. validation close to zero-effort
17FODA expressions
Dimension (f1 f2 f3)
Dimension with optional features (f1 f2 f3) ?
Extension point (f1? (f2 f3))
Extension point with optional features (f1 f2 f3)
Extension point with or-features (f1 f2 f3)
18Car configuration in FODA expressions
- car body
- transmission (automatic manual)
- engine (electric gasoline)
- pullsTrailer?
19A DFA to check validity
20Problems with FODA expressions
- To check validity, alphabet in the model need to
have an order - Validity checking comes for free, further
development still requires investment - E.g. default values, constraints, etc. are not
expressed - There might be practical FODA models that are
really context-free
21Questions, discussion