Eclipse 4 Context Functions Sopot Çela
Jun 14, 2015
Eclipse 4 Context FunctionsSopot Çela
About Me
Work for the International Criminal Investigative Training Assistance Program (ICITAP)
Independent Eclipse e4 committer
Platform/UI contributor
Tweet at @smcela
Eclipse 4 context
KEYS VALUES
EPartService PartServiceImpl
EModelService ModelServiceImpl
MyCoolService CoolServiceImpl
Eclipse 4 context hierarchy
MPart @Inject EPartService
MPart MPart
OSGi MApplication
MWindow MWindow
Making a point@Inject EPartService will get you a certain service implementation
PartServiceImpl
Making a point@Inject EPartService will get you a certain service implementation
PartServiceImpl
Making a point@Inject EPartService will get you a certain service implementation
PartServiceImpl IN A GIVEN CONTEXT
Impl = f(context, Interface)
Context Function
The guts of Eclipse
A simple context function
This is how you get your
@Inject EHandlerService
The guts of Eclipse
A simple context function
This is how you get your
@Inject EHandlerService
The curious case of EPartService @Inject
EPartService
DEMO 1
IEmergencyService with only one method dispatch() Police implementation dispatches police car Ambulance implementation dispatches ambulance Firefighters implementation dispatches firefighters
DEMO 2
IConverterService with one method convertToFahrenheit
Two implementations call one different remote web service each to do the conversion
The context function will
Distribute the calls evenly ( mini load balancer )
Pick the other if one is down ( mini fail over)
Acknowledgment
The JavaFX renderers provided by Tom Schindl from his efxclipse project.