Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Model-driven development and Code generation

96 views

Published on

This presentation outlines key points of some aspects of model-driven development and the benefits it can bring to software development in large distributed organizations.

It is a companion presentation for https://cv.pavel.vlasov.us/model-driven-development/.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Model-driven development and Code generation

  1. 1. A companion presentation for https://cv.pavel.vlasov.us/model-driven-development/
  2. 2. 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.
  3. 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. 4. EMF Diagram Editor Source - https://www.eclipse.org/ecoretools/
  5. 5. EMF Tree Editor
  6. 6. EMF Forms Editor Great idea, but it does not support all modeling features 
  7. 7. Generated Model Editor* * The form on the right is a customization - https://github.com/Nasdanika/presentation
  8. 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. 9. 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.
  10. 10. Nasdanika CDO Web Bundle Tooltips – the first sentence from the model documentation.
  11. 11. Nasdanika CDO Web BundleClick on the question mark – full element documentation in a dialog.
  12. 12. Nasdanika CDO Web Doc Bundle Model documentation
  13. 13. Nasdanika CDO Web Doc Bundle Context diagrams
  14. 14. Nasdanika CDO Web Doc Bundle Runtime – bundles, components, services; TOC search
  15. 15. Nasdanika CDO Web Doc Bundle Full text search
  16. 16. Nasdanika CDO Web Doc Bundle Hand-crafted documentation
  17. 17. Code Generation  Capture knowledge in models  Generator models  Input/configuration models  Transform models to code
  18. 18. Nasdanika CodegenAbstracts low-level generation API’s. Example below – Web UI Generation Target Generator model.
  19. 19. Nasdanika Codegen Ecore Generates a Bounded Context Model element documentation Generation target configuration (EMF Forms) Select model elements for generation
  20. 20. Web UI Generation Target Configuration model. The generator model is two slides above. From the previous slide: Generation target configuration (EMF Forms)
  21. 21. 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().
  22. 22. Multiple representation options Model Tree Diagram EMF Forms Master- Detail Wizard Multi- Form Web UI REST API Xtext
  23. 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. 24. References  https://cv.pavel.vlasov.us/model-driven-development/  https://github.com/Nasdanika

×