to spice up your projects with EMF Parsley Lorenzo Bettini - - PowerPoint PPT Presentation

to spice up your projects
SMART_READER_LITE
LIVE PREVIEW

to spice up your projects with EMF Parsley Lorenzo Bettini - - PowerPoint PPT Presentation

Five good reasons to spice up your projects with EMF Parsley Lorenzo Bettini Francesco Guidieri EclipseCon France 2016 Toulouse - June 8, 2016 About us Lorenzo Bettini Dip. Informatica, Univ. Firenze, Italy bettini@disia.unifi.it


slide-1
SLIDE 1

Five good reasons to spice up your projects with EMF Parsley

Lorenzo Bettini Francesco Guidieri

EclipseCon France 2016

Toulouse - June 8, 2016

slide-2
SLIDE 2

@EmfParsely www.eclipse.org/emf-parsley

About us

Lorenzo Bettini

  • Dip. Informatica, Univ. Firenze, Italy

bettini@disia.unifi.it @lorenzo_bettini www.lorenzobettini.it

Vincenzo Caselli

RCP Vision

vincenzo.caselli@rcp-vision.com @vcaselli www.rcp-vision.com

Francesco Guidieri

RCP Vision

francesco.guidieri@rcp-vision.com @fraguid www.rcp-vision.com

slide-3
SLIDE 3

@EmfParsely www.eclipse.org/emf-parsley

What is EMF Parsley?

Parsley provides an easy way to get a User Interface for EMF models:

  • with built-in UI components
  • easy customizations
  • with a powerful DSL
slide-4
SLIDE 4

@EmfParsely www.eclipse.org/emf-parsley

Five good reasons

  • very lightweight and straightforward to use
  • out-of-the-box integrations with XMI, Teneo and CDO
  • dependency Injection (via Google Guice) instead of

Extension Point mechanism

  • Eclipse/JDT integrated DSL with a static type system
  • code-generation oriented (debuggable!) instead of a

reflective approach (no bad runtime surprises)

slide-5
SLIDE 5

@EmfParsely www.eclipse.org/emf-parsley

Parsley Components

Basic components can be used

  • ut of the box:
  • Tree
  • Table
  • Form
  • Tree Form
  • Table Form
  • Dialog
slide-6
SLIDE 6

@EmfParsely www.eclipse.org/emf-parsley

… and more!

  • All components are provided as Java APIs
  • There are some views as reference implementation
  • Project Wizards with initial templates
  • Many examples to import
  • A rich Eclipse tooling
slide-7
SLIDE 7

@EmfParsely www.eclipse.org/emf-parsley

Typical EMF boilerplate code

slide-8
SLIDE 8

@EmfParsely www.eclipse.org/emf-parsley

Tree code example

@Inject ViewerFactory viewerFactory; (...) treeViewer = new TreeViewer(parent); viewerFactory.initialize(treeViewer, element);

Instead in EMF Parsley the code is very simple

slide-9
SLIDE 9

@EmfParsely www.eclipse.org/emf-parsley

Table code example

@Inject ViewerFactory viewerFactory; (...) tableViewer = viewerFactory.createTableViewer(composite,SWT.BORDER | SWT.FULL_SELECTION, object, eClass);

slide-10
SLIDE 10

@EmfParsely www.eclipse.org/emf-parsley

Form code example

@Inject FormFactory formFactory; (...) formComposite = formFactory.createFormDetailComposite(parent, SWT.NONE); formComposite.init(eObject);

slide-11
SLIDE 11

@EmfParsely www.eclipse.org/emf-parsley

  • Import First Example
  • Project structure
  • Dsl and generated code
  • Run
  • Show runtime features

First demo

slide-12
SLIDE 12

@EmfParsely www.eclipse.org/emf-parsley

How it works

  • Parsley UI is built on top of EMF.Edit reflective

framework,

  • the default behavior is delegated to EMF Edit
  • or your .edit project
  • Customizations are based on Dependency Injection:
  • no need to inherit parts and composites
  • change single behaviors / aspects
  • inject them in the runtime
  • purely Java
slide-13
SLIDE 13

@EmfParsely www.eclipse.org/emf-parsley

EMF Parsley DSL

  • Implemented in Xtext, using Xbase
  • Interoperable with the Java type system
  • IDE tooling (including Debugging)
  • Specify customizations in one single file in a

compact form

  • Generates the corresponding Java code
  • Generates the Guice bindings
  • You can use the DSL and manually written Java code

together

slide-14
SLIDE 14

@EmfParsely www.eclipse.org/emf-parsley

All expressions are statically type-checked / inferred

