-
1. Re: Are EJB3 Stateless Session beans as boneheaded as they l
gavin.king Mar 25, 2006 3:57 AM (in response to epstein)Have you heard of the concept of the ENC, existing since EJB 2.0?
If not, please go and learn EJB properly before ranting, TIA :-) -
2. Re: Are EJB3 Stateless Session beans as boneheaded as they l
bill.burke Mar 25, 2006 9:12 AM (in response to epstein)@Stateless(name="YourAnIdiot")
public class MyBean implement My {...}
// remote client
My my = (My)jndi.lookup("YourAnIdiot/remote");
// Refereneced
@EJB My my; -
3. Re: Are EJB3 Stateless Session beans as boneheaded as they l
bill.burke Mar 25, 2006 9:13 AM (in response to epstein)@Stateless(name="ImAnIdiotCauseICantSpell")
-
4. Re: Are EJB3 Stateless Session beans as boneheaded as they l
mazz Mar 25, 2006 9:21 PM (in response to epstein)While you deserved the thrashing that Gavin and Bill just gave you :-), I'll be a little more diplomatic.
The example you gave only relies on the classname of the bean because that's the default naming convention (if you don't name it yourself). If you can come up with a more rational, common-sensical default for your JNDI name, well... you should have spoken up during the EJB3 spec committee's public discussions.
But - if you want the decoupling you mention, you merely have to follow Bill's example - you use EJB3 annotations (or, optionally, an XML config) to define the lookup names.
"StatelessCalculator/remote" is merely the default that the container comes up with if you elect NOT to define the name yourself. If you don't like it, name it yourself via the name= annotation attribute.
You really should read alittle more deeply into a subject before attempting the arrogant route. Reading the specification would have been the first thing you should have checked and the answer would have been found there. -
5. Re: Are EJB3 Stateless Session beans as boneheaded as they l
treespace Mar 26, 2006 12:07 AM (in response to epstein)They were going to use Foo and Bar as the defaut binding names but a preliminary study exposed the strategy as sub-optimal for implementations that were neither single nor dual-bean in nature. The class name seemed like a suitable, portable, default.
Reasonable or not, I was also visibly upset by the decision and ended up decoupling it myself with a generic method -- one line of code so not too bad.
Regarding the objective-c comparison, my computations show EJB 3.0 as being 15.1% objective-C not 15% as you stated. Did you factor in the fact that Objective-C is dead? That would account for the 0.1% variance plus or minus 99.9%.
Finally, ignore Gavin and Bill. They are always showing up professing to be some sort of experts on the subject. Go figure:) -
6. Re: Are EJB3 Stateless Session beans as boneheaded as they l
bill.burke Mar 26, 2006 9:18 AM (in response to epstein)actually the EJB3 specification does not specify how JNDI names are supposed to be calculated. This is vendor specific. One way to change the JNDI name is to use @Stateless.name() attribute, but the /remote /local is still appended. If you want to totally change the jndi name, then use the @org.jboss.annotation.ejb.RemoteBinding annotation.
-
7. Re: Are EJB3 Stateless Session beans as boneheaded as they l
treespace Mar 26, 2006 10:28 AM (in response to epstein)Thanks for clarifying I was under the impression the recent JNDI name pattern was a standard default. The EAR file name prefix does have a bit of an odor to it but that will evaporate when the web tier gets @EJB injection. Having a default name is a good thing. I can parameterize the pattern in my own getEJB method for different platforms. Meanwhile I don't have to name every bean with a naked string.
-
8. Re: Are EJB3 Stateless Session beans as boneheaded as they l
mazz Mar 26, 2006 12:48 PM (in response to epstein)Yes, sorry for adding to the confusion. I meant the specification would have shown you the @Stateless(name="foo") annotation as the way to override the container's default, not necessarily what the default is.
-
9. Re: Are EJB3 Stateless Session beans as boneheaded as they l
epstein Mar 27, 2006 2:48 PM (in response to epstein)I was annoyed by a bad example, not bad technology
Examples contributed back are of course welcome :-)