Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EJB 2.0 VS EJB 3.0

In EJB 2.0 we have Home interface, and Component interface. But in EJB 3.0 we don't have those interfaces(instead we have annotations). My doubt is, if we don't have those interface, then who is doing their job in EJB 3.0, and how the implementation and working (calling and callee) procedure changed??

like image 520
Nageswaran Avatar asked Aug 03 '26 23:08

Nageswaran


1 Answers

In EJB 3 you don't need the home interface anymore, as the container is directly injecting the bean when you use the @EJB annotation

@EJB
MyLocalInterface bean1;

@EJB
OtherRemoteInterface bean2;

String foo = bean1.doSomething();
String bar = bean2.soSomethingElse();
like image 72
Heiko Rupp Avatar answered Aug 06 '26 13:08

Heiko Rupp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!