What’s next for e4 · Ideal OSGi App world A-API-Bundle (requires NOTHING) A Impl-Bundle...

102
What’s next for e4 Tom Schindl <[email protected]> Twitter: @tomsontom Website: http://www.bestsolution.at

Transcript of What’s next for e4 · Ideal OSGi App world A-API-Bundle (requires NOTHING) A Impl-Bundle...

Page 1: What’s next for e4 · 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

What’s next for e4

Tom Schindl <[email protected]> Twitter: @tomsontom

Website: http://www.bestsolution.at

Page 2: What’s next for e4 · 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

(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

Page 3: What’s next for e4 · 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

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

Page 4: What’s next for e4 · 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

The compat layer

Page 5: What’s next for e4 · 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

The combat layer

Page 6: What’s next for e4 · 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

e4 spec’ed world

Application ModelThe Brain

(OSGi) Service Components &

DI-ContainerNervous system

UI (SWT/FX/…)Sense organ

Page 7: What’s next for e4 · 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

combat world

Application ModelThe (split) Brain

Nervous system

UI (SWT/FX/…)

Sense organ

$n - Registries

Legacy

Compat-Layer

DI & Service

Page 8: What’s next for e4 · 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

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

Page 9: What’s next for e4 · 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

How OSGi spec’ed the world

Service-API (requires NOTHING)

Service-Impl 1 (requires Equinox, …)

Service-Impl $N (requires Felix, …)

Consumer (requires Service-API)

Page 10: What’s next for e4 · 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

How e4 core implemented it

Service-API (requires Equinox)

Service-Impl 1

Consumer (requires Service-API & transitive Equinox)

Page 11: What’s next for e4 · 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

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

Page 12: What’s next for e4 · 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

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.0Bundle-ManifestVersion: 2Bundle-SymbolicName: org.eclipse.e4.core.di…Import-Package: javax.annotation,javax.inject;version="1.0.0",org.eclipse.osgi.framework.log;version="1.1.0",org.eclipse.osgi.service.debug;version="1.2.0",org.osgi.framework;version="1.8.0",org.osgi.util.tracker;version="1.5.1"

Page 13: What’s next for e4 · 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

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.0Bundle-ManifestVersion: 2Bundle-SymbolicName: org.eclipse.e4.core.di…Import-Package: javax.annotation,javax.inject;version="1.0.0",org.eclipse.osgi.framework.log;version="1.1.0",org.eclipse.osgi.service.debug;version="1.2.0",org.osgi.framework;version="1.8.0",org.osgi.util.tracker;version="1.5.1"

ONLY NEEDED BY IMPL

Page 14: What’s next for e4 · 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

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

Page 15: What’s next for e4 · 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

Ideal OSGi App world

Page 16: What’s next for e4 · 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

Ideal OSGi App world

A-API-Bundle (requires NOTHING)

Page 17: What’s next for e4 · 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

Ideal OSGi App world

A-API-Bundle (requires NOTHING)

A Impl-Bundle (requires NOTHING)

Page 18: What’s next for e4 · 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

Ideal OSGi App world

A-API-Bundle (requires NOTHING)

A Impl-Bundle (requires NOTHING)

B Impl-Bundle (requires Comp A-API-Bundle)

Page 19: What’s next for e4 · 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

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 {

}

Page 20: What’s next for e4 · 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

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 {

}

@Componentpublic class ImplA implements A {}

Page 21: What’s next for e4 · 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

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 {

}

@Componentpublic class ImplA implements A {}

@Componentpublic class ImplB {

@Reference(cardinality=ReferenceCardinality.MANDATORY)

public void setCompA(A a) {}public void unsetCompA(A a) {}

}

Page 22: What’s next for e4 · 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

e4 OSGi usage

A Impl-Bundle (requires NOTHING)

B Impl-Bundle (requires Comp A-API-Bundle)

A-API-Bundle (requires NOTHING)

Page 23: What’s next for e4 · 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

e4 OSGi usage

A Impl-Bundle (requires NOTHING)

B Impl-Bundle (requires Comp A-API-Bundle)

A-API-Bundle (requires NOTHING)

public interface A {

}

@Componentpublic class ImplA implements A {}

Page 24: What’s next for e4 · 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

e4 OSGi usage

A Impl-Bundle (requires NOTHING)

B Impl-Bundle (requires Comp A-API-Bundle)

A-API-Bundle (requires NOTHING)

public interface A {

}

@Componentpublic class ImplA implements A {}

public class ImplB {@Injectpublic void setCompA(A a) {}

}

Page 25: What’s next for e4 · 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

e4 OSGi usage

IEclipseContext serviceContext = …

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

Page 26: What’s next for e4 · 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

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);

Page 27: What’s next for e4 · 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

Q: What API does e4 use from OSGi?

Page 28: What’s next for e4 · 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

e4 OSGi API useage

Page 29: What’s next for e4 · 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

e4 OSGi API useage

Pattern 1 - Debug/Logimport 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);

Page 30: What’s next for e4 · 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

e4 OSGi API useage

