<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>spiros.blog() &#187; aop</title>
	<atom:link href="http://www.tzavellas.com/techblog/tag/aop/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tzavellas.com/techblog</link>
	<description>Spiros Tzavellas’s blog, mostly on software development and Java.</description>
	<lastBuildDate>Fri, 24 Sep 2010 07:42:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Testing Spring AOP code</title>
		<link>http://www.tzavellas.com/techblog/2006/02/23/testing-spring-aop-code/</link>
		<comments>http://www.tzavellas.com/techblog/2006/02/23/testing-spring-aop-code/#comments</comments>
		<pubDate>Thu, 23 Feb 2006 05:45:26 +0000</pubDate>
		<dc:creator>spiros</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[aop]]></category>
		<category><![CDATA[spring framework]]></category>

		<guid isPermaLink="false">http://www.tzavellas.com/techblog/?p=50</guid>
		<description><![CDATA[In Using the Spring AOP Framework with EJB Components, Eugene Kuleshov presents a really nice way to test Spring AOP configuration code and advices. When you use Spring AOP use can easily test your target objects with unit tests, but how do you test the weaved code? In the above article Eugene Kuleshov uses unit [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://dev2dev.bea.com/pub/a/2005/12/spring-aop-with-ejb.html">Using the Spring AOP Framework with EJB Components</a>, <a href="http://jroller.com/page/eu">Eugene Kuleshov</a> presents a really nice way to test Spring AOP configuration code and advices. When you use Spring AOP use can easily test your target objects with unit tests, but how do you test the weaved code?</p>
<p>In the above article <a href="http://jroller.com/page/eu">Eugene Kuleshov</a> uses unit tests that reference the Spring <a href="http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/context/ApplicationContext.html">ApplicationContext</a> that has the AOP configuration code. Then at the setup method of the TestCase class he registers a custom <a href="http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/beans/factory/config/BeanPostProcessor.html">BeanPostProcessor</a> that provides mock implementations for the target objects. At the test methods he trains the mock objects and tests the all the AOP code except the target objects.</p>
<p>I really liked the trick with the custom <a href="http://static.springframework.org/spring/docs/1.2.x/api/org/springframework/beans/factory/config/BeanPostProcessor.html">BeanPostProcessor</a> to provide the mock objects. I&#8217;ll probably start using this trick in my tests really soon.</p>
<p>BTW <a href="http://dev2dev.bea.com/pub/a/2005/12/spring-aop-with-ejb.html">Using the Spring AOP Framework with EJB Components</a> also provides lots of information on how to effectively use <a href="http://springframework.org/">Spring</a> in a EJB 2.x environment. If you are maintaining EJB 2.x applications and you want to make your applications more testable over time you should probably read this article.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tzavellas.com/techblog/2006/02/23/testing-spring-aop-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AOP and legacy code</title>
		<link>http://www.tzavellas.com/techblog/2005/04/05/10/</link>
		<comments>http://www.tzavellas.com/techblog/2005/04/05/10/#comments</comments>
		<pubDate>Tue, 05 Apr 2005 02:04:51 +0000</pubDate>
		<dc:creator>spiros</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[aop]]></category>

		<guid isPermaLink="false">http://www.tzavellas.com/techblog/?p=10</guid>
		<description><![CDATA[AOP is great when you want to enhance an application but you do not want to modify its source code. This restriction may come for maintainability reasons. A good example of this can be found in the article “Using Aspects to autonomic-enable legacy applications” by Brian Temple published at developerWorks. Quote from the article&#8217;s intro: [...]]]></description>
			<content:encoded><![CDATA[<p><acronym title="Aspect Oriented Programming">AOP</acronym> is great when you want to enhance an application but you do not want to modify its source code. This restriction may come for maintainability reasons.</p>
<p>A good example of this can be found in the article <a href="http://www-128.ibm.com/developerworks/autonomic/library/ac-aspects/">“Using Aspects to autonomic-enable legacy applications”</a> by <a href="http://www-128.ibm.com/developerworks/autonomic/library/ac-aspects/#author1">Brian Temple</a> published at <a href="http://www-136.ibm.com/developerworks/">developerWorks</a>.</p>
<p>Quote from the article&#8217;s intro:</p>
<blockquote><p>
Learn how to use Aspects to generate Common Base Events in any legacy Java application, without modifying the original application source. This article shows you how and also provides an example framework that can be used with your applications today.
</p></blockquote>
<p>To apply AOP of course you have to have access to the source code, but you do not necessary need to change it. AOP is a meta-programming system that adds functionality (advices) to certain points in the flow of execution (joinpoints) of the application. To match those points you have to refer to code constructs like method invocations, access to a package, throwing of an exception, etc so you need to know the names of methods, packages, exceptions, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tzavellas.com/techblog/2005/04/05/10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

