Whats next for e4 Tom Schindl <tom.schindl@bestsolution.at> - - PowerPoint PPT Presentation

what s next for e4
SMART_READER_LITE
LIVE PREVIEW

Whats next for e4 Tom Schindl <tom.schindl@bestsolution.at> - - PowerPoint PPT Presentation

Whats next for e4 Tom Schindl <tom.schindl@bestsolution.at> Twitter: @tomsontom Website: http://www.bestsolution.at About Tom CTO BestSolution.at Systemhaus GmbH Eclipse Committer e4 Platform EMF Project lead


slide-1
SLIDE 1

What’s next for e4

Tom Schindl <tom.schindl@bestsolution.at> Twitter: @tomsontom Website: http://www.bestsolution.at

slide-2
SLIDE 2

(c) BestSolution.at - Licensed under Creative Commons Attribution-NonCommerical-ShareAlike 3.0

About Tom

  • CTO BestSolution.at Systemhaus GmbH
  • Eclipse Committer
  • e4
  • Platform
  • EMF
  • Project lead
  • e(fx)clipse
  • Twitter: @tomsontom
  • Blog: tomsondev.bestsolution.at
  • Corporate: http://bestsolution.at
slide-3
SLIDE 3

Q: Tom can you reflect a 
 bit on the Eclipse 4?

slide-4
SLIDE 4

The compat layer

slide-5
SLIDE 5

The combat layer

slide-6
SLIDE 6

e4 spec’ed world

Application Model

The Brain

(OSGi) Service Components & DI-Container

Nervous system

UI (SWT/FX/…)

Sense organ

slide-7
SLIDE 7

combat world

Application Model

The (split) Brain Nervous system

UI (SWT/ FX/…)

Sense organ

$n - Registries Legacy Compat- Layer DI & Service

slide-8
SLIDE 8

Q:Tom what’s your take on e4 core and DI components?

slide-9
SLIDE 9

How OSGi spec’ed the world

Service-API

(requires NOTHING)

Service-Impl 1

(requires Equinox, …)

Service-Impl $N

(requires Felix, …)

Consumer

(requires Service-API)

slide-10
SLIDE 10

How e4 core implemented it

Service-API

(requires Equinox)

Service-Impl 1 Consumer

(requires Service-API & transitive Equinox)

slide-11
SLIDE 11

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.core.di … Import-Package: javax.annotation, javax.inject;version=„1.0.0"

Wanna see an example

slide-12
SLIDE 12

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.core.di … Import-Package: javax.annotation, javax.inject;version=„1.0.0"

Wanna see an example

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.core.di … Import-Package: javax.annotation, javax.inject;version="1.0.0",

  • rg.eclipse.osgi.framework.log;version="1.1.0",
  • rg.eclipse.osgi.service.debug;version="1.2.0",
  • rg.osgi.framework;version="1.8.0",
  • rg.osgi.util.tracker;version="1.5.1"
slide-13
SLIDE 13

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.core.di … Import-Package: javax.annotation, javax.inject;version=„1.0.0"

Wanna see an example

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-SymbolicName: org.eclipse.e4.core.di … Import-Package: javax.annotation, javax.inject;version="1.0.0",

  • rg.eclipse.osgi.framework.log;version="1.1.0",
  • rg.eclipse.osgi.service.debug;version="1.2.0",
  • rg.osgi.framework;version="1.8.0",
  • rg.osgi.util.tracker;version="1.5.1"

ONLY NEEDED BY IMPL

slide-14
SLIDE 14

Q: Tom what’s your take on OSGi in e4 APIs?

slide-15
SLIDE 15

Ideal OSGi App world

slide-16
SLIDE 16

Ideal OSGi App world

A-API-Bundle

(requires NOTHING)

slide-17
SLIDE 17

Ideal OSGi App world

A-API-Bundle

(requires NOTHING)

A Impl-Bundle

(requires NOTHING)

slide-18
SLIDE 18

Ideal OSGi App world

A-API-Bundle

(requires NOTHING)

A Impl-Bundle

(requires NOTHING)

B Impl-Bundle

(requires Comp A-API-Bundle)

slide-19
SLIDE 19

Ideal OSGi App world

