Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[e4-dev] upcoming changes to IEclipseContext


I am working on cleaning up the context injection story. The first set of changes include:

- new method IEclipseContext#make(Class) to create a class using constructor, field, and method injection

- support for injection of data into methods with multiple arguments:
        @Inject
         void myMethod(@Named("time") String time, @Named("date") String date)

- the mapping of context key to the injected parameter or field has changed. We no longer attempt to convert case of the first character and usually don't use method names to find the object to inject. The preferred method to establish "what is expected to be injected" will be the use of "@Named" qualifier.

- changes of prefixes for Java 1.4 support: from "di_Field" and "setMethod" to "inject_Field" and "inject_Method". (The "set" prefix was way too common and "di_" was not very informative.)


There will be more changes, for instance, I'd like to reduce the number of post-construct and pre-destory methods we support.  If you are working with contexts, consider subscribing to https://bugs.eclipse.org/bugs/show_bug.cgi?id=294109 for up-to-date information.

(Once we are more-or-less finished with the cleanup and support for JSR 330 I plan to write a whitepaper describing the use of contexts and injection.)

Sincerely,
Oleg Besedin

Back to the top