Eric Bowman wrote:
The basic trick where a superclass has its subclass as a type parameter,
e.g.
class User extends MegaProtoUser[User]
I've run into this before, I remember struggling to get it, then
getting it, but I can't recall the epiphany. But obviously this is a
relatively common
Having type parameters on Mapper classes helps with a lot of things and is
not going to go away. Marius and I discussed this a bunch of months ago
onlist.
Basically, the QueryParam (stuff that's passed to find(), findAll(), etc.)
must be type checked against the current Mapper so you don't pass
Eric,
I believe that something like that, in C++ at least, is referred to as the
curiously recurring template pattern.
Jeremy
On Fri, Jun 19, 2009 at 1:18 AM, Eric Bowman ebow...@boboco.ie wrote:
The basic trick where a superclass has its subclass as a type parameter,
e.g.
class User
On Thu, Jun 18, 2009 at 11:18 PM, Eric Bowman ebow...@boboco.ie wrote:
The basic trick where a superclass has its subclass as a type parameter,
e.g.
class User extends MegaProtoUser[User]
The circular dependent type that gives Martin and the compiler fits? :-)
I've run into this
I've always called this recursive type parameterization. It's useful
when the base class needs to know the type that it's eventually
instantiated as, usually so that it can provide implementations of
methods where dispatch is based upon the instantiated type. I've found
myself using the pattern
This is also a common technique in C# too. Unfortunately, I'm not
sure of the pattern's name either. I usually just google for
non-generic inheritance from generic class
On Fri, Jun 19, 2009 at 10:31 AM, Jeremy Dayjeremy@gmail.com wrote:
Eric,
I believe that something like that, in C++
On Thursday June 18 2009, Eric Bowman wrote:
The basic trick where a superclass has its subclass as a type
parameter, e.g.
class User extends MegaProtoUser[User]
I've run into this before, I remember struggling to get it, then
getting it, but I can't recall the epiphany. But obviously
On Thu, Jun 18, 2009 at 11:18 PM, Eric Bowman ebow...@boboco.ie wrote:
The basic trick where a superclass has its subclass as a type parameter,
e.g.
class User extends MegaProtoUser[User]
I've run into this before, I remember struggling to get it, then
getting it, but I can't recall the