13
Eclipse 4 Context Functions Sopot Çela

Eclipse 4 Context Functions

Embed Size (px)

DESCRIPTION

The talk about context functions I gave at the EclipseCon Europe 2012 in Ludwigsburg.

Citation preview

Page 1: Eclipse 4 Context Functions

Eclipse 4 Context FunctionsSopot Çela

Page 2: Eclipse 4 Context Functions

About Me

Work for the International Criminal Investigative Training Assistance Program (ICITAP)

Independent Eclipse e4 committer

Platform/UI contributor

Tweet at @smcela

Page 3: Eclipse 4 Context Functions

Eclipse 4 context

KEYS VALUES

EPartService PartServiceImpl

EModelService ModelServiceImpl

MyCoolService CoolServiceImpl

Page 4: Eclipse 4 Context Functions

Eclipse 4 context hierarchy

MPart @Inject EPartService

MPart MPart

OSGi MApplication

MWindow MWindow

Page 5: Eclipse 4 Context Functions

Making a point@Inject EPartService will get you a certain service implementation

PartServiceImpl

Page 6: Eclipse 4 Context Functions

Making a point@Inject EPartService will get you a certain service implementation

PartServiceImpl

Page 7: Eclipse 4 Context Functions

Making a point@Inject EPartService will get you a certain service implementation

PartServiceImpl IN A GIVEN CONTEXT

Impl = f(context, Interface)

Context Function

Page 8: Eclipse 4 Context Functions

The guts of Eclipse

A simple context function

This is how you get your

@Inject EHandlerService

Page 9: Eclipse 4 Context Functions

The guts of Eclipse

A simple context function

This is how you get your

@Inject EHandlerService

Page 10: Eclipse 4 Context Functions

The curious case of EPartService @Inject

EPartService

Page 11: Eclipse 4 Context Functions

DEMO 1

IEmergencyService with only one method dispatch() Police implementation dispatches police car Ambulance implementation dispatches ambulance Firefighters implementation dispatches firefighters

Page 12: Eclipse 4 Context Functions

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)

Page 13: Eclipse 4 Context Functions

Acknowledgment

The JavaFX renderers provided by Tom Schindl from his efxclipse project.