A-API-Bundle

(requires NOTHING)

A Impl-Bundle

(requires NOTHING)

B Impl-Bundle

(requires Comp A-API-Bundle) public interface A { }

slide-20
SLIDE 20

Ideal OSGi App world

A-API-Bundle

(requires NOTHING)

A Impl-Bundle

(requires NOTHING)

B Impl-Bundle

(requires Comp A-API-Bundle) public interface A { } @Component public class ImplA implements A { }

slide-21
SLIDE 21

Ideal OSGi App world

A-API-Bundle

(requires NOTHING)

A Impl-Bundle

(requires NOTHING)

B Impl-Bundle

(requires Comp A-API-Bundle) public interface A { } @Component public class ImplA implements A { } @Component public class ImplB { @Reference(cardinality= ReferenceCardinality.MANDATORY) public void setCompA(A a) {} public void unsetCompA(A a) {} }

slide-22
SLIDE 22

e4 OSGi usage

A Impl-Bundle

(requires NOTHING)

B Impl-Bundle

(requires Comp A-API-Bundle)

A-API-Bundle

(requires NOTHING)

slide-23
SLIDE 23

e4 OSGi usage

A Impl-Bundle

(requires NOTHING)

B Impl-Bundle

(requires Comp A-API-Bundle)

A-API-Bundle

(requires NOTHING) public interface A { } @Component public class ImplA implements A { }

slide-24
SLIDE 24

e4 OSGi usage

A Impl-Bundle

(requires NOTHING)

B Impl-Bundle

(requires Comp A-API-Bundle)

A-API-Bundle

(requires NOTHING) public interface A { } @Component public class ImplA implements A { } public class ImplB { @Inject public void setCompA(A a) {} }

slide-25
SLIDE 25

e4 OSGi usage

IEclipseContext serviceContext = … B a = ContextInjectionFactory.make(B.class, serviceContext);

slide-26
SLIDE 26

e4 OSGi usage

Bundle bundle = FrameworkUtil.getBundle(BlaBla.class) BundleContext btx = bundle.getBundleContext(); IEclipseContext serviceContext = EclipseContextFactory.getServiceContext(btx); B a = ContextInjectionFactory.make(B.class, serviceContext);

slide-27
SLIDE 27

Q: What API does e4 use from OSGi?

slide-28
SLIDE 28

e4 OSGi API useage

slide-29
SLIDE 29

e4 OSGi API useage

Pattern 1 - Debug/Log

import org.eclipse.osgi.framework.log.FrameworkLog; import org.eclipse.osgi.framework.log.FrameworkLogEntry; FrameworkLog log = … FrameworkLogEntry logEntry = new FrameworkLogEntry("org.eclipse.core.e4.di", FrameworkLogEntry.ERROR, 0, "I’m an error", 0, e, null);

slide-30
SLIDE 30

e4 OSGi API useage

Pattern 1 - Debug/Log

import org.eclipse.osgi.framework.log.FrameworkLog; import org.eclipse.osgi.framework.log.FrameworkLogEntry; FrameworkLog log = … FrameworkLogEntry logEntry = new FrameworkLogEntry("org.eclipse.core.e4.di", FrameworkLogEntry.ERROR, 0, "I’m an error", 0, e, null);

Pattern 2 - Accessing OSGi-Service

BundleContext bundleContext = FrameworkUtil.getBundle(BlaBla.class).getBundleContext(); ServiceReference<ComponentA> serviceReference = bundleContext.getServiceReference(GreetService.class); if( serviceReference != null ) { bundleContext.getService(serviceReference).greet("Hello Tom"); }

slide-31
SLIDE 31

Q: Ok. Got you. But can anything be done against that

slide-32
SLIDE 32

Logging the efxclipse way

Access Patterns

slide-33
SLIDE 33

Logging the efxclipse way

Access Patterns

public class ComponentEarly2000 { private static Logger logger = LoggerCreator.createLogger(getClass()); }

slide-34
SLIDE 34

Logging the efxclipse way

Access Patterns

public class OSGiComponent2016 { private Logger logger; @Reference(cardinality=ReferenceCardinality.MANDATORY) public void setLoggerFactory(LoggerFactory f) { f.createLogger(getClass().getName()); } } public class ComponentEarly2000 { private static Logger logger = LoggerCreator.createLogger(getClass()); }

