-
1. Re: EJBs as Switchyard Service
kcbabo Feb 7, 2013 8:15 AM (in response to traviskds)We implement a CDI extension which allows any bean with @Service to be registered as a service. We also allow invocation of services from a bean using @Inject @Reference. This should play nicely with EJBs. Here's an example of a CDI-based service that uses injection:
https://github.com/jboss-switchyard/quickstarts/tree/master/bean-service
-
2. Re: EJBs as Switchyard Service
traviskds Feb 7, 2013 4:02 PM (in response to kcbabo)Yes I did see that example. But I am trying to get my head around why I need my bean to be stateless EJB's when I can do everything by keeping it as plain POJO's with a SwitchYard @Service annotation. Anyone can suggest what advanages I get by mixing EJB's and Switchyard services?
Is it all that container managed stuff like JTA transastion management etc that EJB provide which in the case of Switchyard you have to do it explcitly?
-
3. Re: EJBs as Switchyard Service
kcbabo Feb 8, 2013 8:33 AM (in response to traviskds)1 of 1 people found this helpfulThis is just my opinion, but I think the line has blurred quite a bit between POJOs and EJBs in Java EE 6, particularly with the introduction of CDI. I'm not saying this as a bad thing, I think it's merely a reflection of how much easier it's become to implement and deploy EJBs and how powerful CDI is in EE 6. I would say that if you are starting a brand new application in SwitchYard, then look at using just CDI and see if it meets your needs. If you are in a heterogeneous environment where you are using EJBs a lot and that's a better fit for your team, then go with that.
-
4. Re: EJBs as Switchyard Service
traviskds Feb 8, 2013 9:03 AM (in response to kcbabo)Thanks Keith for your thoughts. Yes I agree. JEE6 is great but you get this EJB3/CDI confusion all the time. As you said we got to decide what is best and the reason that I think EJB3 is useful is because of some application container managed features that CDI might not have. But point taken. If we don't need those features, then we might as well just stick to CDI.
-
5. Re: EJBs as Switchyard Service
dward Feb 8, 2013 10:41 AM (in response to traviskds)Agreed on all points, however think about what container-mananged features you might want. Tranactions? We have that too. Security? Yup.