Apparently people seems to be preferring wrapping all injectable resources into @Inject.
This allows the use of static annotations instead of strings
@Inject @MyPU EntityManager em; instead of @PersistentContext(
And the use of more advanced features and lifecycle management - IIRC the @Transaction extension will require the use @Inject in place of @PersistenceContext
Right, but where is the @Produces field that defines @MyPU declared? That's my question.
That's more of a philosophical question like
should brackets be on their own line?;-)
Personally, I would have them all in some ResourceProducer or so...
Thanks; I've heard answers all over the map which means my question is answered: the community has NOT settled on a way to do this, so at this point any solution is not going to look odd to new developers on my project.
Personally I prefer the single-class solution as well; I've heard plenty of others who say that you should do one XYZProducer class per XYZ.