You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Vjeran Marcinko <vj...@tis.hr> on 2004/04/22 06:21:50 UTC

Visit as business layer

One more question - How good is Visit and Tapestry alone for implementing
such business layer actions ? For instance, in TIA book, Howard has written
than Visit should be used not only for storing session data but also for
actions, thus keeping listener methods inside components and pages small,
everything because of unit testing.

But if I mean to use Visit as business layer, I need some other facilities
such as a way to grab application wide settings. For example, if I use Visit
to call web service, I need a way to grab application config parameter
called "web-service-url" since it is supose to be given as application
config property (where should these kind of properties be specified
anyway?!).

I know that Tapestry is primarily for presentation layer, so should I
integrate it with Spring/Hivemind/Pico containers then, because of their
sofisticated component/service configuration features ?

Regards,
Vjeran

----- Original Message ----- 
From: "Erik Hatcher" <er...@ehatchersolutions.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Wednesday, April 21, 2004 9:50 PM
Subject: Re: Visit serializable


> Visit should be Serializable - anything put into session scope should
> be.  Shame on Howard if Hangman Visit is not :)
>
> Yes, I would make the web service stub be transient and lazy
> initialized when needed.  I do this with a Lucene index connection from
> Global, in fact.
>
> Erik
>
>
> On Apr 21, 2004, at 3:27 PM, Vjeran Marcinko wrote:
>
> > Hi.
> >
> > Does visit class has to implement Serializable always, or just when
> > used in
> > cluster ? I bought TIA book, and am looking at Hangman example, and
> > when I
> > run it, it throws 'visit class not serializable' exception, but it
> > keeps
> > running OK after that ?!
> >
> > And one more question - I want to put action logic in visit class, but
> > third-party classes used (concretely Axis client stub) for these
> > actions are
> > not serializable. What should I do ?
> > Should I avoid using them as Visit's instance variables, and to
> > instantiate
> > them inside action method body during each request ? Or should I use
> > them as
> > instance variable marked as transient ?
> >
> > Regards,
> > Vjeran
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Visit as business layer

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
You can override BaseEngine.createVisit() and initialize it however you 
like.

Also, have a look at Tapestry's "property" facilities using 
IPropertySource for slick ways to define and retrieve configuration 
information without having to use those containers to do it.  HiveMind 
is on its way in soon though.

	Erik


On Apr 22, 2004, at 12:21 AM, Vjeran Marcinko wrote:

> One more question - How good is Visit and Tapestry alone for 
> implementing
> such business layer actions ? For instance, in TIA book, Howard has 
> written
> than Visit should be used not only for storing session data but also 
> for
> actions, thus keeping listener methods inside components and pages 
> small,
> everything because of unit testing.
>
> But if I mean to use Visit as business layer, I need some other 
> facilities
> such as a way to grab application wide settings. For example, if I use 
> Visit
> to call web service, I need a way to grab application config parameter
> called "web-service-url" since it is supose to be given as application
> config property (where should these kind of properties be specified
> anyway?!).
>
> I know that Tapestry is primarily for presentation layer, so should I
> integrate it with Spring/Hivemind/Pico containers then, because of 
> their
> sofisticated component/service configuration features ?
>
> Regards,
> Vjeran
>
> ----- Original Message -----
> From: "Erik Hatcher" <er...@ehatchersolutions.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Wednesday, April 21, 2004 9:50 PM
> Subject: Re: Visit serializable
>
>
>> Visit should be Serializable - anything put into session scope should
>> be.  Shame on Howard if Hangman Visit is not :)
>>
>> Yes, I would make the web service stub be transient and lazy
>> initialized when needed.  I do this with a Lucene index connection 
>> from
>> Global, in fact.
>>
>> Erik
>>
>>
>> On Apr 21, 2004, at 3:27 PM, Vjeran Marcinko wrote:
>>
>>> Hi.
>>>
>>> Does visit class has to implement Serializable always, or just when
>>> used in
>>> cluster ? I bought TIA book, and am looking at Hangman example, and
>>> when I
>>> run it, it throws 'visit class not serializable' exception, but it
>>> keeps
>>> running OK after that ?!
>>>
>>> And one more question - I want to put action logic in visit class, 
>>> but
>>> third-party classes used (concretely Axis client stub) for these
>>> actions are
>>> not serializable. What should I do ?
>>> Should I avoid using them as Visit's instance variables, and to
>>> instantiate
>>> them inside action method body during each request ? Or should I use
>>> them as
>>> instance variable marked as transient ?
>>>
>>> Regards,
>>> Vjeran
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: 
>>> tapestry-user-help@jakarta.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Visit as business layer

