Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[e4-dev] @Components in Eclipse 4


I had recently a discussion with a Spring consultants. Based on this discussion I think we should extend the dependency functionality.

We could introduce a annotation like @Component. If another component request such a marked component the DI container could try to create an instance of this case based on the Application Context.

For example

public classTodo {

@Inject ITodoModelService service


whereby ITodoModelService would be an OSGi service. 

If another component, e.g. requires a Todo via @Inject then the DI container could check if its available in the local context hierarchy and once reached its end, it should check if the class is marked as component and create the class (if possible via the ApplicationContext).

This would be in my opinion a very, very useful extension of the current DI container.

Please share your opinion.

Best regards, Lars

Lars - Eclipse, Android and Java Tutorials - Lars on Twitter

Back to the top