slide-35
SLIDE 35

Logging the efxclipse way

Access Patterns

public class DiComponent2016 { @Inject @Log private Logger logger; } public class OSGiComponent2016 { private Logger logger; @Reference(cardinality=ReferenceCardinality.MANDATORY) public void setLoggerFactory(LoggerFactory f) { f.createLogger(getClass().getName()); } } public class ComponentEarly2000 { private static Logger logger = LoggerCreator.createLogger(getClass()); }

slide-36
SLIDE 36

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } }

slide-37
SLIDE 37

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } }

BAD IDEA

slide-38
SLIDE 38

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); if( logger.isEnabled(Level.DEBUG) ) { logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } }

slide-39
SLIDE 39

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } private void processJPAResultList(List<Person> list) {// log4j-2.x/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); // Logger#debug(Supplier<String>): void logger.debug(() -> "Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); if( logger.isEnabled(Level.DEBUG) ) { logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } }

slide-40
SLIDE 40

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } private void processJPAResultList(List<Person> list) {// log4j-2.x/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); // Logger#debug(Supplier<String>): void logger.debug(() -> "Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); if( logger.isEnabled(Level.DEBUG) ) { logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } } private void processJPAResultList(List<Person> list) {// efxclipse for( int i = 0; i < list.size(); i++ ) { // Logger#<T>debug(T value Function<T,String>): T logger.debug(list.get(i), (p)

  • > "Processing " + p.getName() + " - " + p.getAddress().getStreet());

} }

slide-41
SLIDE 41

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } private void processJPAResultList(List<Person> list) {// log4j-2.x/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); // Logger#debug(Supplier<String>): void logger.debug(() -> "Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); if( logger.isEnabled(Level.DEBUG) ) { logger.debug("Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } } private void processJPAResultList(List<Person> list) {// efxclipse for( int i = 0; i < list.size(); i++ ) { // Logger#<T>debug(T value Function<T,String>): T logger.debug(list.get(i), (p)

  • > "Processing " + p.getName() + " - " + p.getAddress().getStreet());

} }

BAD IDEA

slide-42
SLIDE 42

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// log4j-2.x/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); logger.debug(() -> "Processing " + p.getName() + " - " + p.getAddress().getStreet()); } }

slide-43
SLIDE 43

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// log4j-2.x/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); logger.debug(() -> "Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } static class Supplier1234 implements Supplier<String> { private Person p; Supplier1234(Person p) { this.p = p; } public void String get() { return "Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } private void processJPAResultList(List<Person> list) {// log4j-2.x/efxclipse for( int i = 0; i < list.size(); i++ ) { Person p = list.get(i); logger.debug(new Supplier(p)); } }

slide-44
SLIDE 44

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// efxclipse for( int i = 0; i < list.size(); i++ ) { logger.debug(list.get(i), (p)

  • > "Processing " + p.getName() + " - " + p.getAddress().getStreet());

} }

slide-45
SLIDE 45

Logging the efxclipse way