Posted by Jonny Wray <jo...@yahoo.com>.
Well, the concept of business logic varies from specific app to
specific app but I generally wouldn't equate it with the controller in
an MVC - that is for controlling user input and event handling. In
fact, the services should be reusable by any (possibly non-MVC) view. 

I tend to think of/implement services as roughly equivalent to one use
case, or one whole action that needs to be completed as a whole (and so
wrapped in a database transaction maybe).

My listeners tend to be very simple. Get parameters, call service
method (possibly methods) with parameters, set result object(s) in
result page, forward to result page. 

I find this model very similar to the Action model of Swing, where an
Action class with a listener gets mapped to a user input. In my swing
applications these Actions then call a service method with parameters,
and then notify their observers that data has changed.
 
Now, I wasn't sure what you meant by "a workflow process dealing with
multiple entity types". If you mean a page flow controller that
controls the flow from page to page, then yes this needs to be handled
in the view code. I would call that view buisness logic I guess.

I'd recommend Fowlers "Patterns of Enterprise Application Architecture"
as a good book explains the different layers, and when to use what. The
"Core J2EE Patterns" book is another good one. Also, a lot about the
trade offs between different architectures can be learnt by reading the
forums for the Spring and Hibernate projects.

Jonny

--- Bryan Lewis <br...@maine.rr.com> wrote:
> Thanks for a thought-provoking post.
> 
> When you say "service layer", is that the same concept as "controller
> layer" in MVC?  Sounds similar... the place where complex business
> logic
> resides (such as a workflow process dealing with multiple entity
> types).
> I guess I need to read up on things like Spring and HiveMind.  Or
> attend
> a seminar on them at the No Fluff conference this weekend (woo-hoo).
> 
> If they aren't the same thing, where are people putting such logic in
> their Tapestry apps?  (Assuming most will agree that complex biz
> logic
> shouldn't go in the view code.)
> 
> .
> 
> 
> ----- Original Message ----- 
> From: "Jonny Wray" <jo...@yahoo.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Thursday, April 22, 2004 1:12 AM
> Subject: Re: Visit as business layer
> 
> 
> >
> > I typically use Spring now to define my service/buisness layer,
> with
> the aim
> > of having as little actual logic in the listeners as possible.
> >
> > I actually use global as a place where I can access the spring
> application
> > context, as the service objects are application wide constant, not
> specific
> > to a particular user.
> >
> > I find this provides a very clean separation of concerns between
> the
> view
> > and service layers. The view layers knowing nothing about the
> specifics of
> > where the data is coming from (eg database, web service, complex
> logic, all
> > three) as they are hidden behind interfaces.
> >
> > In addition to the usually cited functionality of spring (which is
> very
> > good) another big advantage I'm finding here is that I can test my
> service
> > layers outside of the web/j2ee container with plain java code, or
> junit
> > tests, thus avoiding the redeploying slowness sometimes associated
> with
> > container based development.
> >
> > Jonny
> >
> > On 4/21/04 9:21 PM, "Vjeran Marcinko" <vj...@tis.hr> wrote:
> >
> > > One more question - How good is Visit and Tapestry alone for
> implementing
> > > such business layer actions ? For instance, in TIA book, Howard
> has
> written
> > > than Visit should be used not only for storing session data but
> also
> for
> > > actions, thus keeping listener methods inside components and
> pages
> small,
> > > everything because of unit testing.
> > >
> > > But if I mean to use Visit as business layer, I need some other
> facilities
> > > such as a way to grab application wide settings. For example, if
> I
> use Visit
> > > to call web service, I need a way to grab application config
> parameter
> > > called "web-service-url" since it is supose to be given as
> application
> > > config property (where should these kind of properties be
> specified
> > > anyway?!).
> > >
> > > I know that Tapestry is primarily for presentation layer, so
> should
> I
> > > integrate it with Spring/Hivemind/Pico containers then, because
> of
> their
> > > sofisticated component/service configuration features ?
> > >
> > > Regards,
> > > Vjeran
> > >
> > > ----- Original Message -----
> > > From: "Erik Hatcher" <er...@ehatchersolutions.com>
> > > To: "Tapestry users" <ta...@jakarta.apache.org>
> > > Sent: Wednesday, April 21, 2004 9:50 PM
> > > Subject: Re: Visit serializable
> > >
> > >
> > >> Visit should be Serializable - anything put into session scope
> should
> > >> be.  Shame on Howard if Hangman Visit is not :)
> > >>
> > >> Yes, I would make the web service stub be transient and lazy
> > >> initialized when needed.  I do this with a Lucene index
> connection
> from
> > >> Global, in fact.
> > >>
> > >> Erik
> > >>
> > >>
> > >> On Apr 21, 2004, at 3:27 PM, Vjeran Marcinko wrote:
> > >>
> > >>> Hi.
> > >>>
> > >>> Does visit class has to implement Serializable always, or just
> when
> > >>> used in
> > >>> cluster ? I bought TIA book, and am looking at Hangman example,
> and
> > >>> when I
> > >>> run it, it throws 'visit class not serializable' exception, but
> it
> > >>> keeps
> > >>> running OK after that ?!
> > >>>
> > >>> And one more question - I want to put action logic in visit
> class,
> but
> > >>> third-party classes used (concretely Axis client stub) for
> these
> > >>> actions are
> > >>> not serializable. What should I do ?
> > >>> Should I avoid using them as Visit's instance variables, and to
> > >>> instantiate
> > >>> them inside action method body during each request ? Or should
> I
> use
> > >>> them as
> > >>> instance variable marked as transient ?
> > >>>
> > >>> Regards,
> > >>> Vjeran
> > >>>
> > >>>
> >
> >>>
> --------------------------------------------------------------------
> -
> > >>> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > >>> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> > >>
> > >>
> >
> >>
> ---------------------------------------------------------------------
> > >> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > >> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Page specific stylesheets

