Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Eclipse4/API/DI

< Eclipse4‎ | API
Revision as of 16:40, 7 February 2013 by Emoffatt.ca.ibm.com (Talk | contribs) (New page: Dependency Injection ("DI") and the IEclipseContext DI (aka 'Inversion of Concerns") is a recent development in development. It's based on teh premise that it's better for a component to ...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Dependency Injection ("DI") and the IEclipseContext

DI (aka 'Inversion of Concerns") is a recent development in development. It's based on teh premise that it's better for a component to describe what it needs and having those requirements met through the use of an appropriate 'context' Rather than requiring the component to rely on external frameworks through which it can satisfy its own requirements.

In order for the component to expose its needs it uses a set of java annotations, some generic (@Inject, @PostConstruct...) as well as domain (e4) specific (@Focus, @CanExecute...).

In order to be useful there are a number of things that must be possible:

  • Create a new instance of a class gicen the class spec and a context
  • Inject an existing instance with the values in a context
  • Find and execute specifically annotated methods within an existing instance

Copyright © Eclipse Foundation, Inc. All Rights Reserved.