IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Feature Oriented Software Development

    MarkNV发表于 2013-11-02 01:00:00
    love 0

    1. Software Product Line

    Before discussing FOSD (Feature Oriented Software Development), we have to know the concept of SPL (Software Product Line) due to it is the origins of FOSD.

    A SPL defines a set of distinct but related programs. These programs always have a lot of commonality.

    • Domain specific.
    • Do not build softwares from scratch.
    • A design for a program family, not a single program.

    Examples: Purchasing Macbook in Apple store, choose type and all kinds of features you want then click check-out.

    1.1 Features

    Refinement: process of adding implementation detail without changing semantics. (Implement interfaces)

    Extension: process of adding details to augment or extend semantics/capabilities. (Inherit classes of interfaces)

    Features all extensions. Feature = layer of software.

    • Features are interchangeable
    • Features are reusable
    • Features are functions (mappings)
    • Feature composition is function composition

    2. GenVoca

    GenVoca is the first generation of FOSD model. The name is a meld of the names Genesis and Avoca.

    Genesis is the first building-blocks technology for DBMS, using a graphical layout editor to customize a DBMS which is specified by composing prefabricated software components. Shows as bellow:

    • Relational interface: SQL or QUEL.
    • Associations: nested loops, merge-join, pointer arrays, rings.
    • Storage Structures: secondary indexes, transposition, encoding, deleteflag, storage-structure bus.
    • File Structures: heap,unordered, bplus, grid, hash, isam.

    Avoca is a system for constructing efficient and modular network software suites using a combination of pre-existing and newly created communication protocol.

    2.1 Design Patterns

    Adaptor: object whose goal is to translate from one OO interface to another.

    Adaptor

    Decorator: a wrapping object that exports and imports the same (basic) interface and whose purpose is to add more functionality to the wrapped object.

    Adaptor

    GenVoca features were originally implemented using C preprocessor (#ifdef feature ... #endif) techniques. A more advanced technique, called mixin layers, showed the connection of features to object-oriented collaboration-based designs.

    Limitation: Fixed interfaces were simply too rigid. (Solution: Mixin)

    2.2 Language used to Describe Feature Composition

    There is only one base program, 0 (the empty program), and all features are unary functions. This suggests the interpretation that GenVoca composes program structures by superposition, the idea that complex structures are composed by superimposing simpler structures.

    GenVoca is as a monoid: a GenVoca model is a set of features with a composition operation (•); composition is associative and there is an identity element (namely 1, the identity function).

    Multi-featured applications are expressions:

    • app0 = f
    • app1 = i • f
    • app2 = j • h
    • app3 = i • j • f

    2.3 Conclusion

    • GenVoca is based on the stepwise development of programs.
    • GenVoca model is an algebra for a domain of programs.
    • GenVoca models (product lines) are monoids.

    3. Mixins

    Mixin layers is the second generation of FOSD model. It is a refinement of GenVoca.

    Problems arise from a typical features called collaborations. It simultaneously modify multiple objects/entities, and refinement of single entity is called role. Example shows as bellow:

    Collaborations

    How to handle this problem? The answer is mixin and bellow is what we want in Java. (class whose superclass is parameterized is a mixin)

    java-mixin

    However it is not possible in Java, but there is other solutions:

    mixin

    3.1 OO Frameworks & Plug-ins

    Why the second solution of mixin by inheritance could work? These is because it is the same as frameworks and plug-ins design.

    • Frameworks are a set of abstract classes with “hook” methods.
    • Plug-ins are concrete classes that implement the hook methods of abstract classes.
    • Framework defines a base collaboration.
    • Plug-in defines an extension of the base collaboration to produce a more complicated collaboration.

    What happens is as bellow:

    framework

    4. AHEAD

    Algebraic Hierarchical Equations for Application Design (AHEAD) is the third generation of FOSD model. It generalized GenVoca+Mixin in two ways.

    • First it revealed the internal structure of GenVoca values as tuples. Every program has multiple representations, such as source, documentation, bytecode, and makefiles. A GenVoca value is a tuple of program representations.
    • Second, AHEAD expresses features as nested tuples of unary functions called deltas. Deltas can be program refinements, extensions, or interactions.

    The original implementation of AHEAD is the AHEAD Tool Suite and Jak language, which exhibits both the Principles of Uniformity and Scalability. Next-generation tools include CIDE and FeatureHouse.

    Example:

    AHEAD


    Acknowledgement:

    This article is my learning notes of course CS392F Automated Software Design, lectured by Prof. Don Batory. The core idea of this course is how to write programs to generate other programs in a scientific way, that is, not by hacking.



沪ICP备19023445号-2号
友情链接