Posted by Jonny Wray <jo...@yahoo.com>.
Yeah, that wouldn't work as I'm using Shell and a Body definition. This
means I only have one file with headers, navigation bar, footers, etc etc in
And my actual page only contain the content specific to that page. Very
nice, just how it should be really ;)

I guess overriding the stylesheet parameter of the containing shell is the
way to do it, as per the previous poster.


On 4/22/04 7:03 PM, "RWinter@boystown.com.au" <RW...@boystown.com.au>
wrote:

> 
> 
> 
> 
> 
> Instead of providing a style sheet for each page you could just override
> the global css definitions with page specific style definitions in the
> <head> of the html.
> ie
> <head>
> <style type="text/css">
>   your pagespecific style defs
> </style>
> </head>
> 
> 
> I'm still new to tapestry so I'm not sure how this is best accomplished. ie
> By using a component like Shell, or just plain old html in the template
> 
> 
> Roland
> 
> Harish Krishnaswamy <hk...@comcast.net> wrote on 23/04/2004
> 11:10:45:
> 
>> Yes you can, you simply have to pass it on to the Shell component from
>> the page
>> http://jakarta.apache.org/tapestry/doc/ComponentReference/Shell.html
>> 
>> -Harish
>> 
>> 
>> Jonny Wray wrote:
>> 
>>> Hi,
>>> 
>>> I'm wondering if there's anyway to specify stylesheets specific to a
>>> particular page.
>>> 
>>> I'm moving more and more of my markup over to using css for
>>> positioning, and it really helps in making the components standalone.
>>> But, positioning on a page level is really specific to a page, rather
>>> than a global style sheet. So, if possible, I'd like to reflect that by
>>> having a css per page specifying any css positioning needed.
>>> 
>>> Jonny
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>> 
>>> 
>>> 
>>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>> 
> 
> 
> ##############################################################################
> #######
> This e-mail message has been scanned for viruses by our email server and
> cleared.
> ##############################################################################
> #######
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Page specific stylesheets

Posted by RW...@boystown.com.au.




