<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Apache Wicket 1.4-m3 with improved generics</title>
	<atom:link href="http://martijndashorst.com/blog/2008/07/14/apache-wicket-14-m3-with-improved-generics/feed/" rel="self" type="application/rss+xml" />
	<link>http://martijndashorst.com/blog/2008/07/14/apache-wicket-14-m3-with-improved-generics/</link>
	<description>Ramblings on Java, Wicket, cats and other stuff</description>
	<lastBuildDate>Wed, 27 Jan 2010 00:31:04 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jörn Zaefferer</title>
		<link>http://martijndashorst.com/blog/2008/07/14/apache-wicket-14-m3-with-improved-generics/comment-page-1/#comment-57084</link>
		<dc:creator>Jörn Zaefferer</dc:creator>
		<pubDate>Thu, 17 Jul 2008 14:31:10 +0000</pubDate>
		<guid isPermaLink="false">http://martijndashorst.com/blog/2008/07/14/apache-wicket-14-m3-with-improved-generics/#comment-57084</guid>
		<description>That thread is slightly going overboard and I don&#039;t want to register on Nabble (storing passwords in cleartext, bah), so I&#039;ll share my thoughs on the m3 here:

I just updated my current project to see what will happen. Its not encouraging. My impression is that generified models are worthless without generified components. Most of the time adding the type parameter gains nothing then to satisfy the compiler. The only place where I can remove a cast is in ListView&#039;s populateItem method, where I can use getModelObject directly, without having to cast first. All in all I have to add code to get very barely more type safety.
In the case of PropertyModel I gain nothing, as the constructor still takes Object, while I don&#039;t ever call the generified get/setObject methods myself.

I&#039;m having two TextField subclasses to implement my own Converter for certain fields. Just registering a new Converter doesn&#039;t do the trick, as I need to have a special converter for one Long field. Without generics I can overwrite the getConverter() method, with generics I can&#039;t, as getConverter doesn&#039;t care for the component type, just for the type of the class being passed. So I&#039;d replace Object with X and still have to cast to Long.

Having generic Links doesn&#039;t help either - my Links all interact with the parent component&#039;s model object, usually a page or panel. Setting models to each and every nested components seems like a waste of code as using the parent model object works fine.

I hope this helps in deciding how to move on!

Regards
Jörn</description>
		<content:encoded><![CDATA[<p>That thread is slightly going overboard and I don&#8217;t want to register on Nabble (storing passwords in cleartext, bah), so I&#8217;ll share my thoughs on the m3 here:</p>
<p>I just updated my current project to see what will happen. Its not encouraging. My impression is that generified models are worthless without generified components. Most of the time adding the type parameter gains nothing then to satisfy the compiler. The only place where I can remove a cast is in ListView&#8217;s populateItem method, where I can use getModelObject directly, without having to cast first. All in all I have to add code to get very barely more type safety.<br />
In the case of PropertyModel I gain nothing, as the constructor still takes Object, while I don&#8217;t ever call the generified get/setObject methods myself.</p>
<p>I&#8217;m having two TextField subclasses to implement my own Converter for certain fields. Just registering a new Converter doesn&#8217;t do the trick, as I need to have a special converter for one Long field. Without generics I can overwrite the getConverter() method, with generics I can&#8217;t, as getConverter doesn&#8217;t care for the component type, just for the type of the class being passed. So I&#8217;d replace Object with X and still have to cast to Long.</p>
<p>Having generic Links doesn&#8217;t help either &#8211; my Links all interact with the parent component&#8217;s model object, usually a page or panel. Setting models to each and every nested components seems like a waste of code as using the parent model object works fine.</p>
<p>I hope this helps in deciding how to move on!</p>
<p>Regards<br />
Jörn</p>
]]></content:encoded>
	</item>
</channel>
</rss>
