Discussions

EJB design: EJB3 + @Remote

  1. EJB3 + @Remote (1 messages)

    Just wondering, is anyone still using J2EE style remote interfaces with EJB3? I ask as lots of tutorials and documentation use this style and I can't think of a single reason to do so other than migration). E.g. why use interface BusinessService { // Stuff } @Remote interface BusinessServiceRemote extends BusinessService { } @Stateless class BusinessServicebean implements BusinessServiceRemote { } instead of just interface BusinessService { // Stuff } @Stateless @Remote(BusinessService.class) class BusinessServicebean implements BusinessService { }

    Threaded Messages (1)

  2. clarity[ Go to top ]

    Good question... maybe just for clarity of injection at the bean client side. When you use @EJB private BusinessServiceRemote service; it's clear - you want to access remote bean (hence the interface is annotated with @Remote)