Instead of providing a style sheet for each page you could just override
the global css definitions with page specific style definitions in the
<head> of the html.
ie
<head>
  <style type="text/css">
    your pagespecific style defs
  </style>
</head>


I'm still new to tapestry so I'm not sure how this is best accomplished. ie
By using a component like Shell, or just plain old html in the template


Roland

Harish Krishnaswamy <hk...@comcast.net> wrote on 23/04/2004
11:10:45:

> Yes you can, you simply have to pass it on to the Shell component from
> the page
> http://jakarta.apache.org/tapestry/doc/ComponentReference/Shell.html
>
> -Harish
>
>
> Jonny Wray wrote:
>
> >Hi,
> >
> >I'm wondering if there's anyway to specify stylesheets specific to a
> >particular page.
> >
> >I'm moving more and more of my markup over to using css for
> >positioning, and it really helps in making the components standalone.
> >But, positioning on a page level is really specific to a page, rather
> >than a global style sheet. So, if possible, I'd like to reflect that by
> >having a css per page specifying any css positioning needed.
> >
> >Jonny
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


#####################################################################################
This e-mail message has been scanned for viruses by our email server and cleared.
#####################################################################################

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Page specific stylesheets

Posted by Harish Krishnaswamy <hk...@comcast.net>.
Yes you can, you simply have to pass it on to the Shell component from 
the page 
http://jakarta.apache.org/tapestry/doc/ComponentReference/Shell.html

-Harish


Jonny Wray wrote:

>Hi,
>
>I'm wondering if there's anyway to specify stylesheets specific to a
>particular page.
>
>I'm moving more and more of my markup over to using css for
>positioning, and it really helps in making the components standalone.
>But, positioning on a page level is really specific to a page, rather
>than a global style sheet. So, if possible, I'd like to reflect that by
>having a css per page specifying any css positioning needed.
>
>Jonny
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Page specific stylesheets

Posted by Jonny Wray <jo...@yahoo.com>.
Filip,

Thanks a lot, just what I was looking for. Obvious once it's been pointed
out, but saved me a lot of experimenting.

Jonny

On 4/23/04 12:51 AM, "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk> wrote:

> Well, my solution might be a little complicated, or so I think, but i t
> works for me. In my Border.jwc I have this:
> 
> <component id="shell" type="Shell">
>   ...
>   <binding name="stylesheets">
>     new org.apache.tapestry.IAsset[] {
>       assets.borderStylesheet,
>       page.assets.pageStylesheet
>     }
>   </binding>
> </component>
> 
> ...
> 
> <context-asset name="borderStylesheet" path="..."/>
> 
> And in each of my regular pages that need a page-specific stylesheet I
> include a line like this:
> 
> <context-asset name="pageStylesheet" path="..."/>
> 
> Alternatively, you could override BasePage to always provide a page-specific
> stylesheet. Hope this helps.
> 
> -Filip S. Adamsen
> 
> -----Original Message-----
> From: Jonny Wray [mailto:jonny_wray@yahoo.com]
> Sent: Friday, April 23, 2004 3:08 AM
> To: Tapestry users
> Subject: Page specific stylesheets
> 
> 
> Hi,
> 
> I'm wondering if there's anyway to specify stylesheets specific to a
> particular page.
> 
> I'm moving more and more of my markup over to using css for
> positioning, and it really helps in making the components standalone.
> But, positioning on a page level is really specific to a page, rather
> than a global style sheet. So, if possible, I'd like to reflect that by
> having a css per page specifying any css positioning needed.
> 
> Jonny
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


RE: Page specific stylesheets

Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
Well, my solution might be a little complicated, or so I think, but i t
works for me. In my Border.jwc I have this:

  <component id="shell" type="Shell">
    ...
    <binding name="stylesheets">
      new org.apache.tapestry.IAsset[] {
        assets.borderStylesheet,
        page.assets.pageStylesheet
      }
    </binding>
  </component>

  ...

  <context-asset name="borderStylesheet" path="..."/>

And in each of my regular pages that need a page-specific stylesheet I
include a line like this:

  <context-asset name="pageStylesheet" path="..."/>

Alternatively, you could override BasePage to always provide a page-specific
stylesheet. Hope this helps.

