You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by David Solis <ds...@legosoft.com.mx> on 2003/05/27 17:50:46 UTC
RE: About page properties
Yes, I know it.
I'm sorry, I'm afraid I wasn't clear, mea culpa.
My example was incomplete. There are external classes which need to
access and set Summary properties.
Main reason of my mail was to propose to have two methods in BasePage to
set and get properties.
I implemented these methods in SupportPage using OgnlUtils, however I
think this is a recurring pattern and should be implemented in BasePage.
An additional feature, not directly related to last issue, would be to
have a special jwcid attribute for the page template to indicate the
page class to instantiate.
That's all.
> -----Original Message-----
> From: Howard M. Lewis Ship [mailto:hlship@attbi.com]
> Sent: Tuesday, May 27, 2003 6:09 AM
> To: 'Tapestry development'
> Subject: RE: About persistent page properties
>
> If your page's logic (i.e. your listener methods) don't need an
accessor
> method, then don't declare
> it. In your example, if you never set the customer, then there's no
point
> in having the abstract
> setCustomer() method.
>
> Tapestry creates, in the enhanced subclass, both methods (and the
field)
> regardless.
>
> In your example, you had no listener method at all. Therefore, in
your
> Spec, you could say the
> class was SupportPage ... you don't even need a Summary page.
>
> To get and set properties, you can use the OgnlUtil methods set() and
> get().
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
>
>
>
> > -----Original Message-----
> > From: David Solis [mailto:dsolis@legosoft.com.mx]
> > Sent: Monday, May 26, 2003 7:58 PM
> > To: tapestry-dev@jakarta.apache.org
> > Subject: About persistent page properties
> >
> >
> > Because of persistent page properties some pages don't have logic,
> > For instance:
> >
> > public abstract class Summary extends SupportPage {
> > public abstract Customer getCustomer();
> > public abstract void setCustomer(Customer customer);
> >
> > public abstract String getBackPageName();
> > public abstract void setBackPageName(String backPageName);
> >
> > public abstract CustomerService getCurrentCustomerService();
> > public abstract void setCurrentCustomerService(CustomerService
> > currentCustomerService);
> >
> > public abstract SignatureGroup
> > getCurrentCustomerServiceSignatureGroup();
> > public abstract void
> > setCurrentCustomerServiceSignatureGroup(SignatureGroup
> > currentCustomerServiceSignatureGroup);
> >
> > public abstract User getCurrentUser();
> > public abstract void setCurrentUser(User currentUser);
> >
> > public abstract UserService getCurrentUserService();
> > public abstract void setCurrentUserService(UserService
> > currentUserService); }
> >
> > In order to update and read properties you must to declare
> > the class and its methods. I implemented in the superclass
> > two methods: Object getProperty(String
> > propertyName) and setProperty(String propertyName, Object value).
The
> > result: I don't need these classes anymore.
> > Shouldn't BasePage have these methods?
> > In fact BaseEngine has a method named setProperty used to set
> > the message attribute of Exception pages.
> >
> > An additional feature would be to have a special jwcid
> > attribute for the page template to indicate the page class to
> > instantiate. Result: Some pages only will require the template part.
> >
> > Do these comments make sense to you?
> >
> > Regards
> >
> > David
> >
> >
> >