A companion presentation for
https://cv.pavel.vlasov.us/model-driven-development/
Model-Driven Development
 Software development is a process of binding decisions
to make them executable.
 Deep knowledge -> good decisions.
 Domain model is an abstract representation of the
knowledge and activities which govern a particular
application or problem domain.
 Map is a model of a territory – different maps for
different purposes – all models are wrong, some are
useful.
Eclipse Modeling Framework
 Create a model
 Tree editor
 Diagram editor
 EMF Forms editor
 Generate code
 Implement EOperations
 Repeat – the generator merges manual changes with
the generated code.
EMF Diagram Editor
Source - https://www.eclipse.org/ecoretools/
EMF Tree Editor
EMF Forms Editor
Great idea, but it does not support all modeling features 
Generated Model Editor*
* The form on the right is a customization - https://github.com/Nasdanika/presentation
Other EMF Technologies
 Sirius - https://eclipse.org/sirius/overview.html
 EMF Forms - https://www.eclipse.org/ecp/emfforms/
 Xtext - https://www.eclipse.org/Xtext/
 Xcore - https://wiki.eclipse.org/Xcore
Nasdanika CDO Web Bundle
Web UI rendered from a model:
 Left panel – the tree of objects readable by the current user.
 Breadcrumbs – object path.
 Object details view.
 Context menu – left panel, breadcrumbs, object links.
 Context help.
Nasdanika CDO Web Bundle
Tooltips – the first sentence from the model documentation.
Nasdanika CDO Web BundleClick on the question mark – full element documentation in a dialog.
Nasdanika CDO Web Doc Bundle
Model documentation
Nasdanika CDO Web Doc Bundle
Context diagrams
Nasdanika CDO Web Doc Bundle
Runtime – bundles, components, services; TOC search
Nasdanika CDO Web Doc Bundle
Full text search
Nasdanika CDO Web Doc Bundle
Hand-crafted documentation
Code Generation
 Capture knowledge in models
 Generator models
 Input/configuration models
 Transform models to code
Nasdanika CodegenAbstracts low-level generation API’s. Example below – Web UI Generation Target Generator model.
Nasdanika Codegen Ecore
Generates a Bounded Context
Model element
documentation
Generation target
configuration
(EMF Forms)
Select model
elements for
generation
Web UI Generation Target
Configuration model. The generator model is two slides above.
From the previous slide:
Generation target
configuration
(EMF Forms)
Web UI Generation TargetGenerator controller example
Iterates over EClasses
in an EPackage.
Creates a sub-context
for each class.
The compilation unit generator is invoked for
each context returned by iterate().
Multiple representation options
Model
Tree
Diagram
EMF
Forms
Master-
Detail
Wizard
Multi-
Form
Web UI
REST
API
Xtext
Call for Action
 Think in terms of decisions binding and knowledge flow and transformation.
 Capture domain knowledge in documented models and host model
documentation on the intranet.
 Use your best talent to capture repetitive coding patterns in generation model
and create wizards for materializing those patterns.
 Improve knowledge gathering. Many a micle makes a muckle.
 Incorporate code generation into the build process.
 Improve internal processes with model-driven intranet web applications.
References
 https://cv.pavel.vlasov.us/model-driven-development/
 https://github.com/Nasdanika

Model-driven development and Code generation

  • 1.
    A companion presentationfor https://cv.pavel.vlasov.us/model-driven-development/
  • 2.
    Model-Driven Development  Softwaredevelopment is a process of binding decisions to make them executable.  Deep knowledge -> good decisions.  Domain model is an abstract representation of the knowledge and activities which govern a particular application or problem domain.  Map is a model of a territory – different maps for different purposes – all models are wrong, some are useful.
  • 3.
    Eclipse Modeling Framework Create a model  Tree editor  Diagram editor  EMF Forms editor  Generate code  Implement EOperations  Repeat – the generator merges manual changes with the generated code.
  • 4.
    EMF Diagram Editor Source- https://www.eclipse.org/ecoretools/
  • 5.
  • 6.
    EMF Forms Editor Greatidea, but it does not support all modeling features 
  • 7.
    Generated Model Editor* *The form on the right is a customization - https://github.com/Nasdanika/presentation
  • 8.
    Other EMF Technologies Sirius - https://eclipse.org/sirius/overview.html  EMF Forms - https://www.eclipse.org/ecp/emfforms/  Xtext - https://www.eclipse.org/Xtext/  Xcore - https://wiki.eclipse.org/Xcore
  • 9.
    Nasdanika CDO WebBundle Web UI rendered from a model:  Left panel – the tree of objects readable by the current user.  Breadcrumbs – object path.  Object details view.  Context menu – left panel, breadcrumbs, object links.  Context help.
  • 10.
    Nasdanika CDO WebBundle Tooltips – the first sentence from the model documentation.
  • 11.
    Nasdanika CDO WebBundleClick on the question mark – full element documentation in a dialog.
  • 12.
    Nasdanika CDO WebDoc Bundle Model documentation
  • 13.
    Nasdanika CDO WebDoc Bundle Context diagrams
  • 14.
    Nasdanika CDO WebDoc Bundle Runtime – bundles, components, services; TOC search
  • 15.
    Nasdanika CDO WebDoc Bundle Full text search
  • 16.
    Nasdanika CDO WebDoc Bundle Hand-crafted documentation
  • 17.
    Code Generation  Captureknowledge in models  Generator models  Input/configuration models  Transform models to code
  • 18.
    Nasdanika CodegenAbstracts low-levelgeneration API’s. Example below – Web UI Generation Target Generator model.
  • 19.
    Nasdanika Codegen Ecore Generatesa Bounded Context Model element documentation Generation target configuration (EMF Forms) Select model elements for generation
  • 20.
    Web UI GenerationTarget Configuration model. The generator model is two slides above. From the previous slide: Generation target configuration (EMF Forms)
  • 21.
    Web UI GenerationTargetGenerator controller example Iterates over EClasses in an EPackage. Creates a sub-context for each class. The compilation unit generator is invoked for each context returned by iterate().
  • 22.
  • 23.
    Call for Action Think in terms of decisions binding and knowledge flow and transformation.  Capture domain knowledge in documented models and host model documentation on the intranet.  Use your best talent to capture repetitive coding patterns in generation model and create wizards for materializing those patterns.  Improve knowledge gathering. Many a micle makes a muckle.  Incorporate code generation into the build process.  Improve internal processes with model-driven intranet web applications.
  • 24.