-Filip S. Adamsen

-----Original Message-----
From: Jonny Wray [mailto:jonny_wray@yahoo.com] 
Sent: Friday, April 23, 2004 3:08 AM
To: Tapestry users
Subject: Page specific stylesheets


Hi,

I'm wondering if there's anyway to specify stylesheets specific to a
particular page.

I'm moving more and more of my markup over to using css for
positioning, and it really helps in making the components standalone.
But, positioning on a page level is really specific to a page, rather
than a global style sheet. So, if possible, I'd like to reflect that by
having a css per page specifying any css positioning needed.

Jonny

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Page specific stylesheets

Posted by Jonny Wray <jo...@yahoo.com>.
Hi,

I'm wondering if there's anyway to specify stylesheets specific to a
particular page.

I'm moving more and more of my markup over to using css for
positioning, and it really helps in making the components standalone.
But, positioning on a page level is really specific to a page, rather
than a global style sheet. So, if possible, I'd like to reflect that by
having a css per page specifying any css positioning needed.

Jonny

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Visit as business layer

Posted by Bryan Lewis <br...@maine.rr.com>.
Thanks for a thought-provoking post.

When you say "service layer", is that the same concept as "controller
layer" in MVC?  Sounds similar... the place where complex business logic
resides (such as a workflow process dealing with multiple entity types).
I guess I need to read up on things like Spring and HiveMind.  Or attend
a seminar on them at the No Fluff conference this weekend (woo-hoo).

If they aren't the same thing, where are people putting such logic in
their Tapestry apps?  (Assuming most will agree that complex biz logic
shouldn't go in the view code.)

.


----- Original Message ----- 
From: "Jonny Wray" <jo...@yahoo.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, April 22, 2004 1:12 AM
Subject: Re: Visit as business layer


>
> I typically use Spring now to define my service/buisness layer, with
the aim
> of having as little actual logic in the listeners as possible.
>
> I actually use global as a place where I can access the spring
application
> context, as the service objects are application wide constant, not
specific
> to a particular user.
>
> I find this provides a very clean separation of concerns between the
view
> and service layers. The view layers knowing nothing about the
specifics of
> where the data is coming from (eg database, web service, complex
logic, all
> three) as they are hidden behind interfaces.
>
> In addition to the usually cited functionality of spring (which is
very
> good) another big advantage I'm finding here is that I can test my
service
> layers outside of the web/j2ee container with plain java code, or
junit
> tests, thus avoiding the redeploying slowness sometimes associated
with
> container based development.
>
> Jonny
>
> On 4/21/04 9:21 PM, "Vjeran Marcinko" <vj...@tis.hr> wrote:
>
> > One more question - How good is Visit and Tapestry alone for
implementing
> > such business layer actions ? For instance, in TIA book, Howard has
written
> > than Visit should be used not only for storing session data but also
for
> > actions, thus keeping listener methods inside components and pages
small,
> > everything because of unit testing.
> >
> > But if I mean to use Visit as business layer, I need some other
facilities
> > such as a way to grab application wide settings. For example, if I
use Visit
> > to call web service, I need a way to grab application config
parameter
> > called "web-service-url" since it is supose to be given as
application
> > config property (where should these kind of properties be specified
> > anyway?!).
> >
> > I know that Tapestry is primarily for presentation layer, so should
I
> > integrate it with Spring/Hivemind/Pico containers then, because of
their
> > sofisticated component/service configuration features ?
> >
> > Regards,
> > Vjeran
> >
> > ----- Original Message -----
> > From: "Erik Hatcher" <er...@ehatchersolutions.com>
> > To: "Tapestry users" <ta...@jakarta.apache.org>
> > Sent: Wednesday, April 21, 2004 9:50 PM
> > Subject: Re: Visit serializable
> >
> >
> >> Visit should be Serializable - anything put into session scope
should
> >> be.  Shame on Howard if Hangman Visit is not :)
> >>
> >> Yes, I would make the web service stub be transient and lazy
> >> initialized when needed.  I do this with a Lucene index connection
from
> >> Global, in fact.
> >>
> >> Erik
> >>
> >>
> >> On Apr 21, 2004, at 3:27 PM, Vjeran Marcinko wrote:
> >>
> >>> Hi.
> >>>
> >>> Does visit class has to implement Serializable always, or just
when
> >>> used in
> >>> cluster ? I bought TIA book, and am looking at Hangman example,
and
> >>> when I
> >>> run it, it throws 'visit class not serializable' exception, but it
> >>> keeps
> >>> running OK after that ?!
> >>>
> >>> And one more question - I want to put action logic in visit class,
but
> >>> third-party classes used (concretely Axis client stub) for these
> >>> actions are
> >>> not serializable. What should I do ?
> >>> Should I avoid using them as Visit's instance variables, and to
> >>> instantiate
> >>> them inside action method body during each request ? Or should I
use
> >>> them as
> >>> instance variable marked as transient ?
> >>>
> >>> Regards,
> >>> Vjeran
> >>>
> >>>
>
>>> --------------------------------------------------------------------
-
> >>> To unsubscribe, e-mail:
tapestry-user-unsubscribe@jakarta.apache.org
> >>> For additional commands, e-mail:
tapestry-user-help@jakarta.apache.org
> >>
> >>
>
>> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail:
tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail:
tapestry-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail:
tapestry-user-help@jakarta.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Visit as business layer

