Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Service-Factory with EJB  RSS feed

 
Thomas Hamtho
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I wonder how I would implement a Service-Factory using EJB using an property as criteria to determine which implementation should be used.

In old-fashioned this looked like this:



But using this implementation does not give me the chance to use the dependency-injection in my subclasses (such as ServiceA or ServiceB). So there has to be another way.
A saw, that there is this Producer-Annotation. Would this be the way to go?

Would anyone point me to the right direction?

Thanks
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
May be this link will help.

And welcome to the Ranch
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!