and using it in this way
Funnier funnier=new Funnier(Foo.class,Bar.class);
or
Funny funny=new Funny(Foo.class);
--
regards,
Vineet Semwal
On Thu, Sep 17, 2009 at 8:16 PM, vineet semwal
wrote:
> I should have stated it clearly ..
> i actually meant passing type Class in constructor itself like
I should have stated it clearly ..
i actually meant passing type Class in constructor itself like in following
code:-
class Funny {
private ClasstypeClass;
public Funny(ClasstypeClass){
this.typeClass=typeClass;
}
}
class Funnier extends Funny{
private ClasstypeClassT;
private ClasstypeClassR;
2, 47), instance);
> }
> }
>
> Looks pretty powerful to me ;-)
>
> Regards
>
> misl
>
> -Oorspronkelijk bericht-
> Van: jWeekend [mailto:jweekend_for...@cabouge.com]
> Verzonden: donderdag 17 september 2009 0:44
> Aan: users@wicket.apache.org
[mailto:jweekend_for...@cabouge.com]
Verzonden: donderdag 17 september 2009 0:44
Aan: users@wicket.apache.org
Onderwerp: [OT] More "Java's generic type parameters are not reified"...
Since you can NOT do
class S{S(){T t = new T();}} // broken
how would you create an object of type
Vineet ,
Yes, this is a technique that, carefully and properly used, could help in
building a generic DAO.
Can you elaborate on "intializing the class type in constructor." ?
Regards - Cemal
jWeekend
OO & Java Technologies, Wicket Training and Development
http://jWeekend.com
vineet semwal
... or, if you subclass the subclass ...
In the form I gave it's very fragile - just a trick really, but it tells you
a bit about what is actually in the bytecode and contradicts (as
conclusively as using javap) what some would have you believe.
Regards - Cemal
jWeekend OO & Java Technologies, W
what happens if down the line the index of the type changes?: )
class FunnierFactory extends FunnyFactory
-igor
On Wed, Sep 16, 2009 at 3:43 PM, jWeekend wrote:
> Since you can NOT do
>
> class S{S(){T t = new T();}} // broken
>
> how would you create an object of type T somewhere in S? Think a
the first time I used genericsuperclass() was in generic daos after
reading https://www.hibernate.org/328.html,
though it has it's own quirks, it doesn't apply every where ..
abstract modifier in above code was needed,it's done so that one will
eventually subclass funnyfactory
and that gener
Since you can NOT do
class S{S(){T t = new T();}} // broken
how would you create an object of type T somewhere in S? Think about this
before you read on ...
At the risk of reigniting the world-famous generics debates of yesteryear, just as our noble core-developers regroup to start work on mak