Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » DI Question
DI Question [message #572701] Fri, 02 April 2010 09:11
Max Bureck is currently offline Max Bureck
Messages: 72
Registered: July 2009
Member
Hello,

I was browsing through the EclipseCon e4 slides and found this piece of
code:

@Inject
private void setSelection(@Optional @Named(IServiceConstants.SELECTION)
Contact contact) {
//…
}

Why do you use @Named with string constants defined in an interface
instead of using qualifier annotations? @Selection would be much shorter
than @Named(IServiceConstants.SELECTION). And in addition to that: It's
bad style to use interfaces for the sole purpose to hold constants (see
Joshua Bloch, Effective Java, Item 19: Use interfaces only to define types).

Best regards,
Max
Previous Topic:XWT. May be not accurate handling of element properties
Next Topic:e4 app based on Contact demo has problem with IEclipseContext
Goto Forum:
  


Current Time: Mon Jul 28 08:31:12 EDT 2014

Powered by FUDForum. Page generated in 0.13604 seconds