• No results found

today 1,700 special programming languages used to communicate in over 700 application areas.

N/A
N/A
Protected

Academic year: 2021

Share "today 1,700 special programming languages used to communicate in over 700 application areas."

Copied!
41
0
0

Loading.... (view fulltext now)

Full text

(1)

“… today … 1,700 special programming

languages used to ‘communicate’ in over 700

application areas.”

– Computer Software Issues, an American Mathematical Association Prospectus, July 1965, quoted in P. J. Landin’s famous article “The Next 700 Programming Languages”, 1966

(2)

Feature Modeling in Generative

Software Development

Krzysztof Czarnecki

(3)

Overview

¨Generative Software Development

• Example

• Staged Configuration using Feature

Models

• FeaturePlugin

• Summary

(4)

Generative Software

Development

• Is a product-line engineering approach

– Product-line development

– Product development

• Automates product development

• Based on a product specification in a set of

(5)

Product Line Approach

• Product Line Development (Domain Engineering)

– Analysis: Product-line scoping and defining a set of reusable, configurable requirements for the products in the product line – Design: Developing a common architecture for the products in

the product line and devising a production plan

– Implementation: Provisioning the production assets, for example, reusable components, domain-specific languages, generators, a reuse infrastructure, and a production process

• Product Development (Application Engineering)

– Creating concrete products using the production assets from Product Line Development

(6)

Different Forms of DSLs

