You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Igor Vaynberg <ig...@gmail.com> on 2007/01/15 02:48:10 UTC

matadatakeychange

not sure about this commit [1] by eelco.

yes we have the generics, but that safety was enforced at runtime, not
compile time. do we really want to lose that safety net?

[1]
http://mail-archives.apache.org/mod_mbox/incubator-wicket-commits/200701.mbox/ajax/%3c20070114025607.730C51A981A@eris.apache.org%3e

-igor

Re: matadatakeychange

Posted by Eelco Hillenius <ee...@gmail.com>.
On 1/15/07, Johan Compagner <jc...@gmail.com> wrote:
> That param is just so that we can really check it at runtime time.
> But if we think we really don't need it.....

Jonathan and I were in the same room when he coded this up, and we
talked about how we needed such a construct because we couldn't use
generics.

> Generics is just perfect for MetaData because you exactly what you get
> back..
> What that metadata represents.. (not just about the cast itself)

Exactly.

> Type erasure thats the big problem here :(

Well, it's just how much we care/ expect problems with the runtime
checking. How often is it a problem that you mess up a parameterized
list for instance?

Eelco

Re: matadatakeychange

Posted by Johan Compagner <jc...@gmail.com>.
That param is just so that we can really check it at runtime time.
But if we think we really don't need it.....

Generics is just perfect for MetaData because you exactly what you get
back..
What that metadata represents.. (not just about the cast itself)

Type erasure thats the big problem here :(

johan


On 1/15/07, Eelco Hillenius <ee...@gmail.com> wrote:
>
> MetaDataKey was setup with the parameter because we couldn't use
> generics for Wicket 1.x. But well...
>
> So, you and Igor want to keep the generics on top of the parameter,
> just so that you don't have to cast when you get a value? It's not
> even more efficient code-wise, and you won't gain any extra
> type-safety!
>
> Eelco
>
>
> On 1/15/07, Johan Compagner <jc...@gmail.com> wrote:
> > We don't now have any runtime checks. So with a bit of casting and
> > "forgetting" generics you can
> > now store in a metadata key something that isn't meant for this key..
> >
> > So keeping both is my preference if we keep one then the
> parameterization
> > because that
> > is a bit cleaner when using the metadata's in code.
> >
> > johan
> >
> >
> > On 1/15/07, Eelco Hillenius <ee...@gmail.com> wrote:
> > >
> > > Both? You must be kidding. -1 for that. You'll get my +1 for either
> > > the class argument or the  parameterization.
> > >
> > > Eelco
> > >
> > >
> > > On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> > > > yeah it looks stupid, but the protection is there for a reason. and
> you
> > > only
> > > > do it once - where you declare the key. so i am +1 for keeping both
> > > >
> > > > -igor
> > > >
> > > >
> > > > On 1/14/07, Eelco Hillenius <ee...@gmail.com> wrote:
> > > > >
> > > > > I don't think the safety net mattered that much, and furthermore,
> > > > > prior to the change, you have to make constructs like:
> > > > >
> > > > > new MetaDataKey<ActionPermissions>(ActionPermissions.class) {
> > > > > };
> > > > >
> > > > > which imo is just stupid and actually surprised me no-one caught
> that.
> > > > > So, if you are worried about the runtime check, we should discard
> the
> > > > > parameterization and go back to 1.3's signature. Vote?
> > > > >
> > > > > Eelco
> > > > >
> > > > >
> > > > > On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> > > > > > not sure about this commit [1] by eelco.
> > > > > >
> > > > > > yes we have the generics, but that safety was enforced at
> runtime,
> > > not
> > > > > > compile time. do we really want to lose that safety net?
> > > > > >
> > > > > > [1]
> > > > > >
> > > > >
> > >
> http://mail-archives.apache.org/mod_mbox/incubator-wicket-commits/200701.mbox/ajax/%3c20070114025607.730C51A981A@eris.apache.org%3e
> > > > > >
> > > > > > -igor
> > > > > >
> > > > > >
> > > > >
> > > >
> > > >
> > >
> >
> >
>

Re: matadatakeychange

Posted by Eelco Hillenius <ee...@gmail.com>.
MetaDataKey was setup with the parameter because we couldn't use
generics for Wicket 1.x. But well...

So, you and Igor want to keep the generics on top of the parameter,
just so that you don't have to cast when you get a value? It's not
even more efficient code-wise, and you won't gain any extra
type-safety!

Eelco


On 1/15/07, Johan Compagner <jc...@gmail.com> wrote:
> We don't now have any runtime checks. So with a bit of casting and
> "forgetting" generics you can
> now store in a metadata key something that isn't meant for this key..
>
> So keeping both is my preference if we keep one then the parameterization
> because that
> is a bit cleaner when using the metadata's in code.
>
> johan
>
>
> On 1/15/07, Eelco Hillenius <ee...@gmail.com> wrote:
> >
> > Both? You must be kidding. -1 for that. You'll get my +1 for either
> > the class argument or the  parameterization.
> >
> > Eelco
> >
> >
> > On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> > > yeah it looks stupid, but the protection is there for a reason. and you
> > only
> > > do it once - where you declare the key. so i am +1 for keeping both
> > >
> > > -igor
> > >
> > >
> > > On 1/14/07, Eelco Hillenius <ee...@gmail.com> wrote:
> > > >
> > > > I don't think the safety net mattered that much, and furthermore,
> > > > prior to the change, you have to make constructs like:
> > > >
> > > > new MetaDataKey<ActionPermissions>(ActionPermissions.class) {
> > > > };
> > > >
> > > > which imo is just stupid and actually surprised me no-one caught that.
> > > > So, if you are worried about the runtime check, we should discard the
> > > > parameterization and go back to 1.3's signature. Vote?
> > > >
> > > > Eelco
> > > >
> > > >
> > > > On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> > > > > not sure about this commit [1] by eelco.
> > > > >
> > > > > yes we have the generics, but that safety was enforced at runtime,
> > not
> > > > > compile time. do we really want to lose that safety net?
> > > > >
> > > > > [1]
> > > > >
> > > >
> > http://mail-archives.apache.org/mod_mbox/incubator-wicket-commits/200701.mbox/ajax/%3c20070114025607.730C51A981A@eris.apache.org%3e
> > > > >
> > > > > -igor
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
>

Re: matadatakeychange

Posted by Johan Compagner <jc...@gmail.com>.
We don't now have any runtime checks. So with a bit of casting and
"forgetting" generics you can
now store in a metadata key something that isn't meant for this key..

So keeping both is my preference if we keep one then the parameterization
because that
is a bit cleaner when using the metadata's in code.

johan


On 1/15/07, Eelco Hillenius <ee...@gmail.com> wrote:
>
> Both? You must be kidding. -1 for that. You'll get my +1 for either
> the class argument or the  parameterization.
>
> Eelco
>
>
> On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> > yeah it looks stupid, but the protection is there for a reason. and you
> only
> > do it once - where you declare the key. so i am +1 for keeping both
> >
> > -igor
> >
> >
> > On 1/14/07, Eelco Hillenius <ee...@gmail.com> wrote:
> > >
> > > I don't think the safety net mattered that much, and furthermore,
> > > prior to the change, you have to make constructs like:
> > >
> > > new MetaDataKey<ActionPermissions>(ActionPermissions.class) {
> > > };
> > >
> > > which imo is just stupid and actually surprised me no-one caught that.
> > > So, if you are worried about the runtime check, we should discard the
> > > parameterization and go back to 1.3's signature. Vote?
> > >
> > > Eelco
> > >
> > >
> > > On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> > > > not sure about this commit [1] by eelco.
> > > >
> > > > yes we have the generics, but that safety was enforced at runtime,
> not
> > > > compile time. do we really want to lose that safety net?
> > > >
> > > > [1]
> > > >
> > >
> http://mail-archives.apache.org/mod_mbox/incubator-wicket-commits/200701.mbox/ajax/%3c20070114025607.730C51A981A@eris.apache.org%3e
> > > >
> > > > -igor
> > > >
> > > >
> > >
> >
> >
>

Re: matadatakeychange

Posted by Eelco Hillenius <ee...@gmail.com>.
Both? You must be kidding. -1 for that. You'll get my +1 for either
the class argument or the  parameterization.

Eelco


On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> yeah it looks stupid, but the protection is there for a reason. and you only
> do it once - where you declare the key. so i am +1 for keeping both
>
> -igor
>
>
> On 1/14/07, Eelco Hillenius <ee...@gmail.com> wrote:
> >
> > I don't think the safety net mattered that much, and furthermore,
> > prior to the change, you have to make constructs like:
> >
> > new MetaDataKey<ActionPermissions>(ActionPermissions.class) {
> > };
> >
> > which imo is just stupid and actually surprised me no-one caught that.
> > So, if you are worried about the runtime check, we should discard the
> > parameterization and go back to 1.3's signature. Vote?
> >
> > Eelco
> >
> >
> > On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> > > not sure about this commit [1] by eelco.
> > >
> > > yes we have the generics, but that safety was enforced at runtime, not
> > > compile time. do we really want to lose that safety net?
> > >
> > > [1]
> > >
> > http://mail-archives.apache.org/mod_mbox/incubator-wicket-commits/200701.mbox/ajax/%3c20070114025607.730C51A981A@eris.apache.org%3e
> > >
> > > -igor
> > >
> > >
> >
>
>

Re: matadatakeychange

Posted by Igor Vaynberg <ig...@gmail.com>.
yeah it looks stupid, but the protection is there for a reason. and you only
do it once - where you declare the key. so i am +1 for keeping both

-igor


On 1/14/07, Eelco Hillenius <ee...@gmail.com> wrote:
>
> I don't think the safety net mattered that much, and furthermore,
> prior to the change, you have to make constructs like:
>
> new MetaDataKey<ActionPermissions>(ActionPermissions.class) {
> };
>
> which imo is just stupid and actually surprised me no-one caught that.
> So, if you are worried about the runtime check, we should discard the
> parameterization and go back to 1.3's signature. Vote?
>
> Eelco
>
>
> On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> > not sure about this commit [1] by eelco.
> >
> > yes we have the generics, but that safety was enforced at runtime, not
> > compile time. do we really want to lose that safety net?
> >
> > [1]
> >
> http://mail-archives.apache.org/mod_mbox/incubator-wicket-commits/200701.mbox/ajax/%3c20070114025607.730C51A981A@eris.apache.org%3e
> >
> > -igor
> >
> >
>

Re: matadatakeychange

Posted by Eelco Hillenius <ee...@gmail.com>.
I don't think the safety net mattered that much, and furthermore,
prior to the change, you have to make constructs like:

new MetaDataKey<ActionPermissions>(ActionPermissions.class) {
};

which imo is just stupid and actually surprised me no-one caught that.
So, if you are worried about the runtime check, we should discard the
parameterization and go back to 1.3's signature. Vote?

Eelco


On 1/14/07, Igor Vaynberg <ig...@gmail.com> wrote:
> not sure about this commit [1] by eelco.
>
> yes we have the generics, but that safety was enforced at runtime, not
> compile time. do we really want to lose that safety net?
>
> [1]
> http://mail-archives.apache.org/mod_mbox/incubator-wicket-commits/200701.mbox/ajax/%3c20070114025607.730C51A981A@eris.apache.org%3e
>
> -igor
>
>