Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

EMF Scaffolding

on

  • 1,355 views

 

Statistics

Views

Total Views
1,355
Views on SlideShare
920
Embed Views
435

Actions

Likes
2
Downloads
8
Comments
0

4 Embeds 435

http://code-opensocial.googleusercontent.com 426
https://code-opensocial.googleusercontent.com 6
http://cedricvidal.blogspot.com 2
http://fr.slideshare.net 1

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

EMF Scaffolding EMF Scaffolding Presentation Transcript

  • EMF
    Scaffolding
    Version 1.0
  • Agenda
    WhatisScaffolding ?
    Scaffolding in software
    Scaffoldingapplied to MDSD
    MDSD Scaffoldingapproaches
    Benefits
  • Whatisscaffolding ?
    Scaffolds are temporary structures that physically support workers while they complete jobs that would otherwise be impossible(HH93, p138)
  • Scaffolding in software
    Ruby on Rails
    *Rails scriptingframeworksbringblazingfastproductivity in theirownspecifictechnologicalspace
    MainlythroughScaffolding !
  • Ruby on Rails Scaffolding
    Meta-Programming
    Scaffoldingworksat the code level
    Scaffoldingengineoperates on code as a model
    Can beeither
    Static : on demand
    Dynamic : transparently on yourbehalf
    Entity.rb
    DAO.rb
  • Others
    Ruby On Rails
    Grails
    Spring ROO
    Play!
    CakePHP
    Monorail
    Symfony

  • What’s the point ?
    Model-Drivenbringsquality, durability, maintainability
    What about productivity ?
    Goal: Enhancemodelingexpressiveness, simplicity and overwholeproductivity
  • Objective
    Achievebothquality AND productivity
    BringScaffolding to Modeling
  • WhatisScaffoldingapplied to Modeling ?
    Creating partial model structures on behalf of the designer that hewouldotherwise have to create by himself
  • Model Scaffoldingtaxonomy
    Blind versus In-PlaceScaffolding
    Static versus DynamicScaffolding
    The greener the better
  • Model Scaffoldingtaxonomy
    Classical code generation
    Compensated code generation
    « Blind » scaffolding
    « In-Place » scaffolding
    Eachstatic or dynamic
  • Sampleproblemdomain
    3-Tiers Architecture
    DSL containing concepts
    Entity
    DAO
    Service
    Java code isgenerated
    Légende
    Entity or DAO
    File
    Service
    Generation
    Reference
    Model separation
    Color code
    Hand-written
    Scaffolded
    Generated
  • Classical code generation 1/2
    Entities are modeled
    Entity and DAO source codes are generatedfrom the modeledEntity
    Problem: What if youwant to definequeries in your model ?
    Model
    Entity
    Text
    DAO.java
    Entity.java
  • Classical code generation 2/2
    Entity and DAOs are modeled
    Entity source code isgeneratedfrom the modeledEntity
    DAO source code isgeneratedfrommodeled DAO
    DAOswhich are not modeled are not generated
    Problem: You need to define all DAOs…
    Eventhosethatonly do CRUD
    Model
    DAO
    Entity
    Text
    DAO.java
    Entity.java
  • Compensated code generation
    Source code isstillgeneratedfor modeledelements
    For Entitieswhich have no modeled DAO, wecompensate by generatingsource code for the DAO from the modeledEntity
    Advantage: Only custom DAOs are modeled
    Problem: DAO code generationlogicisduplicated
    Entity -> DAO.java
    DAO -> DAO.java
    Model
    Entity
    One
    DAO
    One
    Entity
    Two
    One.java
    TwoDAO.java
    Two.java
    OneDAO.java
    Text
  • Generation « Blind » Model Scaffolding
    Model i
    Entity
    Two
    Each model is a step in the MDSD chain
    An intermediatestepisintroduced
    Each model canonly « see » the model before
    Existingelements are copied as is
    A DAO isgenerated for eachentitywhich has no DAO
    Advantage: Only one DAO code generationlogic
    Problem: How do youreferencescaffoldedelements
    DAO
    TwoDao
    Entity
    One
    Model i-bis
    Entity
    Two
    DAO
    TwoDao
    Entity
    One
    DAO
    OneDao
    Model i+1
    One.java
    TwoDAO.java
    Two.java
    OneDAO.java
  • How to referencescaffoldedelements ?
    The problemisillustrated by introducing a service
    The ‘Alpha’ service canreference the modeled DAO ‘TwoDao’ but not the scaffolded DAO ‘OneDao’
    The scaffolded DAO ‘OneDao’ islocated in a model that the ‘Alpha’ service cannotsee
    Problem: « Blind » scaffoldingdoesn’tallowscaffoldedelementsreferencing
    Modèle i
    DAO
    TwoDao
    Entity
    Two
    Entity
    One
    Service
    Alpha
    Modèle i-bis
    DAO
    OneDao
    Entity
    One
  • « In-place » Model Scaffolding
    ‘OneDao’ DAO isscaffolded in the same model as Entity ‘One’
    The DAO is « visible » withoutbeingmaterialized in the input model
    Advantage: Le ‘Alpha’ service canreference the scaffolded DAO ‘OneDao’
    Problem: How to customize a scaffoldedelement ?
    Model i
    Entity
    One
    DAO
    OneDao
    Service
    Alpha
    Model i+1
    One.java
    AlphaService.java
    OneDao.java
  • Takeover 1/3: Overview
    User cantake over scaffoldedelements
    The over takenelementisthenmaterialized in the input model
    Advantage: The DAO canbecustomized
    Iteration n
    Entity
    One
    DAO
    OneDao
    Service
    Alpha
    Iteration n+1
    Entity
    One
    DAO
    OneDao
    Service
    Alpha
  • Takeover 2/3: Zoom
    After the DAO taking over, CRUD methods are stillscaffolded
    Advantage: No need to manually input previouslyscaffoldedelements
    DAO
    OneDao
    Iteration n
    Entity
    One
    Service
    Alpha
    create
    read
    update
    delete
    Iteration n+1
    DAO
    OneDao
    Entity
    One
    Service
    Alpha
    create
    read
    update
    delete
  • Takeover 3/3: Customisation
    Iteration n+1
    Let’sadd a finderfinder
    CRUD methods are stillscaffolded
    Advantage: Onlycustomizations are hand written, CRUD methods are scaffolded
    DAO
    OneDao
    Entity
    One
    Service
    Alpha
    create
    read
    update
    delete
    Iteration n+2
    DAO
    OneDao
    Entity
    One
    Service
    Alpha
    create
    read
    update
    delete
    myFinder
  • Deletion 1/2: The problem
    Whathappens if the user deletes an element for whichelementswerescaffolded ?
    Scaffoldedelements must alsobedeleted
    Model i
    Entity
    One
    DAO
    OneDao
    Service
    Alpha
    Model i+1
    One.java
    AlphaService.java
    OneDao.java
  • Deletion 2/2: solutions
    Need to keeptrackof scaffoldedelements
    Onlyreally a problemwithdynamic « in-place » scaffolding
    For static and/or « blind » scaffolding, scaffoldedelementscanjustbecomputed all over again
  • Model scaffoldingcomparison
  • WhatScaffoldingengine ?
    A model to model transformation engine ?
    ATL
    Xtend
    QVT Operational
    QVT Relational
    Obeo Transfo

    A ruleengine ?
    Drools
    Any OO RuleEngine …
  • A ruleengine ??
    Scaffoldingrules as production rules
    The model as a workingmemory
    Model elements as facts
    When a givenconditionis met, new factsare insertedintoworkingmemory
    Those new facts are attached to the model as new elements
  • Ruleenginesyncprocess
    Working Memory
    Model
    Entity
    One
    synchronize
    Entity
    One
    reference
    ScaffoldingRule
    reference
    DAO
    OneDao
    DAO
    OneDao
    synchronize
  • Droolssamplerule
    SampleDrools DAO scaffoldingrule
  • MDSD Scaffoldingbenefits
    Acceleratesmodeling
    Allows to quickly come up with a working model
    The user startsfrom the beginingwith a complete model (complete in the direction the scaffoldingtakeshim)
    Provides the user with a fastfeedback
    Allows to enrich the input model as well as facilitatingits usage for the new user
    Bringsflexibilitywhilekeepingsimplicity
    Scaffoldingcanbecomplemented by code generationand model validation
    The user canwheneverhewantstake over the scaffoldedelements in order to customizethem