Eclipse e4 EclipseCon tutorial – Slides are online
by Lars Vogel / March 30th, 2010
On behalf of Tom Schindl and Kai Toedter I uploaded the Eclipse e4 tutorial slides.
Eclipse e4 Tutorial – EclipseCon 2010
Filed under: Eclipse
View more presentations from LarsVogel.
March 30th, 2010 at 4:36 pm
In the slides I saw this piece of code:
@Inject
private void setSelection(@Optional @Named(IServiceConstants.SELECTION) Contact contact) {
//…
}
Is there a particular reason why you use @Named and constants defined in an interface instead of creating qualifier annotations?
@Selection would be shorter than @Named(IServiceConstants.SELECTION). And to quote Josh Bloch: “The constant interface pattern is a poor use of interfaces.”
March 30th, 2010 at 5:24 pm
@Max ESelectionService is available for direct injection. I think the approach has been chosen to allow to use service contacts without always having to create a separate annotation. I also believe this is not closed so if you would like to see certain qualifier annotations please suggest this on the e4 mailing list.