Pattern 1 - Debug/Logimport 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-ServiceBundleContext bundleContext = FrameworkUtil.getBundle(BlaBla.class).getBundleContext();ServiceReference<ComponentA> serviceReference = bundleContext.getServiceReference(GreetService.class);if( serviceReference != null ) { bundleContext.getService(serviceReference).greet("Hello Tom");}

Page 31: What’s next for e4 · 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

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

Page 32: What’s next for e4 · 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

Logging the efxclipse wayAccess Patterns

Page 33: What’s next for e4 · 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

Logging the efxclipse wayAccess Patternspublic class ComponentEarly2000 {private static Logger logger = LoggerCreator.createLogger(getClass());

}

Page 34: What’s next for e4 · 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

Logging the efxclipse wayAccess 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());

}

Page 35: What’s next for e4 · 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

Logging the efxclipse wayAccess Patterns

public class DiComponent2016 {@Inject@Logprivate 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());

}

Page 36: What’s next for e4 · 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

Logging the efxclipse wayprivate 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());

} }

Page 37: What’s next for e4 · 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

Logging the efxclipse wayprivate 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

Page 38: What’s next for e4 · 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

Logging the efxclipse wayprivate 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/efxclipsefor( 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());}

}}

Page 39: What’s next for e4 · 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

Logging the efxclipse wayprivate 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/efxclipsefor( int i = 0; i < list.size(); i++ ) {

Person p = list.get(i);// Logger#debug(Supplier<String>): voidlogger.debug(() -> "Processing " + p.getName() + " - " + p.getAddress().getStreet());

}}

private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipsefor( 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());}

}}

Page 40: What’s next for e4 · 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

Logging the efxclipse wayprivate 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/efxclipsefor( int i = 0; i < list.size(); i++ ) {

Person p = list.get(i);// Logger#debug(Supplier<String>): voidlogger.debug(() -> "Processing " + p.getName() + " - " + p.getAddress().getStreet());

}}

private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipsefor( 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) {// efxclipsefor( int i = 0; i < list.size(); i++ ) {

// Logger#<T>debug(T value Function<T,String>): Tlogger.debug(list.get(i), (p)

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

}

Page 41: What’s next for e4 · 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

Logging the efxclipse wayprivate 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/efxclipsefor( int i = 0; i < list.size(); i++ ) {

Person p = list.get(i);// Logger#debug(Supplier<String>): voidlogger.debug(() -> "Processing " + p.getName() + " - " + p.getAddress().getStreet());

}}

private void processJPAResultList(List<Person> list) {// slf4j/log4j/efxclipsefor( 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) {// efxclipsefor( int i = 0; i < list.size(); i++ ) {

// Logger#<T>debug(T value Function<T,String>): Tlogger.debug(list.get(i), (p)

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

}

BAD IDEA

Page 42: What’s next for e4 · 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

Logging the efxclipse wayprivate 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()); } }

Page 43: What’s next for e4 · 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

Logging the efxclipse wayprivate 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/efxclipsefor( int i = 0; i < list.size(); i++ ) {

Person p = list.get(i);logger.debug(new Supplier(p));

}}

Page 44: What’s next for e4 · 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

Logging the efxclipse wayprivate 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()); } }

Page 45: What’s next for e4 · 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

Logging the efxclipse wayprivate 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) {// efxclipsefor( int i = 0; i < list.size(); i++ ) {

logger.debug(list.get(i), INSTANCE);}

list.stream().map( p -> logger.debug(list.get(i), INSTANCE) ).filter(…)

}

Page 46: What’s next for e4 · 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

Servicelookup the efx way

Page 47: What’s next for e4 · 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

Servicelookup the efx waye4 built-in - single value

Page 48: What’s next for e4 · 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

Servicelookup the efx waye4 built-in - single valuepublic class DiComponent {

@Inject

GreetService greetService;}

Page 49: What’s next for e4 · 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

Servicelookup the efx waye4 built-in - single valuepublic class DiComponent {

@Inject

GreetService greetService;}

NO e4 built-in - multi value

Page 50: What’s next for e4 · 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

Servicelookup the efx waye4 built-in - single value

public class DiComponent {@Inject

List<GreetService> greetService;}

public class DiComponent {@Inject

GreetService greetService;}

NO e4 built-in - multi value

Page 51: What’s next for e4 · 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

Servicelookup the efx waye4 built-in - single value

public class DiComponent {@Inject

List<GreetService> greetService;}

public class DiComponent {@Inject

GreetService greetService;}

public class DiComponent {@Inject@ServiceGreetService greetService;

}

NO e4 built-in - multi value

Page 52: What’s next for e4 · 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

Servicelookup the efx waye4 built-in - single value

public class DiComponent {@Inject

List<GreetService> greetService;}

public class DiComponent {@Inject

GreetService greetService;}

public class DiComponent {@Inject@ServiceGreetService greetService;

}

NO e4 built-in - multi valuepublic class DiComponent {

@Inject@ServiceList<GreetService> greetService;

}

Page 53: What’s next for e4 · 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

Servicelookup the efx way

Page 54: What’s next for e4 · 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

Servicelookup the efx waye4 static lookup single value

Page 55: What’s next for e4 · 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

