Having moved my wicket project to the 1.4 trunk, I have to say that I like
generics quite a bit.  Yes, there is a bit of a learning curve with them,
but in general I like not having to cast my getModelObject() calls.  It is
especially nice inside of DataView and DropDownChoice.  Learning curve
problems can be overcome with good examples.

Generics add a lot in type safety and, once you get used to them,
convenience.

I strongly vote against backing out this work.

-Doug



Johan Compagner wrote:
> 
> as i said. any generified use of CompoundPropertyModel is gone
> 
> Also if you make getModel() return a normal IModel that is of raw type i
> think you get warnings everywhere again...
> and i think only suppresswarnings will help those
> Because if yo do
> 
> IModel<String> stringModel = (IModel<String>)component.getModel();
> 
> that will generate a warning as far as i know.
> and i guess if you dont cast:
> 
> IModel stringModel = component.getModel();
> 
> will also generate a warning? i am not sure because i see so many. But
> there
> you use IModel that is a generic type as a raw type..
> 
> i still think dropping it from component we could drop it also from model
> Because the only thing we gain that is that for a few classes the Api is
> more clear (DropDown and ListView)
> But for the rest it doesnt bring almost anything. No type safety pretty
> much
> anywhere.
> 
> johan
> 
> 
> 
> 
> 
> On Wed, May 21, 2008 at 11:53 AM, Martijn Dashorst <
> [EMAIL PROTECTED]> wrote:
> 
>> That is not my problem. The problem is that Component<T> is confusing
>> as hell and opens up the box of pandorra wrt generics. I *like*
>> IModel<T> but I fail to see how setResponsePage(<? extends <? extends
>> <?>>>) is necessary for this. The only reason iirc to generify
>> component is to remove the casts for these two methods:
>>
>> IModel getModel()
>> Object getModelObject()
>>
>> I can live with having these methods not being generified.
>>
>> Martijn
>>
>> On Wed, May 21, 2008 at 11:36 AM, Peter Ertl <[EMAIL PROTECTED]> wrote:
>> > Maybe this can help a little:
>> > http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6384510
>> > (verified with java 1.5 on mac os x leopard)
>> >
>> >
>> > Am 21.05.2008 um 11:13 schrieb Martijn Dashorst:
>> >
>> >> On Wed, May 21, 2008 at 11:03 AM, Johan Compagner
>> <[EMAIL PROTECTED]
>> >
>> >> wrote:
>> >>>
>> >>> if we drop that then we can pretty much drop also model
>> >>
>> >> Not sure. I think having Component(String id, IModel<T> model) is a
>> >> good thing. However, generifying Component further to get rid of the
>> >> cast when doing getModelObject() or getModel() turns out not to be
>> >> great.
>> >>
>> >>> Because the model goes into the Component and gone is the generified
>> >>> model.
>> >>
>> >> I don't have a direct problem with that. The generics of Component are
>> >> really hard on the eye and the brain. We are trying to make things
>> >> simpler and clearer. Having Component(String id, IModel<T> model)
>> >> makes things clearer.
>> >>
>> >>> For example the DropDownChoice that is generified now makes sure that
>> i
>> >>> have
>> >>> a lot less explaining to on this list..
>> >>
>> >> Yes, I am not in favor of dropping DDC(String, IModel<T>,
>> >> IModel<List<? extends T>>). I am in favor of dropping the generics
>> >> from the Component class definition.
>> >>
>> >>
>> >> Martijn
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>>
>>
>>
>> --
>> Buy Wicket in Action: http://manning.com/dashorst
>> Apache Wicket 1.3.3 is released
>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.3
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/%28Class%3C--extends-Page%3C-%3E%3E%29--casting-troubles-tp17355847p17364199.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to