 |
EJB 3.0 Spec is available for Early Draft Review
Posted by lancea on July 27, 2004 at 12:37 AM | Comments (12)
The plans for the next release of J2EE 5.0 (formally 1.5) are in full swing. One of the key initiatives is to reduce the complexity for the developers and focus on Ease of Development (EoD).
EJB has always been an area where we have had requests to try and simplify things for the developer. I believe the early draft of the EJB 3.0 is off to a great start in accomplishing this requirement.
One area that has been greatly simplified, is the amount of code that is required to create an EJB. For example, consider the following EJB 2.1 Stateless Session Bean. You would need to code the following (plus create a Deployment Descriptor):
public interface Calculator extends EJBObject {
int add (int a, int b) throws RemoteException;
int subtract (int a, int b) throws RemoteException;
}
public interface CalculatorHome extends EJBHome {
Calculator create() throws CreateException, RemoteException;
}
public class CalculatorBean implements SessionBean {
private SessionContext ctx;
public void setSessionContext(SessionContext ctx) {
this.ctx = ctx;
}
public void ejbCreate () {}
public void ejbActivate () {}
public void ejbPassivate () {}
public void ejbRemove() {}
public int add (int a, int b) {
return a + b;
}
public int subtract ( int a, int b) {
return a - b;
}
}
With EJB 3.0, the above code could be written as:
@Stateless @Remote public class CalculatorBean {
public int add (int a, int b) {
return a + b;
}
public int subtract (int a, int b) {
return a - b;
}
}
That is it! You do not even have to create a Deployment Descriptor.
The Expert Group has been working very hard to address the needs of the EJB community. Please take the time to review the EJB 3.0 Early Draft and give us your feedback.
Bookmark blog post: del.icio.us Digg DZone Furl Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment
-
Good effort, but incorporate JDO 2
The EJB 3.0 draft specification is a good effort in the right direction. It will certainly simplify the task of creating EJBs.
I think that the biggest mistake in the spec is in developing yet-another-persistence mechanism rather then embracing (and improving) JDO. JDO should be the "P" in CMP... Why confuse the message needlessly.
Posted by: johnreynolds on July 27, 2004 at 01:03 AM
-
Nice simplification, but use JDO
This is a repetitive comment, but it is worth repeating.
The simpler session beans are great, but not using JDO for the entity bean replacement is bad.
I don't want two different transparent persistence solutions. I want a standard (so that it can be implemented by multiple vendors) that I can use inside or outside an EJB container. That's what JDO provides *now*, and EJB 3.0 has to provide the same for it to be attractive to me.
Tom
Posted by: tomdavies on July 27, 2004 at 08:13 AM
-
NDA-like license is unfortunate for discussion
Would it be possible to publish JSR drafts under a license that does not prohibit discussing the JSRs with people who have not accepted the license?
The current licensing conditions [1] put people commenting on EJB 3.0 in a public forum, like this one, in the awkward position that they are technically breaking the license agreement as soon as someone who hasn't accepted the license agreement joins the discussion. [2] I doubt that's a desired side effect.
cheers,
dalibor topic
[1] "This license includes the right to discuss the
Specification (including the right to provide limited
excerpts of text to the extent relevant to the point[s]
under discussion) with other licensees (under this or a
substantially similar version of this Agreement) of the
Specification. Other than this limited license, you acquire
no right, title or interest in or to the Specification or
any other Sun intellectual property, and the Specification
may only be used in accordance with the license terms set
forth herein."
[2] Like right now, as I have not accepted the license agreement.
Posted by: robilad on July 27, 2004 at 10:13 PM
-
NDA-like license is unfortunate for discussion
You can always send email to jsr-220-comments@jcp.org whether or not you've accepted the license agreement.
Posted by: johnreynolds on July 27, 2004 at 11:59 PM
-
Comment on EJB or any other Java Technology
If I have to use XML one more time I will vomit.
If I wanted to write XML I would have left my brain at the door.
From what I hear this Hibernate crude is a layer that forces you to write your DB scheme in XML. I write logic, not DB's normalized to the 5th level. Heck I don't even understand what that means, other than work I don't want to do. And I'm sure the DBA's are going to have a thing or 2 to say about allowing me to take their jobs away and be replaced by XML.
Just talking about XML is making my stomach start to turn....I bett...er sto...p talkin...g about XMLLLLLLLLLLLLLLLLLLLLLL.
;)
Posted by: sfitzjava on July 28, 2004 at 12:44 AM
-
Comment on EJB or any other Java Technology
I am not sure what you are refering to in the spec. Could you please be more specific.
Posted by: lancea on July 28, 2004 at 01:02 AM
-
NDA-like license is unfortunate for discussion
Yes, for comments on the Early Draft as it is written, please submit to the email alias that John lists above.
Note that alias should only be used for constructive feedback on the contents of the early draft.
Posted by: lancea on July 28, 2004 at 01:05 AM
-
use jdo
I join in the chorus.
Please delegate persistence to JDO 2.
We java developer don't want two largely overlapping persistence solutions (as far as persistence is involved, I know ejb is much more...)
Posted by: ygmarchi on July 28, 2004 at 02:02 AM
-
Comment on EJB or any other Java Technology
The hibernate doesn't force you at all to write you DB schema in XML. Just have a look and you will see that it is a great solution.
Posted by: stupala on July 28, 2004 at 09:42 PM
-
NDA-like license is unfortunate for discussion
Thanks!
Posted by: robilad on July 28, 2004 at 09:47 PM
-
Nice simplification, but use JDO
I should make it clear that my desire to see JDO 2.0 in EJB 3.0 is in no way a 'Hibernate vs. JDO' issue.
I would be very happy to see JDO 2 allow Hibernate to become JDO compliant. I believe that changes to JDO 1 to allow this were proposed, I don't know if they happened.
This would be good for Hibernate, as it could become the leading Open Source JDO implementation overnight.
Tom
Posted by: tomdavies on July 29, 2004 at 10:12 AM
-
Interesting post and comments. Thanks.
-----------------------------------------------------------------------------
BlazingTools Boss Invisible
Posted by: frida1 on August 27, 2007 at 11:36 PM
|