Another option would be to directly implement IModel<T>.

On Tue, Jun 15, 2010 at 7:04 PM, Rodolfo Hansen [via Apache Wicket] <
[email protected]<ml-node%[email protected]>
> wrote:

> Are you sure you want to override Model in the first place?
> Di you see LoadableDetachableModel ?
>
> Model is not ment to be an abstract class,
> I would argue its not a bug, but that would be a whole other debate...
>
> On Tue, 2010-06-15 at 06:56 -0400, Alex Rass wrote:
>
> > No, Martin, it can't work.
> > Look at the implementation.
> >
> > ALL other methods use object directly.
> > SO if you just override getObject you'll endup with a broken:
> > equals(), hashCode(), toString() methods (which breaks any form of
> caching)
> > detach() would also be broken.
> >
> > So no, it can't work.
> > You HAVE to super.setObject() or setObject() directly and use internal
> > object to use Model<T> class.
> > Which is not deadly, but a "need to know".
> >
> > Hence: is it a bug or a feature?
> > Igor? :)
> >
> > - Alex
> >
> >
> > -----Original Message-----
> > From: Martin Makundi [mailto:[hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=2256139&i=0>]
>
> > Sent: Tuesday, June 15, 2010 6:11 AM
> > To: [hidden email]<http://user/SendEmail.jtp?type=node&node=2256139&i=1>
> > Subject: Re: is this a bug in Model<T>?
> >
> > I did something similar and it works.
> >
> > **
> > Martin
> >
> > 2010/6/15 Alex Rass <[hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=2256139&i=2>>:
>
> > > Hi.
> > >
> > > Was writing some code and encountered that
> > > org.apache.wicket.model.Model <T>
> > >
> > > Always uses direct references to 'object' variable directly. And never
> > > as getObject().
> > > This may hinder overriding methods.
> > >
> > > (I found this cause I overwrote getObject() and NOTHING changed :) I
> > > then looked at the source and knew how to fix it)
> > >
> > > Bug or feature?
> > >
> > > This is Wicket 1.4.7
> > >
> > > - Alex
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [hidden 
> > > email]<http://user/SendEmail.jtp?type=node&node=2256139&i=3>
> > > For additional commands, e-mail: [hidden 
> > > email]<http://user/SendEmail.jtp?type=node&node=2256139&i=4>
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=2256139&i=5>
> > For additional commands, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=2256139&i=6>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=2256139&i=7>
> > For additional commands, e-mail: [hidden 
> > email]<http://user/SendEmail.jtp?type=node&node=2256139&i=8>
> >
>
>
>
>
> ------------------------------
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/is-this-a-bug-in-Model-T-tp2255650p2256139.html
> To start a new topic under Wicket - User, email
> [email protected]<ml-node%[email protected]>
> To unsubscribe from Wicket - User, click 
> here<http://apache-wicket.1842946.n4.nabble.com/subscriptions/Unsubscribe.jtp?code=YXZyYWhhbXJAZ21haWwuY29tfDE4NDI5NDd8LTEwNzY0NzQ1ODc=>.
>
>
>


-- 
[]'s
Avraham Rosenzweig
[email protected]

-- 
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/is-this-a-bug-in-Model-T-tp2255650p2256282.html
Sent from the Wicket - User mailing list archive at Nabble.com.

Reply via email to