As we discuss earlier (2000/09/22), we added a method createObject() to
allow to extend peers. This method is like this. And as we discuss, we
thought we only will overload the createObject() method in the subclass.

protected static createObject()
{
    return new MyDataObject();
}


SubMyPeer extends MyPeer.
If I call SubMyPeer.doSelect(), it really calls the MyPeer.doSelect(). In
the code, it calls the createObject() (in fact MyPeer.createObject())method
and not the SubMyPeer because it is static.
The problem is that all the methods in peers are static.

Did I misunderstood something or did we miss this problem when we discuss
this point ??

Any idea to resolve that ?

Herv�

----- Original Message -----

From: Jon Stevens <[EMAIL PROTECTED]>
To: Turbine <[EMAIL PROTECTED]>
Sent: Friday, September 22, 2000 11:16 PM
Subject: Re: Newtorque proposals - contribution proposal


> on 9/22/2000 12:36 AM, "Leon Messerschmidt" <[EMAIL PROTECTED]> wrote:
>
> > I think maybe we should go with this approach.  It allows you to check
at
> > compile
> > time if the objects are compatible (createObject() has to return  the
derived
> > object).  With doSelect (Criteria, Classname) you might wind up with a
nasty
> > ClassCastException you did not bargain on.
> >
> > Any other thoughts on this?
> >
> > ~ Leon
>
> I trust Fedor's ideas 100%. He has extremely strong database and OO skills
> and has been very helpful on the Scarab project.
>
> -jon
>
> --
> http://scarab.tigris.org/    | http://noodle.tigris.org/
> http://java.apache.org/      | http://java.apache.org/turbine/
> http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
> http://www.collab.net/       | http://www.sourcexchange.com/
>
>
>
>
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [EMAIL PROTECTED]
>



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to