Static type checking

slide-15
SLIDE 15

@EmfParsely www.eclipse.org/emf-parsley

DSL Java interoperability

  • Access to all Java types
  • According to project dependencies/classpath
  • DSL elements can extends your Java classes
  • DSL fully debuggable!
slide-16
SLIDE 16

@EmfParsely www.eclipse.org/emf-parsley

Imports management

  • Automatic import
  • Quick fixes
slide-17
SLIDE 17

@EmfParsely www.eclipse.org/emf-parsley

JDT Integration

slide-18
SLIDE 18

@EmfParsely www.eclipse.org/emf-parsley

All artifacts are generated and kept in synch:

  • Java implementations
  • plugin.xml
  • Fully integrated with Eclipse Building mechanism
  • All files are generated on DSL save

Integrated Building

slide-19
SLIDE 19

@EmfParsely www.eclipse.org/emf-parsley

Second Demo: Debug

slide-20
SLIDE 20

@EmfParsely www.eclipse.org/emf-parsley

Customizations

There are many levels of customizations:

  • EMF Edit – the default behaviour
  • DSL customizations – the easy way
  • Google Guice / Java – not only for the brave! 
slide-21
SLIDE 21

@EmfParsely www.eclipse.org/emf-parsley

Default Behavior

Default behavior is delegated to EMF.Edit

Content Features Label Menu 1 Menu 2 Default

slide-22
SLIDE 22

@EmfParsely www.eclipse.org/emf-parsley

Tree content customization

Features Label Menu 1 Menu 2 Default Content

slide-23
SLIDE 23

@EmfParsely www.eclipse.org/emf-parsley

Feature customizations

Label Menu 1 Menu 2 Default Content Features

slide-24
SLIDE 24

@EmfParsely www.eclipse.org/emf-parsley

Label and caption customizations

Default Content Features Menu 1 Menu 2 Label

slide-25
SLIDE 25

@EmfParsely www.eclipse.org/emf-parsley

Menu customizations

Default Content Label Menu 1 Menu 2 Features

slide-26
SLIDE 26

@EmfParsely www.eclipse.org/emf-parsley

Menu customizations

Default Content Features Label Menu 1 Menu 2

slide-27
SLIDE 27

@EmfParsely www.eclipse.org/emf-parsley

Demo from scratch

  • Create a new Project with EMF Parsley wizard
  • Use a “On Selection Tree Form” view
  • Customize to visualize an Ecore
  • Show interactions with Ecore editor
slide-28
SLIDE 28

@EmfParsely www.eclipse.org/emf-parsley

Fully EMF compliance

  • EMF Resource Compliant
  • Editing Domain
  • Notification system, Undo/Redo, DnD, etc..
  • EMF standard persistence (CDO, Teneo, XMI)
slide-29
SLIDE 29

@EmfParsely www.eclipse.org/emf-parsley

Big App friendly

EMF Parsley helps you to organize big applications

  • All customizations related to a single view are in the

same plugin

  • The DSL collects all aspects configurations /

customizations in a compact form

  • You can use Ctrl-Shift-F3 to search across projects
slide-30
SLIDE 30

@EmfParsely www.eclipse.org/emf-parsley

When a new version is released, a simple project clean will upgrade your code

  • Purely Java runtime APIs
  • No migrations needed (no model underneath)
  • If runtime is updated the DSL will do the work for

you

Easy upgrading

slide-31
SLIDE 31

@EmfParsely www.eclipse.org/emf-parsley

EMF Parsley is ready to be used in production!

  • Graduation release in Neon
  • It’s used in deployed applications with both RCP and RAP

implementations

  • You can switch between persistence implementations without

much effort

Production ready

slide-32
SLIDE 32

@EmfParsely www.eclipse.org/emf-parsley

Code Quality

slide-33
SLIDE 33

@EmfParsely www.eclipse.org/emf-parsley

Code Quality

slide-34
SLIDE 34

@EmfParsely www.eclipse.org/emf-parsley

Prototypes

slide-35
SLIDE 35

@EmfParsely www.eclipse.org/emf-parsley

EMF Parsley resources

Homepage

  • www.eclipse.org/emf-parsley

Documentation

  • https://www.eclipse.org/emf-parsley/documentation.html

Forum

  • https://www.eclipse.org/forums/index.php/f/263/

Bugzilla

  • https://bugs.eclipse.org/bugs/buglist.cgi?product=EMF.Parsley
slide-36
SLIDE 36

EMF Parsley resources

slide-37
SLIDE 37

@EmfParsely www.eclipse.org/emf-parsley

Showtime