Re: T5: best practice for a multiple module app

2008-02-05 Thread Anton Gavazuk
Hi,
I don't see any "complexity of EJBs (in EJB 2)" in case if you are
using just JMS/Session beans - Entity beans are really awful

2008/2/5, Renat Zubairov <[EMAIL PROTECTED]>:
> Hi Angelo,
>
> I was just thinking how can you organize your application in case you would
> use the EJBs:
>
> You will most probably use the Session Facade design pattern (
> http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html)
> to provide the backend for your web apps that will be shared part across all
> of them. For that you need to create one or many session beans. It's natural
> that you will not be very happy about complexity of EJBs (in EJB 2) and/or
> about immature dependency injection (in EJB 3) therefore you would most
> probably use them only as facade and call some other dependency injection
> solution behind them. Most probable candidate is Spring, however I'm pretty
> sure you can adjust T5 IOC to be usefull on the backend side as well.
>
> Since EJB structure is very similar to the typical DI requirements (required
> interfaces) you can easily create a service provider of some kind that will
> automagically lookup the EJBs in the JNDI and inject them into your
> pages/services wherever they are needed.
>
> I would also suggest you to keep the user dependent state on the web tier
> and use when possible stateless components on the backend.
>
> All in all it seems that resulting structure might become complicated very
> fast :( and also there is a big question wherever T5 IOC is really suitable
> for the backend/EJB like operation (for example perthread lifecycle only
> works when servlet filter is there). Also you need to take into account
> Java5/JEE5 support is not very mature and you would have only limited choise
> of containers in this case.
>
> Renat
>
>
> On 04/02/2008, Angelo Chen <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi Renat,
> >
> > I think your recommendation of j2ee and ear deployment is a better option,
> > i
> > think again, there is really no need to make the multiple module looks
> > like
> > one, we can have multiple web applications, now this T5 IOC  inside EJB
> > part
> > without EJB is interesting, what's the advantage of this approach compared
> > to using ejb? another thing is, T5 does not have direct support of ejb3
> > annotation.
> >
> > Thanks,
> > Angelo
> >
> >
> > Renat Zubairov wrote:
> > >
> > > Hi Angelo,
> > >
> > > Basically if you have a number of web application, Tap or not Tap :)
> > there
> > > are number of problems you need to solve if you want them to look as one
> > > application for the user:
> > >
> > > 1. Authentication - in case you would use propreitary authentication
> > > schemes
> > > that are based on the HTTP sessions you might have some problems because
> > > session would be different for different web applications therefore you
> > > might need to integrate with the container managed authentication.
> > >
> > > 2. Persistence - as you mentioned in your first email "all modules
> > should
> > > share the same persistence store" since two different web application
> > > can't
> > > have common classes loaded at the same time (due to the fact that in
> > > Servlet
> > > container all WebApps are having it's own private classloader) you might
> > > use
> > > the same persistence module (a JAR file in the WEB-INF/lib) but in this
> > > case
> > > each  web application would work with it's own Session (hibernate
> > or  JDBC
> > > session).
> > >
> > > 3. Linking - since each web application will be deployed under different
> > > context (http://your-domain.com/context1 and http://your-domain/context2
> > )
> > > you would need to consider how many links would you need between these
> > two
> > > and how to manage them efficiently (imagine context name changed?).
> > >
> > > Basically my recommendation would be - do it inside single web app :)
> > you
> > > will really have less problems!
> > >
> > > In case it's not possible I would suggest to leverage all J2EE parts of
> > > the
> > > container, such as JAAS and container managed authentication for
> > > simplifying
> > > multi-app authentication, JNDI and connection pooling for providing
> > single
> > > DB connection pool for multiple applications.
> > > In case you are planning to deploy to a J2EE container you can benefit
> > > from
> > > J2EE deployment if you would put common parts of your application inside
> > > EJB
> > > JAR and all your WAR's inside one single EAR, in this case you can
> > benefit
> > > from the hierarchical classloading. In the end you can off course use T5
> > > IOC
> > > instead of spring inside your EJB part without really doing any EJBs at
> > > all.
> > > IMHO it should be possible to automatically deploy all T5 services
> > inside
> > > the JNDI and then look them up in the Web Applications.
> > >
> > > Renat
> > >
> > >
> > > On 04/02/2008, Angelo Chen <[EMAIL PROTECTED]> wrote:
> > >>
> > >>
> > >> Hi Renat,
> > >>
> > >> EJB is not a must, any sugge

