You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Christopher Blythe <cj...@gmail.com> on 2007/03/08 15:48:23 UTC

Daytrader EJB3 development

All...

Thanks to the efforts of David Jencks, Daytrader 2.0 (trunk) already
contains a JPA-based implementation of the Trade services wrapped in an EJB
2.1 stateless session bean. As additional EJB3 and EE5 features are
delivered in Geronimo (and other appservers), Daytrader should follow suit
by exploiting the entire EJB3 and EE5 programming model. This would
primarily involve conversion of the stateless session beans and MDBs to
EJB3. I have already begun some of this work using another development
platform that already supports EE5.

For the time being, I think a direct port of the code from J2EE 1.4 to EE5
standards is essential, without changing any of the fundamental business
logic. From a performance standpoint, this would provide the best measure of
how well an EE5 application stacks up against it's 1.4 counterpart.

In this EE5 version I foresee 3 modes of operation...

- Direct (JDBC)
- Session Direct (EJB3 Session to JDBC)
- Full EJB (EJB3 Session to EJB3 Entities)

Nevertheless, I was wondering if an additional JPA mode would be of
interest? Based on my understanding of the relationship between JPA and
EJB3, the separating factor between the two is the scope of the
EntityManager (either application-based or container-based). Consequently,
would some form of JPA mode (using an application-based EntityManager)
provide a useful comparison?

Looking a little farther down the road, here are a few other things I see on
the horizon...

- Java6 and JDBC 4.0 (How will this impact direct mode?)
- At some point, some wholesale changes to the business objects and model
should be made to place more demand on the application server and not the
database. These changes should also reflect the latest trends in Web
2.0application development practices. The AJAX/Dojo-based interface
that was
recently added is a start; however, I feel that more effort is needed here.

I guess that's all for now... Let's see where this leads us... Questions,
thoughts, comments or snide remarks?

Chris



-- 
"I say never be complete, I say stop being perfect, I say let... lets
evolve, let the chips fall where they may." - Tyler Durden

Re: Daytrader EJB3 development

Posted by Christopher Blythe <cj...@gmail.com>.
All...

In order to work on EJB3 changes to Daytrader without disrupting trunk, I
have created branches/ejb3 as a sandbox. I also committed a host of EJB3
based primitives... The project compiles, but I have no idea how they'll
respond in G at the moment.

Links to the primitives can be accessed at...

http://localhost:8080/daytrader/ejb3_prims.html

The primitives include various combinations of stateful and stateless
session beans, entities with various load properties (eager, lazy, etc.) and
and MDB sample.

In order to swizzle these in, I created two new packages under the ejb
module...

org.apache.geronimo.samples.daytrader.ejb3
org.apache.geronimo.samples.daytrader.ejb3.prims

and one new package to the web module.

org.apache.geronimo.samples.daytrader.web.prims.ejb3

Eventually, i think we will need to do some refactoring of the packages,
etc. before everything is finalized.