private void processJPAResultList(List<Person> list) {// efxclipse for( int i = 0; i < list.size(); i++ ) { logger.debug(list.get(i), (p)

  • > "Processing " + p.getName() + " - " + p.getAddress().getStreet());

} } static class Function1234 implements Function<Person,String> { public void String apply(Person p) { return "Processing " + p.getName() + " - " + p.getAddress().getStreet()); } } private static Function1234 INSTANCE = new Function1234(); private void processJPAResultList(List<Person> list) {// efxclipse for( int i = 0; i < list.size(); i++ ) { logger.debug(list.get(i), INSTANCE); } list.stream() .map( p -> logger.debug(list.get(i), INSTANCE) ) .filter(…) }

slide-46
SLIDE 46

Servicelookup the efx way

slide-47
SLIDE 47

Servicelookup the efx way

e4 built-in - single value

slide-48
SLIDE 48

Servicelookup the efx way

e4 built-in - single value

public class DiComponent { @Inject GreetService greetService; }

slide-49
SLIDE 49

Servicelookup the efx way

e4 built-in - single value

public class DiComponent { @Inject GreetService greetService; }

NO e4 built-in - multi value

slide-50
SLIDE 50

Servicelookup the efx way

e4 built-in - single value

public class DiComponent { @Inject List<GreetService> greetService; } public class DiComponent { @Inject GreetService greetService; }

NO e4 built-in - multi value

slide-51
SLIDE 51

Servicelookup the efx way

e4 built-in - single value

public class DiComponent { @Inject List<GreetService> greetService; } public class DiComponent { @Inject GreetService greetService; } public class DiComponent { @Inject @Service GreetService greetService; }

NO e4 built-in - multi value

slide-52
SLIDE 52

Servicelookup the efx way

e4 built-in - single value

public class DiComponent { @Inject List<GreetService> greetService; } public class DiComponent { @Inject GreetService greetService; } public class DiComponent { @Inject @Service GreetService greetService; }

NO e4 built-in - multi value

public class DiComponent { @Inject @Service List<GreetService> greetService; }

slide-53
SLIDE 53

Servicelookup the efx way

slide-54
SLIDE 54

Servicelookup the efx way

e4 static lookup single value

slide-55
SLIDE 55

Servicelookup the efx way

e4 static lookup single value

public class Component { public void m(IEclipseContext c) { A g = c.get(A.class); } }

slide-56
SLIDE 56

Servicelookup the efx way

e4 static lookup single value

public class Component { public void m(IEclipseContext c) { A g = c.get(A.class); } }

NO e4 static lookup multi value

slide-57
SLIDE 57

Servicelookup the efx way

e4 static lookup single value

public class Component { public void m(IEclipseContext c) { A g = c.get(A.class); } }

NO e4 static lookup multi value

public class Component { public void m(IEclipseContext c) { List<A> s = c.get(/*NO EXPRESSION*/); } }

slide-58
SLIDE 58

Servicelookup the efx way

e4 static lookup single value

public class Component { public void m(IEclipseContext c) { A g = c.get(A.class); } }

NO e4 static lookup multi value

public class Component { public void m(IEclipseContext c) { List<A> s = c.get(/*NO EXPRESSION*/); } } import static o.e.f.c.ServiceUtils.*; public class Component { public void m() { Optional<A> g = getService(A.class); } }

slide-59
SLIDE 59

Servicelookup the efx way

e4 static lookup single value

public class Component { public void m(IEclipseContext c) { A g = c.get(A.class); } }

NO e4 static lookup multi value

public class Component { public void m(IEclipseContext c) { List<A> s = c.get(/*NO EXPRESSION*/); } } import static o.e.f.c.ServiceUtils.*; public class Component { public void m() { Optional<A> g = getService(A.class); } } import static o.e.f.c.ServiceUtils.*; public class Component { public void m() { List<A> g = getServiceList(A.class); } }

slide-60
SLIDE 60

Q: Dude. You showed IEclipseContext usage? Really?

slide-61
SLIDE 61

IEclipseContext

retrieving & publishing to information in e4

slide-62
SLIDE 62

IEclipseContext

retrieving & publishing to information in e4 EclipseContext@1

slide-63
SLIDE 63

IEclipseContext

retrieving & publishing to information in e4 EclipseContext@2 EclipseContext@1

slide-64
SLIDE 64

IEclipseContext

retrieving & publishing to information in e4 EclipseContext@2 EclipseContext@1

my.Person: Person@1 MWindow: MWindowImpl@1 …

slide-65
SLIDE 65

IEclipseContext

retrieving & publishing to information in e4 EclipseContext@2 EclipseContext@1

my.Person: Person@1 MWindow: MWindowImpl@1 … MPart: MPartImpl@1 …

slide-66
SLIDE 66

IEclipseContext

retrieving & publishing to information in e4

public class A { @Inject Person p; }

EclipseContext@2 EclipseContext@1

my.Person: Person@1 MWindow: MWindowImpl@1 … MPart: MPartImpl@1 …

slide-67
SLIDE 67

IEclipseContext

retrieving & publishing to information in e4

public class A { @Inject Person p; } public class B { @Inject private IEclipseContext c; public void m() { c.getParent().set(Person.class,p); } }

EclipseContext@2 EclipseContext@1

my.Person: Person@1 MWindow: MWindowImpl@1 … MPart: MPartImpl@1 …

slide-68
SLIDE 68

IEclipseContext

retrieving & publishing to information in e4

public class A { @Inject Person p; } public class B { @Inject private IEclipseContext c; public void m() { c.getParent().set(Person.class,p); } }

EclipseContext@2 EclipseContext@1

my.Person: Person@1 MWindow: MWindowImpl@1 … MPart: MPartImpl@1 …

slide-69
SLIDE 69

IEclipseContext

retrieving & publishing to information in e4

public class A { @Inject Person p; } public class B { @Inject private IEclipseContext c; public void m() { c.getParent().set(Person.class,p); } }

EclipseContext@2 EclipseContext@1

my.Person: Person@1
 MWindow: MWindowImpl@1
 … MPart: MPartImpl@1
 …

slide-70
SLIDE 70

IEclipseContext

retrieving & publishing to information in efxclipse

public class A { @Inject Person p; } public class B { @Inject @ContextValue("my.Person") private Consumer<Person> c; public void m() { c.accept(p); } }

EclipseContext@2 EclipseContext@1

my.Person: Person@1
 MWindow: MWindowImpl@1
 … MPart: MPartImpl@1
 …

slide-71
SLIDE 71

Q:So you have your JavaFX renderer is it production ready?

slide-72
SLIDE 72

Success story

  • forumSTAR (new)
  • Expected development time: 5 years
  • Number of users: > 100,000
  • Number of developers: > 100
  • Total volume: > 100 Million €

Source: http://modernisierung.site/summary/

slide-73
SLIDE 73
slide-74
SLIDE 74
slide-75
SLIDE 75

Q: Let’s talk about the future? What’s cooking?

slide-76
SLIDE 76

e4 editor story

There is NONE

slide-77
SLIDE 77

e4 editor story

slide-78
SLIDE 78

efxclipse-editor story

slide-79
SLIDE 79

efxclipse-editor story

Eclipse 4 Application Platform

slide-80
SLIDE 80

efxclipse-editor story

Eclipse 4 Application Platform Core-API

(eg resource-abstraction, auto-complete,…)

slide-81
SLIDE 81

efxclipse-editor story

Eclipse 4 Application Platform Core-API

(eg resource-abstraction, auto-complete,…)

Presentation API

slide-82
SLIDE 82

efxclipse-editor story

Eclipse 4 Application Platform Core-API

(eg resource-abstraction, auto-complete,…)

Core-EFS

(use IProject, IFile,..)

Core-NIO

(use java.nio.file.Path, …)

Presentation API

slide-83
SLIDE 83

efxclipse-editor story

Eclipse 4 Application Platform Core-API

(eg resource-abstraction, auto-complete,…)

Core-EFS

(use IProject, IFile,..)

Core-NIO

(use java.nio.file.Path, …)

Presentation API JavaFX SWT*

* does not exist

slide-84
SLIDE 84
slide-85
SLIDE 85
slide-86
SLIDE 86
slide-87
SLIDE 87

Q: Tom. Do I really need to use OSGi (and the Eclipse IDE) in future?

slide-88
SLIDE 88

NO!

slide-89
SLIDE 89

NO!

(at least not for e4 on JavaFX)

slide-90
SLIDE 90

Platform of the future

slide-91
SLIDE 91

Platform of the future

JVM

slide-92
SLIDE 92

Platform of the future

JVM OSGi

slide-93
SLIDE 93

Platform of the future

JVM efx-core Eclipse 4 App Platform OSGi

slide-94
SLIDE 94

Platform of the future

JVM efx-core Eclipse 4 App Platform OSGi efx-platform

slide-95
SLIDE 95

Platform of the future

JVM efx-core Eclipse 4 App Platform OSGi efx-platform

slide-96
SLIDE 96

Platform of the future

JVM efx-core Eclipse 4 App Platform efx-platform

slide-97
SLIDE 97
slide-98
SLIDE 98
slide-99
SLIDE 99
slide-100
SLIDE 100
slide-101
SLIDE 101

Q:So you create a fork?

slide-102
SLIDE 102

Thanks for listening