Re: T5: best practice for a multiple module app

2008-02-05 Thread Renat Zubairov
Hi Angelo,

I was just thinking how can you organize your application in case you would
use the EJBs:

You will most probably use the Session Facade design pattern (
http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html)
to provide the backend for your web apps that will be shared part across all
of them. For that you need to create one or many session beans. It's natural
that you will not be very happy about complexity of EJBs (in EJB 2) and/or
about immature dependency injection (in EJB 3) therefore you would most
probably use them only as facade and call some other dependency injection
solution behind them. Most probable candidate is Spring, however I'm pretty
sure you can adjust T5 IOC to be usefull on the backend side as well.

Since EJB structure is very similar to the typical DI requirements (required
interfaces) you can easily create a service provider of some kind that will
automagically lookup the EJBs in the JNDI and inject them into your
pages/services wherever they are needed.

I would also suggest you to keep the user dependent state on the web tier
and use when possible stateless components on the backend.

All in all it seems that resulting structure might become complicated very
fast :( and also there is a big question wherever T5 IOC is really suitable
for the backend/EJB like operation (for example perthread lifecycle only
works when servlet filter is there). Also you need to take into account
Java5/JEE5 support is not very mature and you would have only limited choise
of containers in this case.

Renat


On 04/02/2008, Angelo Chen <[EMAIL PROTECTED]> wrote:
>
>
> Hi Renat,
>
> I think your recommendation of j2ee and ear deployment is a better option,
> i
> think again, there is really no need to make the multiple module looks
> like
> one, we can have multiple web applications, now this T5 IOC  inside EJB
> part
> without EJB is interesting, what's the advantage of this approach compared
> to using ejb? another thing is, T5 does not have direct support of ejb3
> annotation.
>
> Thanks,
> Angelo
>
>
> Renat Zubairov wrote:
> >
> > Hi Angelo,
> >
> > Basically if you have a number of web application, Tap or not Tap :)
> there
> > are number of problems you need to solve if you want them to look as one
> > application for the user:
> >
> > 1. Authentication - in case you would use propreitary authentication
> > schemes
> > that are based on the HTTP sessions you might have some problems because
> > session would be different for different web applications therefore you
> > might need to integrate with the container managed authentication.
> >
> > 2. Persistence - as you mentioned in your first email "all modules
> should
> > share the same persistence store" since two different web application
> > can't
> > have common classes loaded at the same time (due to the fact that in
> > Servlet
> > container all WebApps are having it's own private classloader) you might
> > use
> > the same persistence module (a JAR file in the WEB-INF/lib) but in this
> > case
> > each  web application would work with it's own Session (hibernate
> or  JDBC
> > session).
> >
> > 3. Linking - since each web application will be deployed under different
> > context (http://your-domain.com/context1 and http://your-domain/context2
> )
> > you would need to consider how many links would you need between these
> two
> > and how to manage them efficiently (imagine context name changed?).
> >
> > Basically my recommendation would be - do it inside single web app :)
> you
> > will really have less problems!
> >
> > In case it's not possible I would suggest to leverage all J2EE parts of
> > the
> > container, such as JAAS and container managed authentication for
> > simplifying
> > multi-app authentication, JNDI and connection pooling for providing
> single
> > DB connection pool for multiple applications.
> > In case you are planning to deploy to a J2EE container you can benefit
> > from
> > J2EE deployment if you would put common parts of your application inside
> > EJB
> > JAR and all your WAR's inside one single EAR, in this case you can
> benefit
> > from the hierarchical classloading. In the end you can off course use T5
> > IOC
> > instead of spring inside your EJB part without really doing any EJBs at
> > all.
> > IMHO it should be possible to automatically deploy all T5 services
> inside
> > the JNDI and then look them up in the Web Applications.
> >
> > Renat
> >
> >
> > On 04/02/2008, Angelo Chen <[EMAIL PROTECTED]> wrote:
> >>
> >>
> >> Hi Renat,
> >>
> >> EJB is not a must, any suggestions for this kind of app as long as
> front
> >> end
> >> is Tapestry 5.
> >>
> >>
> >> Renat Zubairov wrote:
> >> >
> >> > Hello Angelo,
> >> >
> >> > Main question is do you want to use EJB in your app or not, because
> >> > usually
> >> > there is no proper way to share state between multiple WAR's deployed
> >> > inside
> >> > the application container.
> >> >
> >> > Renat
> >> >
> >> >
> >> >
> >>
> >> -

