To be more specified,

you can define a base class:

package com.myapp.base;

public class EditPage<T> {

  @Persist private T _object;

  public T getObject() { return _object; }

  public void setObject(T object) { _object = object; }

 . . .
}

So you can create a page that can edit an arbitrary object.  EditPage
will have its own Tapestry template containing, say, a BeanEditForm.

Now, you can define a new class:

package com.myapp.pages;

public class EditAccount extends EditPage<Account>
{
}

EditAccount will inherit logic and template from EditPage.

Further, the getObject() and setObject() properties will be bound to
the type Account.  This takes some doing, as the type of property
object of class EditPage is nominally java.lang.Object (due to type
erasure).  However, Tapestry does a bit of work with reflection to
deduce the effective type of the property (Account).

This is a very, very high level of reuse ... and once again, we are
leveraging Java's type system to help us, rather than traditional Java
coding where we spend our time "appeasing" the type system.



On Feb 17, 2008 6:58 AM, Davor Hrg <[EMAIL PROTECTED]> wrote:
> creating a base ListPage and BaseEdit page
> is just what needs this feature.
>
> so you can genericaly declare common properties
> and have a those Common pages for the entities running quickly
> just by subclassing... and then going from there to customize.
>
>
>
>
>
>
> On Feb 17, 2008 3:10 PM, Angelo Chen <[EMAIL PROTECTED]> wrote:
> >
> > Hi Davor,
> >
> > Looks good although I have no idea yet how to use this feature, thanks.
> >
> > A.C.
> >
> > Davor Hrg wrote:
> > >
> > > it is a resolution of these issues
> > >
> > > https://issues.apache.org/jira/browse/TAPESTRY-2053
> > > https://issues.apache.org/jira/browse/TAPESTRY-1518
> > >
> > > you have samples there
> > >
> > >
> > >
> >
> > --
> > View this message in context: 
> > http://www.nabble.com/T5%3A-5.0.10-new-features-tp15528824p15529471.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]
>
>



-- 
Howard M. Lewis Ship

Creator Apache Tapestry and Apache HiveMind

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

Reply via email to