Posted by Jonny Wray <jo...@yahoo.com>.
I typically use Spring now to define my service/buisness layer, with the aim
of having as little actual logic in the listeners as possible.

I actually use global as a place where I can access the spring application
context, as the service objects are application wide constant, not specific
to a particular user.

I find this provides a very clean separation of concerns between the view
and service layers. The view layers knowing nothing about the specifics of
where the data is coming from (eg database, web service, complex logic, all
three) as they are hidden behind interfaces.

In addition to the usually cited functionality of spring (which is very
good) another big advantage I'm finding here is that I can test my service
layers outside of the web/j2ee container with plain java code, or junit
tests, thus avoiding the redeploying slowness sometimes associated with
container based development.

Jonny

On 4/21/04 9:21 PM, "Vjeran Marcinko" <vj...@tis.hr> wrote:

> One more question - How good is Visit and Tapestry alone for implementing
> such business layer actions ? For instance, in TIA book, Howard has written
> than Visit should be used not only for storing session data but also for
> actions, thus keeping listener methods inside components and pages small,
> everything because of unit testing.
> 
> But if I mean to use Visit as business layer, I need some other facilities
> such as a way to grab application wide settings. For example, if I use Visit
> to call web service, I need a way to grab application config parameter
> called "web-service-url" since it is supose to be given as application
> config property (where should these kind of properties be specified
> anyway?!).
> 
> I know that Tapestry is primarily for presentation layer, so should I
> integrate it with Spring/Hivemind/Pico containers then, because of their
> sofisticated component/service configuration features ?
> 
> Regards,
> Vjeran
> 
> ----- Original Message -----
> From: "Erik Hatcher" <er...@ehatchersolutions.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Wednesday, April 21, 2004 9:50 PM
> Subject: Re: Visit serializable
> 
> 
>> Visit should be Serializable - anything put into session scope should
>> be.  Shame on Howard if Hangman Visit is not :)
>> 
>> Yes, I would make the web service stub be transient and lazy
>> initialized when needed.  I do this with a Lucene index connection from
>> Global, in fact.
>> 
>> Erik
>> 
>> 
>> On Apr 21, 2004, at 3:27 PM, Vjeran Marcinko wrote:
>> 
>>> Hi.
>>> 
>>> Does visit class has to implement Serializable always, or just when
>>> used in
>>> cluster ? I bought TIA book, and am looking at Hangman example, and
>>> when I
>>> run it, it throws 'visit class not serializable' exception, but it
>>> keeps
>>> running OK after that ?!
>>> 
>>> And one more question - I want to put action logic in visit class, but
>>> third-party classes used (concretely Axis client stub) for these
>>> actions are
>>> not serializable. What should I do ?
>>> Should I avoid using them as Visit's instance variables, and to
>>> instantiate
>>> them inside action method body during each request ? Or should I use
>>> them as
>>> instance variable marked as transient ?
>>> 
>>> Regards,
>>> Vjeran
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org