Servicelookup the efx waye4 static lookup single value

public class Component {public void m(IEclipseContext c) {

A g = c.get(A.class);}

}

Page 56: What’s next for e4 · 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

Servicelookup the efx waye4 static lookup single value

public class Component {public void m(IEclipseContext c) {

A g = c.get(A.class);}

}

NO e4 static lookup multi value

Page 57: What’s next for e4 · 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

Servicelookup the efx waye4 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*/);

}}

Page 58: What’s next for e4 · 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

Servicelookup the efx waye4 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);}

}

Page 59: What’s next for e4 · 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

Servicelookup the efx waye4 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);

}}

Page 60: What’s next for e4 · 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

Q: Dude. You showed IEclipseContext usage?

Really?

Page 61: What’s next for e4 · 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

IEclipseContextretrieving & publishing to information in e4

Page 62: What’s next for e4 · 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

IEclipseContextretrieving & publishing to information in e4EclipseContext@1

Page 63: What’s next for e4 · 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

IEclipseContextretrieving & publishing to information in e4

EclipseContext@2

EclipseContext@1

Page 64: What’s next for e4 · 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

IEclipseContextretrieving & publishing to information in e4

EclipseContext@2

[email protected]: Person@1MWindow: MWindowImpl@1…

Page 65: What’s next for e4 · 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

IEclipseContextretrieving & publishing to information in e4

EclipseContext@2

[email protected]: Person@1MWindow: MWindowImpl@1…

MPart: MPartImpl@1…

Page 66: What’s next for e4 · 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

IEclipseContextretrieving & publishing to information in e4

public class A {@InjectPerson p;

}

EclipseContext@2

[email protected]: Person@1MWindow: MWindowImpl@1…

MPart: MPartImpl@1…

Page 67: What’s next for e4 · 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

IEclipseContextretrieving & publishing to information in e4

public class A {@InjectPerson p;

}

public class B {@Injectprivate IEclipseContext c;

public void m() {c.getParent().set(Person.class,p);

}}

EclipseContext@2

[email protected]: Person@1MWindow: MWindowImpl@1…

MPart: MPartImpl@1…

Page 68: What’s next for e4 · 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

IEclipseContextretrieving & publishing to information in e4

public class A {@InjectPerson p;

}

public class B {@Injectprivate IEclipseContext c;

public void m() {c.getParent().set(Person.class,p);

}}

EclipseContext@2

[email protected]: Person@1MWindow: MWindowImpl@1…

MPart: MPartImpl@1…

Page 69: What’s next for e4 · 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

IEclipseContextretrieving & 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

[email protected]: Person@1 MWindow: MWindowImpl@1…

MPart: MPartImpl@1…

Page 70: What’s next for e4 · 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

IEclipseContextretrieving & 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

[email protected]: Person@1 MWindow: MWindowImpl@1…

MPart: MPartImpl@1…

Page 71: What’s next for e4 · 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

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

Page 72: What’s next for e4 · 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

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/

Page 73: What’s next for e4 · 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
Page 74: What’s next for e4 · 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
Page 75: What’s next for e4 · 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

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

Page 76: What’s next for e4 · 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

e4 editor story

There is NONE

Page 77: What’s next for e4 · 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

e4 editor story

Page 78: What’s next for e4 · 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

efxclipse-editor story

Page 79: What’s next for e4 · 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

efxclipse-editor story

Eclipse 4 Application Platform

Page 80: What’s next for e4 · 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

efxclipse-editor story

Eclipse 4 Application Platform

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

Page 81: What’s next for e4 · 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

efxclipse-editor story

Eclipse 4 Application Platform

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

Presentation API

Page 82: What’s next for e4 · 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

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

Page 83: What’s next for e4 · 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

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

Page 84: What’s next for e4 · 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
Page 85: What’s next for e4 · 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
Page 86: What’s next for e4 · 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
Page 87: What’s next for e4 · 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

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

future?

Page 88: What’s next for e4 · 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

NO!

Page 89: What’s next for e4 · 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

NO!(at least not for e4 on JavaFX)

Page 90: What’s next for e4 · 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

Platform of the future

Page 91: What’s next for e4 · 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

Platform of the future

JVM

Page 92: What’s next for e4 · 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

Platform of the future

JVM

OSGi

Page 93: What’s next for e4 · 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

Platform of the future

JVM

efx-coreEclipse 4 App Platform

OSGi

Page 94: What’s next for e4 · 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

Platform of the future

JVM

efx-coreEclipse 4 App Platform

OSGi

efx-platform

Page 95: What’s next for e4 · 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

Platform of the future

JVM

efx-coreEclipse 4 App Platform

OSGi

efx-platform

Page 96: What’s next for e4 · 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

Platform of the future

JVM

efx-coreEclipse 4

App Platform

efx-platform

Page 97: What’s next for e4 · 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
Page 98: What’s next for e4 · 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
Page 99: What’s next for e4 · 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
Page 100: What’s next for e4 · 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
Page 101: What’s next for e4 · 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

Q:So you create a fork?

Page 102: What’s next for e4 · 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

Thanks for listening