page MainPage () { filename = index.html

placeHolders {

header = fragmentCall { include = Header() }

Configuration tool Wizard

Library in a

programming language

(7)

Advantages of DSLs Over

General-Purpose Languages (GPLs)

• Domain-specific abstractions

– Pre-defined abstractions to directly represent concepts from the application domain

• Domain-specific concrete syntax

– Natural notation for a domain avoiding syntactic clutter that often results when using GPLs

• Domain-specific error checking

– Analysers that find more errors than similar analysers for GPLs and report errors in a language familiar to the domain expert

• Domain-specific optimizations

– Code optimization based on domain-specific knowledge which is usually not available to a GPL compiler

• Domain-specific debugging, version control, etc.

– Opportunities for improving all aspects of a development environment

(8)

Modeling and DSLs

• Models are abstract representations of systems

– Answer questions of interest to stakeholders

• Capture stakeholder intentions more directly

– Without accidental implementation details

• Model driven development makes them source artifacts

– Fully integrated with the code and other source artifacts

– Not documentation that becomes obsolete as software is cut

• Used across the software life cycle

– Requirements, design, development, deployment, testing, debugging, maintenance, enhancement

(9)

Feature-Oriented Approach

Domain analysis Mapping Family architecture Problem-space view DSL Component technology DSL Technology Generator Technology

Feature Models

Solution-space view •Architectural patterns •Variability mechanisms

(10)

Overview

• Generative Software Development

¨Example

• Staged Configuration using Feature

Models

• FeaturePlugin

• Summary

(11)

Feature Diagram

Payment FrequentFlyer PayOnDelivery mandatory feature optional feature alternative features

No decision regarding the mechanism for

implementing variability!

CreditCard PayByBill Transaction Tax Invoice Online Printed ShipmentCost

Approval Basket Fulfillment OrderProcessing

Shipping ElectronicDelivery

PackageTrackingNo PackageSlip

«excludes» «implies»

(12)

Cardinality-Based Feature Modeling

InDays(Integer)

Expiration ShippingGateway CustomMethods Shipping Method(String) EShop [0..*] PasswordPolicy Inclusive-or group Feature cardinality Feature attribute Never Chars special lower upper digit <2..4> Group cardinality FlatRate(Float)

(13)

Mapping Feature Variations To

Software

Variability Variability

Ordering process

Web Content & Navigation

Information Model Webpage Layout

Catalog browsing

Targeting & Profiling ... Security polices Transaction polices Caching polices Presentation policies ... System

(14)

Mapping Feature Variations To

Software

Variability Variability

Ordering process

Web Content & Navigation

Information Model Webpage Layout

Catalog browsing

Targeting & Profiling ... Security polices Transaction polices Caching polices Presentation policies ... System

(15)

Mapping Feature Variations To

Software

Variability Variability

Ordering process

Web Content & Navigation

Information Model Webpage Layout

Catalog browsing

Targeting & Profiling ... Security polices Transaction polices Caching polices Presentation policies ... System See webml.org

(16)

<<EntityBean>> Customer

<<PrimaryKey>> oid : java.lang.Long +lastName : java.lang.String +firstName : java.lang.String

Mapping Feature Variations To

Software

Variability

Variability

Ordering process

Web Content & Navigation

Information Model Webpage Layout

Catalog browsing

Targeting & Profiling ... Security polices Transaction polices Caching polices Presentation policies ... System Consistency management & reconciliation … Refinements -Model-to-model transformations

(17)

Mapping Feature Variations To

Software

Variability Variability Ordering process Refinements -Model-to-model transformations

Database Model Web Component Model EJB Component Model

EJB Class Model

Refinements -Model-to-code transformations

Web Content & Navigation

Information Model Webpage Layout

Parameterization of transformations

Catalog browsing

Targeting & Profiling ... Security polices Transaction polices Caching polices Presentation policies ... System Consistency management & reconciliation …

(18)

Configuration and Generation For

Embedded Systems

Variability Variability

UML/RT UML/RT Matlab SL/SF Matlab SL/SF

ControlFunctions Diagnosis Plant

(19)

Feature-Based Configuration of

Satellite Software

General-purpose ConfigEditor Satellite configuration in XML Family Architecture of Satellite Com Systems

(Ada83 templatized using TL) Concrete Satellite Ground station Generate save DSL definition (FM in XML format) Statically configure Dynamically configure Communi-cation

(20)

#for i "/Satellite/PUS/Service/Sub"#

with service#"$i/../id"#_#"$i/id"#; #end#

separate (app)

procedure decode(o :in out ptr ; p :in ...) is no_service : exception;

... begin

for i in o.service'range loop ... end loop; ... case s.typ is #for i "/Satellite/PUS/Service"# when #"$i/id"# => case s.sub is #for j "$i/Sub"#

when #"$j/id"# => service#"$j/../id"#_#"$j/id"#(o, p);

#end#

when others => null; end case; #end# with service014_001; with service014_002; with service001_001; with service001_002; with service001_007; with service001_009; with service004_023; with service004_024; with service004_025; with service004_026; separate (app)

procedure decode(o :in out ptr ; p :in ...) is

no_service : exception; ....

begin

for i in o.service'range loop ... end loop; ... case s.typ is when 014 => case s.sub is when 001 => service014_001(o, p); when 002 => service014_002(o, p); when others => null;

end case; when 001 => case s.sub is when 001 => service001_001(o, p); when 002 => service001_002(o, p); when 007 => service001_007(o, p); when 009 => service001_009(o, p); when others => null;

end case;

Generation Using Template

Language

(21)

Overview

• Generative Software Development

• Example

¨Staged configuration using Feature Models

• FeaturePlugin

(22)

Staged Configuration Using

Specialization

• Specialization transforms a new feature diagram into a new one denoting a subset of configurations of the original diagram

∅), (f ∅)}) f <1..1> f f2 f3 [0..2] <1..1> f4 (f, {(f2, ∅), (f4, ∅)}) f f2 f4 f1 f f2 f3 [0..2] <1..1> f4

(23)

Staged Configuration Example:

Policy Specialization

• Decisions taken in

stages

– Time, e.g.,

• Phases in product lifecycle

– Roles, e.g.,

• Component integrator, deployer, administrator, maintainer

– Context/target, e.g.,

• Multiple deployment contexts

(24)
(25)

Staged Configuration Using

Multi-Level Configuration

• Each stage has a separate feature model

• Each role performs configuration (not

specialization) within a stage

• Manual configuration of one stage

automatically specializes the feature model

of the next stage

(26)

Multilevel Configuration

• Different roles will have different

perspectives on the variability

(27)
(28)

Overview

• Generative Software Development

• Example

• Staged configuration using Feature Models

¨FeaturePlugin

(29)

FeaturePlugin – Eclipse Plugin

