eclipse 4 (e4) the next generation of rcp - jug · eclipse 4 (e4) – the next generation of rcp...
TRANSCRIPT
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
1
Eclipse 4 (e4) – the next generation of RCP
Jonas Helming
EclipseSource
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
2
Who is Jonas Helming?
• Software Engineer / Trainer /
General Manager at EclipseSource
Munich
• Visiting lecturer at Technische
Universität München
• Committer at EMFStore, EMF Client
Platform, EDAPT
• Author for Eclipse Magazin, Java
aktuell and Jaxx Enter
• Blog: http://eclipsesource.com/blogs/author/jhelming/
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
3
Eclipse is…
A Java IDE
A Tools Platform
An Application Platform (Rich Client Platform)
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
4
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
5
Eclipse 4 Target
Make Eclipse RCP development more effective and the
result more visual appealing
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
6
What is e4?
• e4 is an incubator Eclipse project to produce
innovations on the platform
• Eclipse 4.x are releases which contain some parts of
the project e4
• Parts of e4 are also used in the 3.x stream
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
7
Why do we need e4?
• Innovation is difficult in 3.x
• More diverse community
• Technical improvements
• more modular
• more flexible
• less dependencies
+ Fix design mistakes from 3.x!
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
8
What is wrong with 3.x?
• Complexity
• Very complex workbench API
• Workbench is not generic (e.g. Editors)
• Hard to test
• Singletons
• Always looks like an IDE
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
9
Agenda Today
• Modeled Workbench
• Dependency Injection
• Annotations
• Services
• Outlook
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
10
Example Application
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
11
The 3.x Workbench
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
12
The modeled Workbench
• Workbench is an
EMF model
• Can be modified
like EMF
Single entry point
Editor available
Modification during
runtime
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
13
Workbench model
WorkbenchModel
DetailsView
TreeView injects
TestCase
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
14
Dependency Injection
Hollywood principle: „Do not call us, we call you!“
Your Class (POJO)
This is what I need
E4
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
15
Singletons
Singleton
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
16
Core Services
• Example: Loggin in 3.x
E4 proudly presents:
The 20 things!
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
17
Dependency Injection Details
Injections are updated if the value changes
Contexts can be hierachical
@Inject: Tries to satisfy the requested type
@Named: Define a key, which is used for look-up
@Optional: Injects null, if not available
Context
Map <String, Object>
YourClass
@Inject
SomeThing
injects
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
18
The selection service
PlayerListView
@Inject
Service1
SelectionService
PlayerListView
@Inject
Selection
sets selection retrieves selection
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
19
Annotations
A handler in 3.x
A handler in E4
How to test this?
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
20
Always looks like an IDE
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
21
Styling
Warning: I am not an artist!
CSS
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
22
Migration from 3.x?
• E4 offers a compatibility layer (Warning there have
been issues in the past).
• E4 only offers benefits, if you use the new concepts
• There are efforts to make single sourcing as easy as
possible (Tom Schindl)
• Many things like styling or dependency injection can
be used in 3.x, too!
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
23
Option1: Pure e4 Application
• Benefits:
• Use all concepts such as dependency injection, modeled
workbench, CSS
• Clean design
• Disadvantages:
• Existing UI componentes need to be migrated
• External UI componentes might not work at all!
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
24
Option 2: Pure Compatibility Layer
• Benefits:
• Clean design
• Reuse existing UI components
• Reuse external UI componentes
• Disadvantages:
• Concepts such as dependency injection, modeled
workbench are not available
• Potential instability
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
25
Option 3: Mixing e4 and 3.x
• Benefits:
• Use all concepts such as dependency injection, modeled
workbench for new components
• Reuse existing UI components
• Reuse external UI componentes
• Disadvantages:
• Almost no proof of concept
• Mix of technologies
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
26
Ways of mixing e4 with 3.x
The compatibility layer mocks org.eclipse.ui and
translates all calls and extensions to an Application
Model in the background
Option 1: Add contributions to this model. Not well
supported yet
Option 2. Register contributions as in 3.x but use a
warpper for an e4 POJO
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
27
Single Sourcing
Keep your application independant from technologies
YourWrapper
execute()
Interface
execute()
YourPOJO
execute()
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
28
More Information
• E4 Wiki
• E4 Newsgroup
• Blogs
• Tutorial: eclipsesource.com/eclipse4tutorial
• Professional Training => eclipsesource.com/munich
© 2012 EclipseSource | June 25th 2012 | http://eclipsesource.com/munich
29
Dependency Injection
e4