You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Payne, Matthew" <Pa...@pennmutual.com> on 2006/04/14 21:11:02 UTC
tapestry for a webwork developer
I recently started with a new company that appears to have chosen tapestry as their framework.
I've previously been swimming webwork over the last couple of years. I have to admit I have somewhat bias.
I am digging around for a few good sample apps that use reasonably decent practices with Tapestry 4. I took a look at "Better Petshop" (uses tapestry 3). Is there anything "Better"?
At first glance I was a little concerned with how verbose things were.
For instance, the "actions" duplicate all the getters/setters that were in the main pojo they are exposing.
e.g. instead of exposing get/set Customer, it
had to copy all the properties to its action properties
i.e.
setGivenName(customer.getFirstname());
setFamilyName(customer.getLastname());
setAddress1(customer.getAddr1());
setAddress2(customer.getAddr2());
setCity(customer.getCity());
setStateOrProvince(customer.getState());
setCountry(customer.getCountry());
setPostalCode(customer.getZip());
setTelephoneNumber(customer.getPhone());
Is this typical with Tapestry apps?
Can't we just expose the main pojo without all this extra code?
The other thing I was concerned about is that much of the application's behavior is achieve via inheritance(e.g. the archaic struts way).
OrderBillingPage-->ProtectedPage-->PetshopBasePage
In webwork, I'd probably achieve the same behavior by adding a some type of securityInterceptor to that actions config(the are ways to default this to whole packages of actions).
<action name="orderBilling" class="com.something.OrderBillingAction">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="security"/> <!--- checks for user login and redirects to global result "LOGON" if needed -->
<result name="success">billing.jsp</result>
</action>
Does tapestry have equivalent interceptors that can be defaulted for sections of the application without having to resort to inheritance?
Thanks,
Matt
This message, including any attachments, is intended only for the recipient(s)
named above. It may contain confidential and privileged information. If you have
received this communication in error, please notify the sender immediately and
destroy or delete the original message. Also, please be aware that if you are not
the intended recipient, any review, disclosure, copying, distribution or any
action or reliance based on this message is prohibited by law.
Re: tapestry for a webwork developer
Posted by Adam Zimowski <zi...@gmail.com>.
Just curious.... What is in your optionion wrong with
inheritance-based security model ?
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: tapestry for a webwork developer
Posted by James Carman <ja...@carmanconsulting.com>.
Matt,
Are you guys stuck with Tap3? If you're using Tap4, then you can use
HiveMind services as the "guts" of your pages/components. Then, you can
apply interceptors to those services much like you're describing.
James
-----Original Message-----
From: Payne, Matthew [mailto:Payne.Matthew@pennmutual.com]
Sent: Friday, April 14, 2006 3:11 PM
To: tapestry-user@jakarta.apache.org
Subject: tapestry for a webwork developer
I recently started with a new company that appears to have chosen tapestry
as their framework.
I've previously been swimming webwork over the last couple of years. I have
to admit I have somewhat bias.
I am digging around for a few good sample apps that use reasonably decent
practices with Tapestry 4. I took a look at "Better Petshop" (uses tapestry
3). Is there anything "Better"?
At first glance I was a little concerned with how verbose things were.
For instance, the "actions" duplicate all the getters/setters that were in
the main pojo they are exposing.
e.g. instead of exposing get/set Customer, it
had to copy all the properties to its action properties
i.e.
setGivenName(customer.getFirstname());
setFamilyName(customer.getLastname());
setAddress1(customer.getAddr1());
setAddress2(customer.getAddr2());
setCity(customer.getCity());
setStateOrProvince(customer.getState());
setCountry(customer.getCountry());
setPostalCode(customer.getZip());
setTelephoneNumber(customer.getPhone());
Is this typical with Tapestry apps?
Can't we just expose the main pojo without all this extra code?
The other thing I was concerned about is that much of the application's
behavior is achieve via inheritance(e.g. the archaic struts way).
OrderBillingPage-->ProtectedPage-->PetshopBasePage
In webwork, I'd probably achieve the same behavior by adding a some type of
securityInterceptor to that actions config(the are ways to default this to
whole packages of actions).
<action name="orderBilling" class="com.something.OrderBillingAction">
<interceptor-ref name="defaultStack"/>
<interceptor-ref name="security"/> <!--- checks for user login
and redirects to global result "LOGON" if needed -->
<result name="success">billing.jsp</result>
</action>
Does tapestry have equivalent interceptors that can be defaulted for
sections of the application without having to resort to inheritance?
Thanks,
Matt
This message, including any attachments, is intended only for the
recipient(s)
named above. It may contain confidential and privileged information. If you
have
received this communication in error, please notify the sender immediately
and
destroy or delete the original message. Also, please be aware that if you
are not
the intended recipient, any review, disclosure, copying, distribution or any
action or reliance based on this message is prohibited by law.
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: tapestry for a webwork developer
Posted by Chris Nelson <cn...@yahoo.com>.
Having looked a the better petshop, I'm not sure it is
the best source of best practices information.
Certainly you would just have your POJO be a property
of your page, this is incredibly easy with Tapestry.
Tapestry does do type conversion very well, much
better than Struts for example which is of course
totally broken.
As far as security, I am using Acegi and will probably
be using URL based restrictions, this is not hard with
friendly URLs in Tap4. You could also do something
much like your interceptor approach using Hivemind,
but that is beyond my HM knowledge I'm afraid.
--Chris
--- "Payne, Matthew" <Pa...@pennmutual.com>
wrote:
> I recently started with a new company that appears
> to have chosen tapestry as their framework.
> I've previously been swimming webwork over the last
> couple of years. I have to admit I have somewhat
> bias.
>
> I am digging around for a few good sample apps that
> use reasonably decent practices with Tapestry 4. I
> took a look at "Better Petshop" (uses tapestry 3).
> Is there anything "Better"?
>
> At first glance I was a little concerned with how
> verbose things were.
> For instance, the "actions" duplicate all the
> getters/setters that were in the main pojo they are
> exposing.
>
> e.g. instead of exposing get/set Customer, it
> had to copy all the properties to its action
> properties
> i.e.
> setGivenName(customer.getFirstname());
> setFamilyName(customer.getLastname());
> setAddress1(customer.getAddr1());
> setAddress2(customer.getAddr2());
> setCity(customer.getCity());
> setStateOrProvince(customer.getState());
> setCountry(customer.getCountry());
> setPostalCode(customer.getZip());
> setTelephoneNumber(customer.getPhone());
>
> Is this typical with Tapestry apps?
>
> Can't we just expose the main pojo without all this
> extra code?
>
> The other thing I was concerned about is that much
> of the application's behavior is achieve via
> inheritance(e.g. the archaic struts way).
> OrderBillingPage-->ProtectedPage-->PetshopBasePage
>
> In webwork, I'd probably achieve the same behavior
> by adding a some type of securityInterceptor to that
> actions config(the are ways to default this to whole
> packages of actions).
>
> <action name="orderBilling"
> class="com.something.OrderBillingAction">
> <interceptor-ref name="defaultStack"/>
> <interceptor-ref name="security"/> <!---
> checks for user login and redirects to global result
> "LOGON" if needed -->
> <result
> name="success">billing.jsp</result>
> </action>
>
> Does tapestry have equivalent interceptors that can
> be defaulted for sections of the application without
> having to resort to inheritance?
>
> Thanks,
>
> Matt
>
> This message, including any attachments, is intended
> only for the recipient(s)
> named above. It may contain confidential and
> privileged information. If you have
> received this communication in error, please notify
> the sender immediately and
> destroy or delete the original message. Also, please
> be aware that if you are not
> the intended recipient, any review, disclosure,
> copying, distribution or any
> action or reliance based on this message is
> prohibited by law.
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org