for Feature Modeling

• Cardinality-based feature modeling

• Configuration support

– Configuration – Specialization – Global constraints – Synchronization

• User-extensible notation

– Defining additional information for a project – Meta-level also defined as feature models

• Alternative renderings

– Explorer view & feature maps – Feature trees & tables

(30)

FeaturePlugin – Eclipse Plugin for Feature

Modeling and Configuration

(31)
(32)
(33)

33

Structure Spectrum of DSLs

Routine configuration Creative construction

Eshop

Catalog Payment Shipp InventoryTracking

Check Debit

Card CreditCard PO Cust Serv

Fedex UPS scr1 scr2 scr3 scr4 scr5 scr6 scr7 scr8 scr11 scr12 scr9 scr10

Path through a decision tree Subtree of a feature tree Subgraph of an(infinite) graph

Wizards Feature-based

configuration

Graph-like language

(34)

Designing DSLs

• Complex design space

– Textual, diagrammatic, form-based, grid-based, etc.

– Hierarchical, graph-like, spatial, etc.

– Declarative vs. procedural

– Dynamic vs. static

– …

• Usability

– Mental walkthroughs

– Cognitive patterns

(35)

Target Audiences for DSLs

• Different audiences

– Software engineers

– Traditional engineers (control, mechanical,…)

– Business people (accounting, marketing, management, …) – Analysts (consultants with DS expertise)

– Scientists (biology, chemistry, physics,…; computational science) – Casual computer users (my mom…)

– …

• Criteria

– Level of software development skills – Depth of application-domain expertise

(36)

Target Audiences for DSLs

Skilled analysts Business people, financial experts, scientists, etc. Degree of Software Development Skills End-user programming Traditional engineers Typical programmers

& software architects

High

(37)

Tools for Implementing DSLs

• To be defined

– Abstract syntax (e.g., using a class diagram)

– Rendering and editing

– Semantics (e.g., by translation)

• Other issues

– Serialization, language evolution, consistency

management and change propagation, etc.

• Tools for DSLs become mainstream…

– Direct metamodeling

• Microsoft, Xactium, …, (EMF)

– UML profiling

(38)

Overview

• Generative Software Development

• Example

• Staged Configuration using Feature

Models

• FeaturePlugin

¨Summary

(39)

Key Concepts in Generative

Software Development

• Product lines

– Cornerstone of systematic software reuse

• Domain-specific languages

– Optimal support for application developers

• Mappings

– Design knowledge capture

• Feature modeling

– Family scoping, DSL & architecture

development

(40)

Further Information

• Czarnecki & Eisenecker. “Generative

Programming: Methods, Tools, and

Applications.” Addison-Wesley, 2000

– http://www.swen.uwaterloo.ca/~kczarnec/

• Greenfield & Short. “Software Factories:

Assembling Applications With Patterns,

Models, Frameworks and Tools.” Wiley,

2004

(41)

References

Related documents

Maurer claimed to be giving his “opinion as a man,” rather than as his country’s prime minister, when he bluntly warned the US ambassador in October 1965 that, by bombing

The Fortinet Zero Trust Access (ZTA) framework uses a tightly integrated collection of security solutions that help organizations identify and classify all users and devices that

Contrary to the mediation provided to children who were highly sensitive to stimuli, maternal interactions with children who were sensory avoiding (characterized by low levels

That is, we can analyse the distribution element by element and explain the deviation between the size predicted by Zipf’s Law (associated with a Pareto exponent equal to one) and

 October 23 - Last day for students to initiate a change of grade for courses taken in the preced- ing Spring semester or Summer session.  October 29 - Last day to withdraw

4)...(go) to a different railway station every week and 5)...(write down) the engine number of every train he sees. By the time he was fifteen he 7)...(collect) over 10.000 different

Chairman: Pasquale SCARAMOZZINO, University of Rome “Tor Vergata” Speakers:. Lilia CAVALLARI and Stefano D’ADDONA, Roma Tre University, “Trade Margins

Advocates argue that target zones blend the advantages of fixed exchange rates and flexible exchange rate systems.2 Krugman and Miller (1992) point out that the original