What if Component was not generified, and had an 'Object getModel()' method instead of 'Object getDefaultModel()', and the components that do benefit from generics, simply override the method to return 'T' (then the component class would have a <T> type parameter)? The compiler accepts this just fine.
Tetsuo On Mon, Jul 6, 2009 at 3:48 PM, tetsuo <[email protected]> wrote: > I've just read the explanation in a Tim's blog post comment. Oh, well, > generics definitely isn't easy to grasp... > > I myself have observed that my (wicket) code is so much readable without > most generics declarations. Even when using components that do have models > (Textfield, for example) I didn't gain anything for adding the angle > brackets, since the models in general use reflection (PropertyModel, > CompoundPropertyModel, etc.), and don't make any use of the build-time > validation at all. > > sigh... > > Tetsuo > > > > > On Mon, Jul 6, 2009 at 3:35 PM, tetsuo <[email protected]> wrote: > >> I understand the getModelObject() thing, but I not about the >> getDefaultModel(). Why is that? >> >> I've found an e-mail ( >> http://mail-archives.apache.org/mod_mbox/wicket-dev/200806.mbox/%[email protected]%3e) >> that states that it may be removed in 1.5. >> >> Why rename getModel to getDefaultModel just to take it out later? >> >> Not a critic, just trying to understand. >> >> Tetsuo >> >> >> >> >> On Mon, Jul 6, 2009 at 11:18 AM, Jeremy Thomerson < >> [email protected]> wrote: >> >>> A good overall read, but he also seemed to miss the reason we have >>> getModel**Object**. He doesn't think that's necessary, but misses >>> that there is also getModel (without object) and the word does clarify >>> the difference. >>> >>> Anyway, a good read on overall API design, though. I'd recommend it >>> to others with the caveat that I also disagree with his last part >>> about the rename. >>> >>> -- >>> Jeremy Thomerson >>> http://www.wickettraining.com >>> >>> >>> >>> >>> On Mon, Jul 6, 2009 at 8:22 AM, Martijn >>> Dashorst<[email protected]> wrote: >>> > >>> http://weblogs.java.net/blog/timboudreau/archive/2009/07/api_design_vs_a_1.html >>> > >>> > I guess he doesn't get why we did the rename. This reminds me that we >>> > *really* should improve our release docs before we finalize 1.4!!! >>> > >>> > Martijn >>> > >>> > -- >>> > Become a Wicket expert, learn from the best: http://wicketinaction.com >>> > Apache Wicket 1.3.5 is released >>> > Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3. >>> > >>> >> >> >
