<?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: CarPlant not accepting null CarModels</title>
	<atom:link href="http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/</link>
	<description>The voice of SpringSource</description>
	<pubDate>Sun, 05 Jul 2009 20:39:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Alef Arendsen</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-129324</link>
		<dc:creator>Alef Arendsen</dc:creator>
		<pubDate>Sun, 16 Nov 2008 12:54:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-129324</guid>
		<description>Hi Jagadish,

the zip file has a Maven pom in it. Running 'mvc eclipse:eclipse' on the command line will create an Eclipse project for you. I won't have time anywhere in the coming weeks / months to create an Eclipse web app for you, so you'll have to that yourself.

cheers,
Alef</description>
		<content:encoded><![CDATA[<p>Hi Jagadish,</p>
<p>the zip file has a Maven pom in it. Running &#039;mvc eclipse:eclipse&#039; on the command line will create an Eclipse project for you. I won&#039;t have time anywhere in the coming weeks / months to create an Eclipse web app for you, so you&#039;ll have to that yourself.</p>
<p>cheers,<br />
Alef</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jagadish</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-129297</link>
		<dc:creator>jagadish</dc:creator>
		<pubDate>Sun, 16 Nov 2008 09:20:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-129297</guid>
		<description>Please try to send me an eclipse based spring web application.</description>
		<content:encoded><![CDATA[<p>Please try to send me an eclipse based spring web application.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SpringSource Team Blog &#187; Before a JDBC operation, flush the Hibernate Session (includes TSE example code)</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-84692</link>
		<dc:creator>SpringSource Team Blog &#187; Before a JDBC operation, flush the Hibernate Session (includes TSE example code)</dc:creator>
		<pubDate>Fri, 04 Jan 2008 11:17:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-84692</guid>
		<description>[...] Now that we have solved the problem, let&#39;s put this code into context. I&#39;ve previously used the CarPlant example to illustrate certain things and I will do this again now. The following sequence diagram shows the CarPartsInventory first inserting a part using the Hibernate Session, after which it is updating the stock using a Spring JdbcTemplate (using a straight JDBC connection underneath). All this runs inside one transaction. [...]</description>
		<content:encoded><![CDATA[<p>[...] Now that we have solved the problem, let&#39;s put this code into context. I&#39;ve previously used the CarPlant example to illustrate certain things and I will do this again now. The following sequence diagram shows the CarPartsInventory first inserting a part using the Hibernate Session, after which it is updating the stock using a Spring JdbcTemplate (using a straight JDBC connection underneath). All this runs inside one transaction. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stéphane Van Espen</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-46081</link>
		<dc:creator>Stéphane Van Espen</dc:creator>
		<pubDate>Thu, 06 Sep 2007 14:25:36 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-46081</guid>
		<description>Hello Alef,

Thank you very much for your quick response.

 After further thoughts, this is the Proxy-based approach that is annoying me. It makes Spring slightly more intrusive because I need it systematically to create new object instances and I have to implement ApplicationContextAware more often. Now, is it really annoying ? No, the added value of using Spring is certainly much greater...

I see two main drawbacks with the proxy-based approach:

How can I be sure I can use Spring every where ? In the case of JPA, I'm not sure I can...
The equals() contract is broken (a.equals(b) but !b.equals(a)). In a nutshell, the equals() method implemented by the advised object makes an unadvised object (with exactly the same values and same underlying class) different (in my example, 'a' is the unadvised object and 'b' is my advised object). In the case of the @NotNull, that's a pity.


As you suggest, using AspectJ and its bytecode-manipulation capabilities could solve that.
Ah, I feel you want to do a second @NotNull with this approach ;-)

Regards,
Stéphane.</description>
		<content:encoded><![CDATA[<p>Hello Alef,</p>
<p>Thank you very much for your quick response.</p>
<p> After further thoughts, this is the Proxy-based approach that is annoying me. It makes Spring slightly more intrusive because I need it systematically to create new object instances and I have to implement ApplicationContextAware more often. Now, is it really annoying ? No, the added value of using Spring is certainly much greater&#8230;</p>
<p>I see two main drawbacks with the proxy-based approach:</p>
<p>How can I be sure I can use Spring every where ? In the case of JPA, I&#039;m not sure I can&#8230;<br />
The equals() contract is broken (a.equals(b) but !b.equals(a)). In a nutshell, the equals() method implemented by the advised object makes an unadvised object (with exactly the same values and same underlying class) different (in my example, &#039;a&#039; is the unadvised object and &#039;b&#039; is my advised object). In the case of the @NotNull, that&#039;s a pity.</p>
<p>As you suggest, using AspectJ and its bytecode-manipulation capabilities could solve that.<br />
Ah, I feel you want to do a second @NotNull with this approach <img src='http://blog.springsource.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /><br />
Regards,<br />
Stéphane.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alef Arendsen</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-46051</link>
		<dc:creator>Alef Arendsen</dc:creator>
		<pubDate>Thu, 06 Sep 2007 12:50:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-46051</guid>
		<description>Hi Stéphane,

as for your first question, yes, you would have to use Spring. It's your own choice as to how negative a side effect you think that is. To my mind it's just as negative a side effect as having to use a JVM to run Java-based programs and just as negative a side effect as having to use Spring (or EJB3) for that matter to use @Transactional to demarcate your transactions. Again, it's up to you to decide what your feeling about this is, I won't force you ;-).

I don't fully understand the equals() issue. I don't consider this to be a big problem. Spring AOP is designed to apply behavior to services (DAOs, repositories, business services, et cetera) and I don't consider equals methods in those objects to be of real importance. You do have a point about the factory methods and domain objects and their respective equals methods. The recommended approach here would be to start using AspectJ, which removed any of the drawbacks that Advised (i.e. a proxy-based approach) has.

I hope this helps. Please don't hesitate to drop by again and ask for more clarification.

regards,
Alef</description>
		<content:encoded><![CDATA[<p>Hi Stéphane,</p>
<p>as for your first question, yes, you would have to use Spring. It&#039;s your own choice as to how negative a side effect you think that is. To my mind it&#039;s just as negative a side effect as having to use a JVM to run Java-based programs and just as negative a side effect as having to use Spring (or EJB3) for that matter to use @Transactional to demarcate your transactions. Again, it&#039;s up to you to decide what your feeling about this is, I won&#039;t force you ;-).</p>
<p>I don&#039;t fully understand the equals() issue. I don&#039;t consider this to be a big problem. Spring AOP is designed to apply behavior to services (DAOs, repositories, business services, et cetera) and I don&#039;t consider equals methods in those objects to be of real importance. You do have a point about the factory methods and domain objects and their respective equals methods. The recommended approach here would be to start using AspectJ, which removed any of the drawbacks that Advised (i.e. a proxy-based approach) has.</p>
<p>I hope this helps. Please don&#039;t hesitate to drop by again and ask for more clarification.</p>
<p>regards,<br />
Alef</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stéphane Van Espen</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-46009</link>
		<dc:creator>Stéphane Van Espen</dc:creator>
		<pubDate>Thu, 06 Sep 2007 10:31:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-46009</guid>
		<description>[quote post="137"]@NotNull argument checking - this is a simple aspect that I'm usually showing during training sessions. It uses a pointcut driven by annotations (which I think is a very neat way of driving your pointcuts) to check for null arguments passed to methods (so now you know what the title refers to ;-) )[/quote]

Using Annotations and AOP is a very interesting approach in order to extend the language. But  I have some troubles with this approach anyway:
* In this example, if I want to take advantage of this annotation, I HAVE to use Spring every time and everywhere I need to access my objects, because they need to be advised by Spring. If not, the @NotNull will be useless. 
* Another problem is that AOP breaks equals() method: myObject.equals(Advised(myObject)) will be true while Advised(myObject).equals(myObject) will be false. This is very annoying because, again, I have to guarantee that Spring will be used everywhere to create my objects.  But can I guarantee that ?
What if I use JPA/Hibernate in order to persist my data ? Mapping files demand a concrete class (thus, a non-advised)..unless I can define a factory method ?

Did I miss something ?

Thanks for your help !</description>
		<content:encoded><![CDATA[<p>[quote post="137"]@NotNull argument checking - this is a simple aspect that I&#039;m usually showing during training sessions. It uses a pointcut driven by annotations (which I think is a very neat way of driving your pointcuts) to check for null arguments passed to methods (so now you know what the title refers to <img src='http://blog.springsource.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> )[/quote]</p>
<p>Using Annotations and AOP is a very interesting approach in order to extend the language. But  I have some troubles with this approach anyway:<br />
* In this example, if I want to take advantage of this annotation, I HAVE to use Spring every time and everywhere I need to access my objects, because they need to be advised by Spring. If not, the @NotNull will be useless.<br />
* Another problem is that AOP breaks equals() method: myObject.equals(Advised(myObject)) will be true while Advised(myObject).equals(myObject) will be false. This is very annoying because, again, I have to guarantee that Spring will be used everywhere to create my objects.  But can I guarantee that ?<br />
What if I use JPA/Hibernate in order to persist my data ? Mapping files demand a concrete class (thus, a non-advised)..unless I can define a factory method ?</p>
<p>Did I miss something ?</p>
<p>Thanks for your help !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Technical Related Notes &#187; Blog Archive &#187; links for 2007-03-14</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-40400</link>
		<dc:creator>Technical Related Notes &#187; Blog Archive &#187; links for 2007-03-14</dc:creator>
		<pubDate>Sat, 18 Aug 2007 17:00:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-40400</guid>
		<description>[...] Interface21 Team Blog » CarPlant not accepting null CarModels (tags: springframework) [...]</description>
		<content:encoded><![CDATA[<p>[...] Interface21 Team Blog » CarPlant not accepting null CarModels (tags: springframework) [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alef Arendsen</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-15733</link>
		<dc:creator>Alef Arendsen</dc:creator>
		<pubDate>Wed, 14 Mar 2007 23:02:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-15733</guid>
		<description>Thanks Chris, that's good to hear.

Yes, this convention is something I didn't know about either until a few months ago when Ben Alex pointed it out to me.

glad you liked it.

cheers,
Alef</description>
		<content:encoded><![CDATA[<p>Thanks Chris, that&#039;s good to hear.</p>
<p>Yes, this convention is something I didn&#039;t know about either until a few months ago when Ben Alex pointed it out to me.</p>
<p>glad you liked it.</p>
<p>cheers,<br />
Alef</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris Smith</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-15731</link>
		<dc:creator>Chris Smith</dc:creator>
		<pubDate>Wed, 14 Mar 2007 22:38:21 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-15731</guid>
		<description>Thanks, Alef, I learned a couple of neat things from this example, for example the convention for locating custom PropertyEditors.</description>
		<content:encoded><![CDATA[<p>Thanks, Alef, I learned a couple of neat things from this example, for example the convention for locating custom PropertyEditors.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alef Arendsen</title>
		<link>http://blog.springsource.com/2007/03/12/carplant-not-accepting-null-carmodels/comment-page-1/#comment-15514</link>
		<dc:creator>Alef Arendsen</dc:creator>
		<pubDate>Mon, 12 Mar 2007 13:13:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.interface21.com/main/2007/03/12/carplant-not-accepting-null-carmodels/#comment-15514</guid>
		<description>Ah, sorry about that. I've just fixed it. You should be able to download this now.</description>
		<content:encoded><![CDATA[<p>Ah, sorry about that. I&#039;ve just fixed it. You should be able to download this now.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