Re: T5: best practice for a multiple module app

2008-02-04 Thread Anton Gavazuk
It makes Hibernate working as Jboss MBean service,
this service is responsible for working with Hibernate sessions.
This way leaves you only with JBoss, without any alternative.

2008/2/4, Jonathan Barker <[EMAIL PROTECTED]>:
> Angelo,
>
> Take a look at JBoss .har files.  I've never tried it but it might be a way
> to share a common Hibernate setup among multiple webapps.
>
> Jonathan
>
> > -Original Message-
> > From: Angelo Chen [mailto:[EMAIL PROTECTED]
> > Sent: Sunday, February 03, 2008 8:28 PM
> > To: users@tapestry.apache.org
> > Subject: T5: best practice for a multiple module app
> >
> >
> > Hi,
> > A mini ERP project which will contains ar, ap, gl, inventory and some
> > others, if every module is a single Tapestry 5 application, then we have 4
> > modules, all modules should share the same persistence store, UI is
> > independent from each other, however there are some linkage as well,
> > example, in the ap module user might be able to select an invoice from
> > inventory, what is the best practice to structure this kind of app? pure
> > Tapestry app? or ejb/seam based with T5 as the web tier?  thanks.
> > --
> > View this message in context: http://www.nabble.com/T5%3A-best-practice-
> > for-a-multiple-module-app-tp15260841p15260841.html
> > Sent from the Tapestry - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: T5: best practice for a multiple module app

2008-02-04 Thread Jonathan Barker
Angelo,

Take a look at JBoss .har files.  I've never tried it but it might be a way
to share a common Hibernate setup among multiple webapps.

Jonathan

> -Original Message-
> From: Angelo Chen [mailto:[EMAIL PROTECTED]
> Sent: Sunday, February 03, 2008 8:28 PM
> To: users@tapestry.apache.org
> Subject: T5: best practice for a multiple module app
> 
> 
> Hi,
> A mini ERP project which will contains ar, ap, gl, inventory and some
> others, if every module is a single Tapestry 5 application, then we have 4
> modules, all modules should share the same persistence store, UI is
> independent from each other, however there are some linkage as well,
> example, in the ap module user might be able to select an invoice from
> inventory, what is the best practice to structure this kind of app? pure
> Tapestry app? or ejb/seam based with T5 as the web tier?  thanks.
> --
> View this message in context: http://www.nabble.com/T5%3A-best-practice-
> for-a-multiple-module-app-tp15260841p15260841.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: best practice for a multiple module app

2008-02-04 Thread Angelo Chen

Hi Renat,

I think your recommendation of j2ee and ear deployment is a better option, i
think again, there is really no need to make the multiple module looks like
one, we can have multiple web applications, now this T5 IOC  inside EJB part
without EJB is interesting, what's the advantage of this approach compared
to using ejb? another thing is, T5 does not have direct support of ejb3
annotation.

Thanks,
Angelo


Renat Zubairov wrote:
> 
> Hi Angelo,
> 
> Basically if you have a number of web application, Tap or not Tap :) there
> are number of problems you need to solve if you want them to look as one
> application for the user:
> 
> 1. Authentication - in case you would use propreitary authentication
> schemes
> that are based on the HTTP sessions you might have some problems because
> session would be different for different web applications therefore you
> might need to integrate with the container managed authentication.
> 
> 2. Persistence - as you mentioned in your first email "all modules should
> share the same persistence store" since two different web application
> can't
> have common classes loaded at the same time (due to the fact that in
> Servlet
> container all WebApps are having it's own private classloader) you might
> use
> the same persistence module (a JAR file in the WEB-INF/lib) but in this
> case
> each  web application would work with it's own Session (hibernate or  JDBC
> session).
> 
> 3. Linking - since each web application will be deployed under different
> context (http://your-domain.com/context1 and http://your-domain/context2)
> you would need to consider how many links would you need between these two
> and how to manage them efficiently (imagine context name changed?).
> 
> Basically my recommendation would be - do it inside single web app :) you
> will really have less problems!
> 
> In case it's not possible I would suggest to leverage all J2EE parts of
> the
> container, such as JAAS and container managed authentication for
> simplifying
> multi-app authentication, JNDI and connection pooling for providing single
> DB connection pool for multiple applications.
> In case you are planning to deploy to a J2EE container you can benefit
> from
> J2EE deployment if you would put common parts of your application inside
> EJB
> JAR and all your WAR's inside one single EAR, in this case you can benefit
> from the hierarchical classloading. In the end you can off course use T5
> IOC
> instead of spring inside your EJB part without really doing any EJBs at
> all.
> IMHO it should be possible to automatically deploy all T5 services inside
> the JNDI and then look them up in the Web Applications.
> 
> Renat
> 
> 
> On 04/02/2008, Angelo Chen <[EMAIL PROTECTED]> wrote:
>>
>>
>> Hi Renat,
>>
>> EJB is not a must, any suggestions for this kind of app as long as front
>> end
>> is Tapestry 5.
>>
>>
>> Renat Zubairov wrote:
>> >
>> > Hello Angelo,
>> >
>> > Main question is do you want to use EJB in your app or not, because
>> > usually
>> > there is no proper way to share state between multiple WAR's deployed
>> > inside
>> > the application container.
>> >
>> > Renat
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/T5%3A-best-practice-for-a-multiple-module-app-tp15260841p15263775.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 
> -- 
> Best regards,
> Renat Zubairov
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-best-practice-for-a-multiple-module-app-tp15260841p15268374.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: best practice for a multiple module app

2008-02-04 Thread Renat Zubairov
Hi Angelo,

Basically if you have a number of web application, Tap or not Tap :) there
are number of problems you need to solve if you want them to look as one
application for the user:

1. Authentication - in case you would use propreitary authentication schemes
that are based on the HTTP sessions you might have some problems because
session would be different for different web applications therefore you
might need to integrate with the container managed authentication.

2. Persistence - as you mentioned in your first email "all modules should
share the same persistence store" since two different web application can't
have common classes loaded at the same time (due to the fact that in Servlet
container all WebApps are having it's own private classloader) you might use
the same persistence module (a JAR file in the WEB-INF/lib) but in this case
each  web application would work with it's own Session (hibernate or  JDBC
session).

3. Linking - since each web application will be deployed under different
context (http://your-domain.com/context1 and http://your-domain/context2)
you would need to consider how many links would you need between these two
and how to manage them efficiently (imagine context name changed?).

Basically my recommendation would be - do it inside single web app :) you
will really have less problems!

In case it's not possible I would suggest to leverage all J2EE parts of the
container, such as JAAS and container managed authentication for simplifying
multi-app authentication, JNDI and connection pooling for providing single
DB connection pool for multiple applications.
In case you are planning to deploy to a J2EE container you can benefit from
J2EE deployment if you would put common parts of your application inside EJB
JAR and all your WAR's inside one single EAR, in this case you can benefit
from the hierarchical classloading. In the end you can off course use T5 IOC
instead of spring inside your EJB part without really doing any EJBs at all.
IMHO it should be possible to automatically deploy all T5 services inside
the JNDI and then look them up in the Web Applications.