On 3/8/07, David Jencks <da...@yahoo.com> wrote:
>
>
> On Mar 8, 2007, at 9:48 AM, Christopher Blythe wrote:
>
> > All...
> >
> > Thanks to the efforts of David Jencks, Daytrader 2.0 (trunk)
> > already contains a JPA-based implementation of the Trade services
> > wrapped in an EJB 2.1 stateless session bean. As additional EJB3
> > and EE5 features are delivered in Geronimo (and other appservers),
> > Daytrader should follow suit by exploiting the entire EJB3 and EE5
> > programming model. This would primarily involve conversion of the
> > stateless session beans and MDBs to EJB3. I have already begun some
> > of this work using another development platform that already
> > supports EE5.
> >
> > For the time being, I think a direct port of the code from J2EE 1.4
> > to EE5 standards is essential, without changing any of the
> > fundamental business logic. From a performance standpoint, this
> > would provide the best measure of how well an EE5 application
> > stacks up against it's 1.4 counterpart.
> >
> > In this EE5 version I foresee 3 modes of operation...
> >
> > - Direct (JDBC)
> > - Session Direct (EJB3 Session to JDBC)
> > - Full EJB (EJB3 Session to EJB3 Entities)
> >
> > Nevertheless, I was wondering if an additional JPA mode would be of
> > interest? Based on my understanding of the relationship between JPA
> > and EJB3, the separating factor between the two is the scope of the
> > EntityManager (either application-based or container-based).
> > Consequently, would some form of JPA mode (using an application-
> > based EntityManager) provide a useful comparison?
>
> I can think of 3 more JPA modes:
>
> 1. App managed JPA from ejb3
> 2. container managed JPA from web (using UserTransaction for
> transaction demarcation)
> 3. App managed JPA from web.
>
> I'd be mostly interested in (2) but that doesn't mean it's most
> important or interesting for anyone else.
>
> thanks for working on this!
>
> david jencks
>
> >
> > Looking a little farther down the road, here are a few other things
> > I see on the horizon...
> >
> > - Java6 and JDBC 4.0 (How will this impact direct mode?)
> > - At some point, some wholesale changes to the business objects and
> > model should be made to place more demand on the application server
> > and not the database. These changes should also reflect the latest
> > trends in Web 2.0 application development practices. The AJAX/Dojo-
> > based interface that was recently added is a start; however, I feel
> > that more effort is needed here.
> >
> > I guess that's all for now... Let's see where this leads us...
> > Questions, thoughts, comments or snide remarks?
> >
> > Chris
> >
> >
> >
> > --
> > "I say never be complete, I say stop being perfect, I say let...
> > lets evolve, let the chips fall where they may." - Tyler Durden
>
>


-- 
"I say never be complete, I say stop being perfect, I say let... lets
evolve, let the chips fall where they may." - Tyler Durden

Re: Daytrader EJB3 development

Posted by David Jencks <da...@yahoo.com>.
On Mar 8, 2007, at 9:48 AM, Christopher Blythe wrote:

> All...
>
> Thanks to the efforts of David Jencks, Daytrader 2.0 (trunk)  
> already contains a JPA-based implementation of the Trade services  
> wrapped in an EJB 2.1 stateless session bean. As additional EJB3  
> and EE5 features are delivered in Geronimo (and other appservers),  
> Daytrader should follow suit by exploiting the entire EJB3 and EE5  
> programming model. This would primarily involve conversion of the  
> stateless session beans and MDBs to EJB3. I have already begun some  
> of this work using another development platform that already  
> supports EE5.
>
> For the time being, I think a direct port of the code from J2EE 1.4  
> to EE5 standards is essential, without changing any of the  
> fundamental business logic. From a performance standpoint, this  
> would provide the best measure of how well an EE5 application  
> stacks up against it's 1.4 counterpart.
>
> In this EE5 version I foresee 3 modes of operation...
>
> - Direct (JDBC)
> - Session Direct (EJB3 Session to JDBC)
> - Full EJB (EJB3 Session to EJB3 Entities)
>
> Nevertheless, I was wondering if an additional JPA mode would be of  
> interest? Based on my understanding of the relationship between JPA  
> and EJB3, the separating factor between the two is the scope of the  
> EntityManager (either application-based or container-based).  
> Consequently, would some form of JPA mode (using an application- 
> based EntityManager) provide a useful comparison?

I can think of 3 more JPA modes:

1. App managed JPA from ejb3
2. container managed JPA from web (using UserTransaction for  
transaction demarcation)
3. App managed JPA from web.

I'd be mostly interested in (2) but that doesn't mean it's most  
important or interesting for anyone else.

thanks for working on this!

david jencks

>
> Looking a little farther down the road, here are a few other things  
> I see on the horizon...
>
> - Java6 and JDBC 4.0 (How will this impact direct mode?)
> - At some point, some wholesale changes to the business objects and  
> model should be made to place more demand on the application server  
> and not the database. These changes should also reflect the latest  
> trends in Web 2.0 application development practices. The AJAX/Dojo- 
> based interface that was recently added is a start; however, I feel  
> that more effort is needed here.
>
> I guess that's all for now... Let's see where this leads us...  
> Questions, thoughts, comments or snide remarks?
>
> Chris
>
>
>
> -- 
> "I say never be complete, I say stop being perfect, I say let...  
> lets evolve, let the chips fall where they may." - Tyler Durden