Renat


On 04/02/2008, Angelo Chen <[EMAIL PROTECTED]> wrote:
>
>
> Hi Renat,
>
> EJB is not a must, any suggestions for this kind of app as long as front
> end
> is Tapestry 5.
>
>
> Renat Zubairov wrote:
> >
> > Hello Angelo,
> >
> > Main question is do you want to use EJB in your app or not, because
> > usually
> > there is no proper way to share state between multiple WAR's deployed
> > inside
> > the application container.
> >
> > Renat
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/T5%3A-best-practice-for-a-multiple-module-app-tp15260841p15263775.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Best regards,
Renat Zubairov


Re: T5: best practice for a multiple module app

2008-02-04 Thread Davor Hrg
Using one persistence layer (I'll talk about Hibernate, but it most
likely applies to any other)
for more than one web-app is a bit tricky.

Simpler part is creating subclasses of TapestryFilter
 one that loads hibernate and shares it via ServletContext
 one that loads Tapestry without hibernate and uses one from ServletContext

The tougher part is that any shared libraries must be in a higher ClassLoader
or you'll end up with bunch of classloader issues.
So you have to put hibernate and it's dependancies into shared lib of your
web container, and your persisted entities as well.
remove those libs from the webapps and run the whole thing.



I've made it work once for T4 because I was very annoyed with
restarting webapp and waiting
for ages (about 15 seconds actualy). So this way I could restart only
the web part and have some speedup.
Idid ti with tomcat because I could restart a webapp inside tomcat
with an ant script,
now I use jetty launcher and it can bi done with JMX (I havent tried it yet)

If I get annoyed enough with hibernate startup again I'll do it for T5,
If you make it work pelase put it on the wiki :)

Davor Hrg

On Feb 4, 2008 9:28 AM, Angelo Chen <[EMAIL PROTECTED]> wrote:
>
> Hi Renat,
>
> EJB is not a must, any suggestions for this kind of app as long as front end
> is Tapestry 5.
>
>
> Renat Zubairov wrote:
> >
> > Hello Angelo,
> >
> > Main question is do you want to use EJB in your app or not, because
> > usually
> > there is no proper way to share state between multiple WAR's deployed
> > inside
> > the application container.
> >
> > Renat
> >
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/T5%3A-best-practice-for-a-multiple-module-app-tp15260841p15263775.html
>
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: best practice for a multiple module app

2008-02-04 Thread Angelo Chen

Hi Renat,

EJB is not a must, any suggestions for this kind of app as long as front end
is Tapestry 5. 


Renat Zubairov wrote:
> 
> Hello Angelo,
> 
> Main question is do you want to use EJB in your app or not, because
> usually
> there is no proper way to share state between multiple WAR's deployed
> inside
> the application container.
> 
> Renat
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-best-practice-for-a-multiple-module-app-tp15260841p15263775.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: T5: best practice for a multiple module app

2008-02-03 Thread Renat Zubairov
Hello Angelo,

Main question is do you want to use EJB in your app or not, because usually
there is no proper way to share state between multiple WAR's deployed inside
the application container.

Renat

On 04/02/2008, Angelo Chen <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
> A mini ERP project which will contains ar, ap, gl, inventory and some
> others, if every module is a single Tapestry 5 application, then we have 4
> modules, all modules should share the same persistence store, UI is
> independent from each other, however there are some linkage as well,
> example, in the ap module user might be able to select an invoice from
> inventory, what is the best practice to structure this kind of app? pure
> Tapestry app? or ejb/seam based with T5 as the web tier?  thanks.
> --
> View this message in context:
> http://www.nabble.com/T5%3A-best-practice-for-a-multiple-module-app-tp15260841p15260841.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Best regards,
Renat Zubairov