<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<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/"
	>

<channel>
	<title>aop &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/aop/</link>
	<description>Feed of posts on WordPress.com tagged "aop"</description>
	<pubDate>Sat, 28 Nov 2009 18:50:48 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[JUnit test Struts applications with mock objects and Maven]]></title>
<link>http://rfscholte.wordpress.com/2009/11/28/junit-test-struts-applications-with-mock-objects-and-maven/</link>
<pubDate>Sat, 28 Nov 2009 15:53:18 +0000</pubDate>
<dc:creator>rfscholte</dc:creator>
<guid>http://rfscholte.wordpress.com/2009/11/28/junit-test-struts-applications-with-mock-objects-and-maven/</guid>
<description><![CDATA[Let me start by giving credits to Walter Jia who wrote the article Unit test Struts applications wit]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Let me start by giving credits to Walter Jia who wrote the article <a href="http://www.javaworld.com/javaworld/jw-11-2006/jw-1109-test.html">Unit test Struts applications with mock objects and AOP</a>. This was a great article which pushed me in the right direction. I wanted to use Maven instead of Ant, which meant I had to configure a pom.xml. There are a few details which you need to know to migrate to Maven. I wanted to stay close to the original example, so I didn&#8217;t upgrade EasyMock and JUnit yet.</p>
<h2>Project layout</h2>
<p>Below is the project structure based on the <a href="http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html">standard directory layout</a> described by Maven. The aspect-folder is defined by the <a href="http://mojo.codehaus.org/aspectj-maven-plugin/xref/org/codehaus/mojo/aspectj/AbstractAjcCompiler.html#51">aspectj-maven-plugin</a>. You could put the .aj-file inside the src/test/java, but this way you keep the files in their own folder.<br />
The org.acme.StrutsActionPreExecuteListener is a helperfile, but it&#8217;s java so I&#8217;ve put it in the src/test/java folder.</p>
<blockquote>
<ul>
<li>StrutsTest2
<ul>
<li>src/main/java
<ul>
<li>com.foo.bar.ActionService</li>
<li>com.foo.bar.SimpleAction</li>
</ul>
</li>
<li>src/main/webapp
<ul>
<li>WEB-INF
<ul>
<li>struts-config.xml</li>
<li>web.xml</li>
</ul>
</li>
</ul>
</li>
<li>src/test/aspect
<ul>
<li>org/acme/StrutsActionPreExecuteNotifier.aj</li>
</ul>
</li>
<li>src/test/java
<ul>
<li>com.foo.bar.SimpleActionTest</li>
<li>org.acme.StrutsActionPreExecuteListener</li>
</ul>
</li>
<li>pom.xml</li>
</ul>
</li>
</ul>
</blockquote>
<h2>The Pom.xml</h2>
<p>I hope you&#8217;ll all understand the dependency-section, so I&#8217;ll just focus on the build-section.<br />
First of all, the MockStrutsTestcase expects a WEB-INF/web.xml and a WEB-INF/struts-config.xml on the classpath. I want to make use of the files which will be deployed with the war as well. So I&#8217;ve defined these two files as testResources. If you want to use a specific test-version, you have to make these files inside src/test/resources/WEB-INF and they&#8217;ll be picked by Maven by default.</p>
<p>&#60;testResources&#62;<br />
    &#60;testResource&#62;<br />
        &#60;directory&#62;src/main/webapp&#60;/directory&#62;<br />
        &#60;includes&#62;<br />
            &#60;include&#62;WEB-INF/*.xml&#60;/include&#62;<br />
        &#60;/includes&#62;<br />
    &#60;/testResource&#62;<br />
&#60;/testResources&#62;</p>
<p>I already mentioned the aspectj-maven-plugin, which we need to include as well. It&#8217;s pretty straight-forward. Include the plugin and add an execution-section. Defining the plugin goals (in our case only test-compile) is enough. This goal is bound to the process-test-sources phase of Maven, so there&#8217;s no need to specify a phase inside the exection-section.</p>
<p>&#60;plugin&#62;<br />
 &#60;groupId&#62;org.codehaus.mojo&#60;/groupId&#62;<br />
 &#60;artifactId&#62;aspectj-maven-plugin&#60;/artifactId&#62;<br />
 &#60;version&#62;1.2&#60;/version&#62;<br />
 &#60;executions&#62;<br />
  &#60;execution&#62;<br />
   &#60;goals&#62;<br />
    &#60;goal&#62;test-compile&#60;/goal&#62;<br />
   &#60;/goals&#62;<br />
  &#60;/execution&#62;<br />
 &#60;/executions&#62;<br />
&#60;/plugin&#62;</p>
<p>It looks like we&#8217;re done. But if we run the tests, both tests will fail because of a NullPointerException. The service isn&#8217;t injected, which means the preActionExecuteOccured method isn&#8217;t called.<br />
So here&#8217;s the pitfall. It&#8217;s not (only) the test class which has to be compiled with AspectJ, especially the Action class needs to be compiled like this as well, but only for testing! So we have to tell Maven to use these files too. This is done by configuring the aspectj-maven-plugin.<br />
Add to the execution-section the following lines:</p>
<p>&#60;configuration&#62;<br />
  &#60;weaveMainSourceFolder&#62;true&#60;/weaveMainSourceFolder&#62;<br />
&#60;/configuration&#62;</p>
<p>This way the Action is added to the test classes and will be compiled by the aspectj-maven-plugin. Note that this Action is <strong>not</strong> the one that will be packaged, since Maven uses seperate folders for main classes and test classes.<br />
You might want to finetune this, because now <strong>all</strong> (re)source files on the main path will be added to the test classpath, so some fileoverwriting might occur.</p>
<p>The complete build-section will look like this:</p>
<p>&#60;build&#62;<br />
  &#60;testResources&#62;<br />
    &#60;testResource&#62;<br />
      &#60;directory&#62;src/main/webapp&#60;/directory&#62;<br />
      &#60;includes&#62;<br />
        &#60;include&#62;WEB-INF/*.xml&#60;/include&#62;<br />
      &#60;/includes&#62;<br />
    &#60;/testResource&#62;<br />
  &#60;/testResources&#62;<br />
 &#60;plugins&#62;<br />
  &#60;plugin&#62;<br />
   &#60;groupId&#62;org.codehaus.mojo&#60;/groupId&#62;<br />
   &#60;artifactId&#62;aspectj-maven-plugin&#60;/artifactId&#62;<br />
   &#60;version&#62;1.2&#60;/version&#62;<br />
   &#60;executions&#62;<br />
    &#60;execution&#62;<br />
     &#60;goals&#62;<br />
      &#60;goal&#62;test-compile&#60;/goal&#62;  &#60;!&#8211; use this goal to weave all your test classes &#8211;&#62;<br />
     &#60;/goals&#62;<br />
     &#60;configuration&#62;<br />
       &#60;weaveMainSourceFolder&#62;true&#60;/weaveMainSourceFolder&#62;<br />
     &#60;/configuration&#62;<br />
    &#60;/execution&#62;<br />
   &#60;/executions&#62;<br />
  &#60;/plugin&#62;<br />
 &#60;/plugins&#62;<br />
&#60;/build&#62;</p>
<p>The <a href="https://www.box.net/shared/9zy3514dyc">Strutstest2.zip</a> can be downloaded from <a href="http://box.net">Box.net</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Aspect Oriented Programming dengan Spring AspectJ Part I]]></title>
<link>http://krissadewo.wordpress.com/2009/11/27/aspect-oriented-programming-dengan-spring-aspectj-part-i/</link>
<pubDate>Fri, 27 Nov 2009 05:36:16 +0000</pubDate>
<dc:creator>krissadewo</dc:creator>
<guid>http://krissadewo.wordpress.com/2009/11/27/aspect-oriented-programming-dengan-spring-aspectj-part-i/</guid>
<description><![CDATA[Dalam artikel terdahulu saya telah memberikan beberapa contoh penggunaan metodologi AOP dengan mengg]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;">Dalam artikel terdahulu saya telah memberikan beberapa contoh penggunaan metodologi AOP dengan menggunakan beberapa cara, salah satunya dengan menggunakan spring classic aop. Dengan menggunakan spring classic aop kita harus membuat proxy dengan mendefinisikan secara eksplisit kebutuhan akan kelas kelas untuk membuat proxy tersebut. Nah, dengan Spring AspectJ kita dapat dengan mudah mendefinisikan agar melakukan scanning terhadap kelas-kelas yang dianggap sebagai sebuah aspek dan membuatkan proxy untuk masing-masing kelas tersebut.<br />
Sebuah kelas aspek dapat ditandai dengan sebuah anotasi @Aspect. <!--more-->Sebuah kelas aspek juga dapat ditandai dengan melakukan injeksi secara langsung didalam sebuah container. Untuk mengimplementasikan automatic proxy maka kita dapat mendefinisikan sebuah element xml seperti berikut :</p>
<pre class="brush: plain;">
 &#60;aop:aspectj-autoproxy/&#62;
</pre>
<p style="text-align:justify;">Berdasarkan contoh sebelumnya mari kita langsung saja ke listing berikut :<br />
Kita buat sebuah interface Kalkulator :</p>
<pre class="brush: plain;">
public interface Kalkulator {

    public double kali(double x, double y);

    public double bagi(double x, double y);
}
</pre>
<p>Kemudian lakukan implementasi dari interface tersebut :</p>
<pre class="brush: plain;">
public class KalkulatorImpl implements Kalkulator {

    public double bagi(double x, double y) {
        if (y == 0) {
            throw new IllegalArgumentException(&#34;Pembagi tidak boleh 0&#34;);
        }
        double hasil = x / y;
        return hasil;

    }

    public double kali(double x, double y) {
        double hasil = x * y;
        return hasil;
    }
}
</pre>
<p style="text-align:justify;">Setelah itu kita buatkan sebuah kelas aspek untuk mengatur log yang terjadi :</p>
<pre class="brush: plain;">
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

/**
 *
 * @author kris
 */
@Aspect
public class KalkulatorAspect {

    private Log log = LogFactory.getLog(this.getClass());

    @Before(&#34;execution(* *.*(..))&#34;)
    public void runBefore(JoinPoint joinPoint) {
        log.info(&#34;Method &#34; + joinPoint.getSignature().getName() + &#34; () telah dijalankan&#34;);
    }

    @AfterReturning(pointcut = &#34;execution(* *.*(..))&#34;, returning = &#34;result&#34;)
    public void runAfterReturning(JoinPoint joinPoint, Object result) {
        log.info(&#34;Method &#34; + joinPoint.getSignature().getName() + &#34; () telah dijalankan dengan hasil : &#34; + result);
    }

    @AfterThrowing(pointcut = &#34;execution(* *.*(..))&#34;, throwing = &#34;e&#34;)
    public void runAfterThrowing(JoinPoint joinPoint, Throwable e) {
        log.info(&#34;Terjadi error &#34; + e + &#34; didalam method &#34; + joinPoint.getSignature().getName());
    }
}
</pre>
<p style="text-align:justify;">Jika melihat kode diatas maka ada beberapa advice yang digunakan. @Before,@AfterReturning,@AfterThrowing. Seperti dalam artikel yang lalu, advice Before akan dijalankan sebelum target method dieksekusi, advice AfterReturning akan dijalankan setelah target method dieksekusi. Advice AfterThrowing akan dieksekusi jika terjadi kesalahan dalam target method tersebut. Mungkin kita juga menemukan beberapa istilah baru didalam listing diatas, antara lain adalah JoinPoint.<br />
JoinPoint dapat diartikan sebagai sebuah execution point yang tepat didalam sebuah pointcut. Lalu, apa itu poincut ? Poincut dapat diartikan sebagai sebuah penunjuk untuk mengarahkan advice tertentu kedalam execution points agar menujuk pada target kelas dan target method tertentu. Jadi poincut dapat berupa wildcard(*) sebagai penunjuk modifier, return type, paket dan nama kelas tertentu. Seperti halnya wildcard yang lain yang berarti apa saja, hal ini juga berlaku pada poincut yang biasa disebut juga denga reguler expression.<br />
Kemudian kita perlu mendaftarkan kelas-kelas yang terlibat didalam container :</p>
<pre class="brush: plain;">
&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;
&#60;beans xmlns=&#34;http://www.springframework.org/schema/beans&#34;
       xmlns:xsi=&#34;http://www.w3.org/2001/XMLSchema-instance&#34;
       xmlns:aop=&#34;http://www.springframework.org/schema/aop&#34;
       xsi:schemaLocation=&#34;http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd&#34;&#62;

    &#60;aop:aspectj-autoproxy/&#62;

    &#60;bean id=&#34;kalkulator&#34; class=&#34;org.kris.aspectj.basic.KalkulatorImpl&#34;/&#62;

    &#60;bean class=&#34;org.kris.aspectj.basic.KalkulatorAspect&#34;/&#62;

&#60;/beans&#62;
</pre>
<p>Setelah itu kita dapat membuatkan kelas utamanya sebagai berikut :</p>
<pre class="brush: plain;">
public class MainClass {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext(&#34;org/kris/aspectj/basic/container.xml&#34;);
        Kalkulator kalkulator = (Kalkulator) context.getBean(&#34;kalkulator&#34;);
        kalkulator.kali(2, 2);
        kalkulator.bagi(2, 0);
    }
}
</pre>
<p>Hasilnya :</p>
<pre class="brush: plain;">
….
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@39b8d6f7: defining beans [org.kris.aspectj.basic.KalkulatorAspect#0,kalkulator,org.springframework.aop.config.internalAutoProxyCreator]; root of factory hierarchy
Nov 27, 2009 12:18:58 PM org.kris.aspectj.basic.KalkulatorAspect runBefore
INFO: Method kali () telah dijalankan
Nov 27, 2009 12:18:58 PM org.kris.aspectj.basic.KalkulatorAspect runAfterReturning
INFO: Method kali () telah dijalankan dengan hasil : 4.0
Nov 27, 2009 12:18:58 PM org.kris.aspectj.basic.KalkulatorAspect runBefore
INFO: Method bagi () telah dijalankan
Nov 27, 2009 12:18:58 PM org.kris.aspectj.basic.KalkulatorAspect runAfterThrowing
INFO: Terjadi error java.lang.IllegalArgumentException: Pembagi tidak boleh 0 didalam method bagi
Exception in thread &#34;main&#34; java.lang.IllegalArgumentException: Pembagi tidak boleh 0
        at org.kris.aspectj.basic.KalkulatorImpl.bagi(KalkulatorImpl.java:18)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
….
</pre>
<p style="text-align:justify;">Dari hasil diatas kita dapat melihat urutan advice yang akan dijalankan dan result yang dihasilkan. Pada artikel selanjutnya saya akan mengupas lebih jauh penggunaan aspectj didalam spring. Ditunggu ya&#8230;&#8230;.  <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Cantal]]></title>
<link>http://ostbloggen.wordpress.com/2009/11/25/cantal/</link>
<pubDate>Wed, 25 Nov 2009 10:32:49 +0000</pubDate>
<dc:creator>Daddy-T</dc:creator>
<guid>http://ostbloggen.wordpress.com/2009/11/25/cantal/</guid>
<description><![CDATA[Cantal är en av de äldsta franska ostarna med en historia som sträcker sig 2000 år tillbaka. Dagens ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="http://ostbloggen.wordpress.com/files/2009/11/cantal.jpg"><img class="aligncenter size-full wp-image-907" title="Cantal" src="http://ostbloggen.wordpress.com/files/2009/11/cantal.jpg" alt="" width="450" height="300" /></a></p>
<p>Cantal är en av de äldsta franska ostarna med en historia som sträcker sig 2000 år tillbaka. Dagens Cantal tillverkas av både rå eller pastöriserad komjölk och fick sin AOC 1956. Sedans dess har AOCn ändrats ett antal gånger, senast 2007, och numera även AOP. Detta innebär att det idag finns lite olika namn på osten beroende på lagringstid.</p>
<ul>
<li>Cantal jeune <em>(ung)</em>, lagrad 1-2 månader</li>
<li>Cantal entre-deux <em>(mellan de två)</em>, lagrad2-6 månader</li>
<li>Cantal vieux <em>(gammal)</em>, lagrad mer än 6 månader</li>
</ul>
<p>Dessutom kan den kallas Fourme de Cantal. Osten som hör hemma i familjen pressade ostar och korna som ger mjölken vandrar omkring i Centralmasssivet på mellan 700 och 1000 meters höjd. Centralmassivet ligger som kanske hörs på namnet i mellersta och södra Frankrike. Cantal tillverkas i form av cylindrar med en diameter på 36-42 cm och höjden 25-40 cm, vikten kan variera mellan 35-45 kg. Osten har en lite salt smak och som ung är den väldigt mild för att i sinmest lagrade variant ibland vara rejält stark och stickig i smaken. Själv föredrar jag mellanvarianten som är den som syns på bilden.</p>
<p>Det kan vara fatalt att glömma sin Cantal är temat på en serie reklamfilmer som sänds på fransk tv. <em>«Chantal t’as pas oublié le Cantal?» </em>är titeln på filmerna och det är alltid Chantal som glömt att ta med sig Cantal. Nedanstående film finns i två versioner, förutom den jag lagt in även en med ett snällare avslut. Denna kanske är lite för brutal.</p>
<p><span style='text-align:center; display: block;'><object width='425' height='350'><param name='movie' value='http://www.youtube.com/v/TfX0HNMCjg0&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' /><param name='allowfullscreen' value='true' /><param name='wmode' value='transparent' /><embed src='http://www.youtube.com/v/TfX0HNMCjg0&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;hd=0' type='application/x-shockwave-flash' allowfullscreen='true' width='425' height='350' wmode='transparent'></embed></object></span></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Why Spring Framework?]]></title>
<link>http://tecnoesis.wordpress.com/2009/11/21/why-spring-framework/</link>
<pubDate>Sat, 21 Nov 2009 07:43:00 +0000</pubDate>
<dc:creator>Rajani Ramsagar</dc:creator>
<guid>http://tecnoesis.wordpress.com/2009/11/21/why-spring-framework/</guid>
<description><![CDATA[    Why Spring Framework?   Since the widespread implementation of J2EE applications in 1999/2000, i]]></description>
<content:encoded><![CDATA[    Why Spring Framework?   Since the widespread implementation of J2EE applications in 1999/2000, i]]></content:encoded>
</item>
<item>
<title><![CDATA[Spring Framework Introduction]]></title>
<link>http://tecnoesis.wordpress.com/2009/11/20/introduction-to-spring/</link>
<pubDate>Thu, 19 Nov 2009 19:21:03 +0000</pubDate>
<dc:creator>Rajani Ramsagar</dc:creator>
<guid>http://tecnoesis.wordpress.com/2009/11/20/introduction-to-spring/</guid>
<description><![CDATA[  Chapter 2: Introduction to Spring   Spring Framework: The Spring framework is a comprehensive laye]]></description>
<content:encoded><![CDATA[  Chapter 2: Introduction to Spring   Spring Framework: The Spring framework is a comprehensive laye]]></content:encoded>
</item>
<item>
<title><![CDATA[Bodohnya Diriku - AOP Band]]></title>
<link>http://embun777.wordpress.com/2009/11/17/bodohnya-diriku-aop-band/</link>
<pubDate>Tue, 17 Nov 2009 17:15:38 +0000</pubDate>
<dc:creator>embun777</dc:creator>
<guid>http://embun777.wordpress.com/2009/11/17/bodohnya-diriku-aop-band/</guid>
<description><![CDATA[Ada ada aja : EKSTASI RASA SEMEN PUTIH Dengan bahan utama berupa semen putih dan tepung kanji, Darma]]></description>
<content:encoded><![CDATA[Ada ada aja : EKSTASI RASA SEMEN PUTIH Dengan bahan utama berupa semen putih dan tepung kanji, Darma]]></content:encoded>
</item>
<item>
<title><![CDATA[Как подружить ASP.NET Controls и DI-контейнер]]></title>
<link>http://butaji.wordpress.com/2009/11/16/%d0%ba%d0%b0%d0%ba-%d0%bf%d0%be%d0%b4%d1%80%d1%83%d0%b6%d0%b8%d1%82%d1%8c-asp-net-controls-%d0%b8-di-%d0%ba%d0%be%d0%bd%d1%82%d0%b5%d0%b9%d0%bd%d0%b5%d1%80/</link>
<pubDate>Mon, 16 Nov 2009 06:58:18 +0000</pubDate>
<dc:creator>butaji</dc:creator>
<guid>http://butaji.wordpress.com/2009/11/16/%d0%ba%d0%b0%d0%ba-%d0%bf%d0%be%d0%b4%d1%80%d1%83%d0%b6%d0%b8%d1%82%d1%8c-asp-net-controls-%d0%b8-di-%d0%ba%d0%be%d0%bd%d1%82%d0%b5%d0%b9%d0%bd%d0%b5%d1%80/</guid>
<description><![CDATA[Интро В последнее время решил немного освежить свои знания в ASP.NET, в связи с чем углубился в проц]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h4>Интро</h4>
<p>В последнее время решил немного освежить свои знания в ASP.NET, в связи с чем углубился в процессы генерации кода контролов по разметке (*.ascx, *.aspx) и обнаружил что можно делать очень интересные решения, о которых&#160; о хочу поведать. Итак сегодня мы узнаем, как подружить наш Dependency Injection контейнер с генерируемым контролами кодом.</p>
<h4>Поехали</h4>
<p><a href="http://butaji.files.wordpress.com/2009/11/dependencyinjection_solution1.gif"><img style="display:inline;margin-left:0;margin-right:0;border-width:0;" title="DependencyInjection_Solution[1]" border="0" alt="DependencyInjection_Solution[1]" align="right" src="http://butaji.files.wordpress.com/2009/11/dependencyinjection_solution1_thumb.gif?w=244&#038;h=136" width="244" height="136" /></a> </p>
<p>В качестве DI-контейнера будет выступать <a href="http://www.codeplex.com/unity/">Microsoft Unity</a>, но это не принципиально, всё что будет касаться DI не зависит от используемого контейнера.</p>
<p>Проблема состоит в следующем – есть некоторый ASP.NET Control, в который мы хотим внедрит зависимости, а так же воспользоваться услугами Service Locator’а для управления интересующими нас зависимостями.</p>
<p>В Microsoft Unity есть некоторые средства для того, чтобы сделать это не прилагая особенных усилий: мы можем произвести инъекцию в свойство элемента управления, нас интересующее примерно следующим образом:</p>
<ol>
<li>Отметить атрибутом Dependency необходимое свойство
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:78bff771-7f66-4569-8222-dc362ddd8152" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>class</b></font>&#160;<font color="#0000FF">MyControl</font>&#160;:&#160;UserControl<br />
<font color="#AA22FF"><b>{</b></font><br />
<font color="#BB4444">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;[Dependency]</font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;MyPresenter&#160;Presenter<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>get</b></font>&#160;<font color="#AA22FF"><b>{</b></font>&#160;<font color="#AA22FF"><b>return</b></font>&#160;_presenter;&#160;<font color="#AA22FF"><b>}</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>set</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;_presenter&#160;=&#160;<font color="#AA22FF"><b>value</b></font>;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;_presenter.View&#160;=&#160;<font color="#AA22FF"><b>this</b></font>;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font><br />
<font color="#AA22FF"><b>}</b></font>
</div>
</div>
</li>
<li>
<p>Проинициализировать элемент управления можно следующим образом</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:6c6f0d5b-933b-41e2-bc16-d864c19e9be0" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
<font color="#AA22FF"><b>protected</b></font>&#160;<font color="#AA22FF"><b>override</b></font>&#160;<font color="#AA22FF"><b>void</b></font>&#160;<font color="#00A000">OnInit</font>(EventArgs&#160;e)<br />
<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>base</b></font>.OnInit(e);<br />
&#160;&#160;&#160;&#160;_сontainer.BuildUp(GetType(),&#160;<font color="#AA22FF"><b>this</b></font>);<br />
<font color="#AA22FF"><b>}</b></font>&#160;
</div>
</div>
</li>
<li>
<p>Позаботиться о местоположении контейнера в вашем приложении, я предлагаю использовать для этого <a href="http://github.com/butaji/Sapphire/blob/master/trunk/Sapphire.Application/Application.cs">HttpApplication</a>, унаследовавшись от которого и произведя небольшие модификации файла <a href="http://github.com/butaji/Sapphire/blob/master/trunk/Sapphire.Application/global.asax">global.asax</a> мы получаем необходимое нам хранилище для контейнера, обращаться с ним необходимо примерно следующим образом</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:cc7df713-8f54-4130-83ef-7972154d3b36" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
((Sapphire.Application)HttpContext.Current.ApplicationInstance).Container
</div>
</div>
</li>
</ol>
<p>Решение вполне пригодное, однако пуристические воззрения не дают оставить решение на данной стадии, и думаю, что просто необходимо заменить инъекцию свойства на инъекцию в конструктор, тем более подобный подход – это далеко не то, что мы можем выжать из Unity.</p>
<p>Т.е. наш интерес состоит в том, чтобы класс MyUserControl выглядел примерно так (думаю сборщику страницы это не совсем понравится)</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:ccd9ee48-feee-49f0-b31d-ca9b07854fcc" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>class</b></font>&#160;<font color="#0000FF">MyControl</font>&#160;:&#160;UserControl<br />
<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#00A000">MyControl</font>(MyPresenter&#160;presenter)<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;_presenter&#160;=&#160;presenter;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;_presenter.View&#160;=&#160;<font color="#AA22FF"><b>this</b></font>;<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font><br />
<font color="#AA22FF"><b>}</b></font>
</div>
</div>
<p>Предлагаю этим и заняться. Начнём с того, что у элементов управления, описанных в разметке страницы, при генерации страницы указываются их конструкторы без параметров, интересно, как можно управлять данным процессом, первоначально, покопавшись в web.config я предполагал сделать это через: </p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:3a7af6de-6c18-4e7e-b637-38d1e616e95a" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
<font color="#008000"><b>&#60;buildProviders&#62;</b></font><br />
&#160;&#160;&#160;&#160;<font color="#008000"><b>&#60;add</b></font>&#160;<font color="#BB4444">extension=</font><font color="#BB4444">&#8220;.aspx&#8221;</font>&#160;<font color="#BB4444">type=</font><font color="#BB4444">&#8220;System.Web.Compilation.PageBuildProvider&#8221;</font><font color="#008000"><b>/&#62;</b></font><br />
&#160;&#160;&#160;&#160;<font color="#008000"><b>&#60;add</b></font>&#160;<font color="#BB4444">extension=</font><font color="#BB4444">&#8220;.ascx&#8221;</font>&#160;<font color="#BB4444">type=</font><font color="#BB4444">&#8220;System.Web.Compilation.UserControlBuildProvider&#8221;</font><font color="#008000"><b>/&#62;</b></font><br />
&#160;&#160;&#160;&#160;&#8230;<br />
<font color="#008000"><b>&#60;/buildProviders&#62;</b></font>
</div>
</div>
<p>Однако реализация своего PageBuildProvider’а – довольно серьезное занятие, думаю отложить это для серьезной на то необходимости. Однако благодаря BuildProvider’ам можно генерить к примеру слой доступа к данным, для этого надо:</p>
<p>Написать и зарегестрировать обработчик для какого-нибудь своего расширения, к примеру *.dal и сделать что-нибудь наподобее <a href="http://www.codeproject.com/KB/aspnet/DALComp.aspx">http://www.codeproject.com/KB/aspnet/DALComp.aspx</a></p>
<p>кстати подобная логика реализована в SubSonic <a href="http://dotnetslackers.com/articles/aspnet/IntroductionToSubSonic.aspx">http://dotnetslackers.com/articles/aspnet/IntroductionToSubSonic.aspx</a></p>
<p>так же интересная реализация наследования страницы от generic типов <a title="http://stackoverflow.com/questions/1480373/generic-inhertied-viewpage-and-new-property" href="http://stackoverflow.com/questions/1480373/generic-inhertied-viewpage-and-new-property">http://stackoverflow.com/questions/1480373/generic-inhertied-viewpage-and-new-property</a></p>
<p>ещё можно, к примеру генерировать исключения, объекты передачи данных и многое другое, ограничением является лишь ваша фантазия.</p>
<p>Вообщем, данный вариант нам не подходит, необходимо сделать что-нибудь проще, и есть отличное решение, с помощью атрибута ControlBuilder мы можем указать свою логику сборки элемента управления из разметки, это будет выглядеть примерно так</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:67858728-23e4-49d7-8872-1090741c3a32" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
<font color="#BB4444">[ControlBuilder(typeof(MyControlBuilder))]</font><br />
<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>class</b></font>&#160;<font color="#0000FF">UserControl</font>&#160;:&#160;System.Web.UI.UserControl<br />
<font color="#AA22FF"><b>{</b></font><br />
<font color="#AA22FF"><b>}</b></font>
</div>
</div>
<p>Теперь разберемся с реализацией&#160; MyControlBuilder, этот тип должен наследовать от ControlBuilder и с помощью перегрузки ProcessGeneratedCode мы с вами сможем указать сборщику на необходимость использования нашего кода вместо вызова конструктора без атрибутов элемента управления:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:201bf84e-336c-4c96-8c41-ba2375b0820a" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>override</b></font>&#160;<font color="#AA22FF"><b>void</b></font>&#160;<font color="#00A000">ProcessGeneratedCode</font>(CodeCompileUnit&#160;codeCompileUnit,<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;CodeTypeDeclaration&#160;baseType,<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;CodeTypeDeclaration&#160;derivedType,<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;CodeMemberMethod&#160;buildMethod,<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;CodeMemberMethod&#160;dataBindingMethod)<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;codeCompileUnit.Namespaces[<font color="#666666">0</font>].Imports.Add(<font color="#AA22FF"><b>new</b></font>&#160;CodeNamespaceImport(<font color="#BB4444">&#8220;Sapphire.Web.UI&#8221;</font>));<br />
&#160;&#160;&#160;&#160;&#160;&#160;ReplaceConstructorWithContainerResolveMethod(buildMethod);<br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>base</b></font>.ProcessGeneratedCode(codeCompileUnit,&#160;baseType,&#160;derivedType,&#160;buildMethod,&#160;dataBindingMethod);<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font>
</div>
</div>
<p>самое интересно скрывает метод ReplaceConstructorWithContainerResolveMethod </p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:742b123c-c0b8-48de-9e0f-0e0914be7bc5" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>private</b></font>&#160;<font color="#AA22FF"><b>void</b></font>&#160;<font color="#00A000">ReplaceConstructorWithContainerResolveMethod</font>(CodeMemberMethod&#160;buildMethod)<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>foreach</b></font>&#160;(CodeStatement&#160;statement&#160;<font color="#AA22FF"><b>in</b></font>&#160;buildMethod.Statements)<br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;assign&#160;=&#160;statement&#160;<font color="#AA22FF"><b>as</b></font>&#160;CodeAssignStatement;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>if</b></font>&#160;(<font color="#AA22FF"><b>null</b></font>&#160;!=&#160;assign)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;var&#160;constructor&#160;=&#160;assign.Right&#160;<font color="#AA22FF"><b>as</b></font>&#160;CodeObjectCreateExpression;</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>if</b></font>&#160;(<font color="#AA22FF"><b>null</b></font>&#160;!=&#160;constructor)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;assign.Right&#160;=<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>new</b></font>&#160;<font color="#00A000">CodeSnippetExpression</font>(<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#00BB00"><b>string</b></font>.Format(<font color="#BB4444">&#8220;SapphireControlBuilder.Build&#60;{0}&#62;()&#8221;</font>,<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;ControlType.FullName));<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>break</b></font>;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font><br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font>
</div>
</div>
<p>следуя по коду можно обратить внимание, что он заменяет вызов конструктора на вызов генерик-метода Build, в котором мы и обратимся к нашему контейнеру с просьбой вызвать наш элемент управления и проинициализировать его конструктор необходимыми зависимостями.</p>
<p>Однако это ещё не решении задания, т.к. есть метод динамической загрузки элемента управления Page.LoadControl(), для него придётся написать свой вариант</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:12b0b2e2-a28f-4b65-a35f-6e09cc01a770" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>static</b></font>&#160;<font color="#AA22FF"><b>class</b></font>&#160;<font color="#0000FF">PageExtensions</font><br />
&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>static</b></font>&#160;UserControl&#160;<font color="#00A000">LoadAndBuildUpControl</font>(<font color="#AA22FF"><b>this</b></font>&#160;Page&#160;page,&#160;<font color="#00BB00"><b>string</b></font>&#160;virtualPath)<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;var&#160;control&#160;=&#160;page.LoadControl(virtualPath);<br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>return</b></font>&#160;SapphireControlBuilder.Build&#60;UserControl&#62;(control.GetType());<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font><br />
&#160;&#160;<font color="#AA22FF"><b>}</b></font>
</div>
</div>
<p>Вот мы и справились с поставленной задачей, однако это ещё не всё. А почему теперь не воспользоваться всеми преимуществами Unity, и не внедрить в наш элемент управления <a href="http://habrahabr.ru/blogs/net/50845/">AOP времени исполнения</a> с помощью <a href="http://msdn.microsoft.com/en-us/library/dd140045.aspx">Unity Interception</a>.</p>
<p>К примеру мы можем сделать следующее </p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:8f3bc656-82a3-4044-971c-c7bfdc000756" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>class</b></font>&#160;<font color="#0000FF">MyControl</font>&#160;:&#160;UserControl<br />
<font color="#AA22FF"><b>{</b></font><br />
<font color="#BB4444">&#160;&#160;&#160;&#160;[HandleException]</font><br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>override</b></font>&#160;<font color="#AA22FF"><b>void</b></font>&#160;<font color="#00A000">DataBind</font>()<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>base</b></font>.DataBind();<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font><br />
<font color="#AA22FF"><b>}</b></font>
</div>
</div>
<p>Это будет означать, что обработка исключений должна добавляться на лету, к тому ж предоставляя нам возможность её изменения во время исполнения, для начала пусть её реализация будет примерно следующая</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:b531ecfa-a7e4-4e58-832b-d666bfdd8aba" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
<font color="#BB4444">&#160;&#160;[AttributeUsage(AttributeTargets.Method&#160;&#124;&#160;AttributeTargets.Property,&#160;AllowMultiple&#160;=&#160;false,&#160;Inherited&#160;=&#160;true)]</font><br />
&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>class</b></font>&#160;<font color="#0000FF">HandleExceptionAttribute</font>&#160;:&#160;HandlerAttribute<br />
&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>override</b></font>&#160;ICallHandler&#160;<font color="#00A000">CreateHandler</font>(IUnityContainer&#160;container)<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>return</b></font>&#160;<font color="#AA22FF"><b>new</b></font>&#160;<font color="#00A000">ExceptionHandler</font>();<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font><br />
&#160;&#160;<font color="#AA22FF"><b>}</b></font></p>
<p>&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>class</b></font>&#160;<font color="#0000FF">ExceptionHandler</font>&#160;:&#160;ICallHandler<br />
&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;<font color="#008800"><i>///&#160;&#60;exception&#160;cref=&#8221;SapphireUserFriendlyException&#8221;&#62;&#60;c&#62;SapphireUserFriendlyException&#60;/c&#62;.&#60;/exception&#62;<br />
</i></font>&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;IMethodReturn&#160;<font color="#00A000">Invoke</font>(IMethodInvocation&#160;input,&#160;GetNextHandlerDelegate&#160;getNext)<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;var&#160;result&#160;=&#160;getNext()(input,&#160;getNext);<br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>if</b></font>&#160;(result.Exception&#160;==&#160;<font color="#AA22FF"><b>null</b></font>)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>return</b></font>&#160;result;<br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>throw</b></font>&#160;<font color="#AA22FF"><b>new</b></font>&#160;<font color="#00A000">SapphireUserFriendlyException</font>();<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font></p>
<p>&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#00BB00"><b>int</b></font>&#160;Order&#160;<font color="#AA22FF"><b>{</b></font>&#160;<font color="#AA22FF"><b>get</b></font>;&#160;<font color="#AA22FF"><b>set</b></font>;&#160;<font color="#AA22FF"><b>}</b></font><br />
&#160;&#160;<font color="#AA22FF"><b>}</b></font>
</div>
</div>
<p>Ну и конечно же надо сконфигурировать контейнер для создания наших прокси-обработчиков</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:2EC9848E-067D-4e79-BAB7-06CA927DB962:611e9f53-0255-4366-a483-321e39472de5" class="wlWriterEditableSmartContent">
<div style="font-family:consolas,lucida console,courier,monospace;">
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>public</b></font>&#160;<font color="#AA22FF"><b>static</b></font>&#160;T&#160;Build&#60;T&#62;()<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>{</b></font><br />
&#160;&#160;&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>return</b></font>&#160;(T)((Application)HttpContext.Current.ApplicationInstance)<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Container<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.&#160;AddNewExtension&#60;Interception&#62;()<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Configure&#60;Interception&#62;()<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.SetInterceptorFor&#60;T&#62;(<font color="#AA22FF"><b>new</b></font>&#160;VirtualMethodInterceptor())<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Container<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;.Resolve&#60;T&#62;();<br />
&#160;&#160;&#160;&#160;<font color="#AA22FF"><b>}</b></font>
</div>
</div>
<h4>Ресурсы</h4>
<p><a href="http://www.slideshare.net/butaji/sapphire-2256588">Sapphire.Application</a> – для чего всё это реализовывалось <a href="http://github.com/butaji/Sapphire/tree/master/trunk/Sapphire.Application/">http://github.com/butaji/Sapphire/tree/master/trunk/Sapphire.Application/</a></p>
<p>Дэвид предлагает реализации связывания с данными следующего поколения “Databinding 3.0” на основе аналогичного подхода <a href="http://weblogs.asp.net/davidfowler/archive/2009/11/13/databinding-3-0.aspx">http://weblogs.asp.net/davidfowler/archive/2009/11/13/databinding-3-0.aspx</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Zounds! A Blog Entry!]]></title>
<link>http://guyintheblackhat.wordpress.com/2009/11/08/zounds-a-blog-entry/</link>
<pubDate>Sun, 08 Nov 2009 22:32:45 +0000</pubDate>
<dc:creator>guyintheblackhat</dc:creator>
<guid>http://guyintheblackhat.wordpress.com/2009/11/08/zounds-a-blog-entry/</guid>
<description><![CDATA[Reality Rather than ruminate on how long it’s been since I last posted on this forum (17 days ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Reality</strong></p>
<p>Rather than ruminate on how long it’s been since I last posted on this forum (17 days &#8211; I’ve been spending my “writing block” on translation projects, my dissertation and a filmography for a book), I will elaborate on a few of the major events that have marked the last two weeks.</p>
<p>Our film <em>AOP</em>, a mockumentary about a secret West German fetish, debuted at the HFF “Konrad Wolf” as part of the end of orientation festivities on Friday October 23rd.  It went over lukewarm compared with the other “<em>Knaller</em>” made by the other nine groups (at least 3 of which took place in a bathroom), but director Maurice M. Mohn swore to me that the film “wasn’t unsuccessful” at the party afterwards.  Speaking of THAT party:  it was held after 11:00 p.m. at a sketchy, illegal club in Kreuzkölln with no fire exits, no windows, a sketchy fridge full of bottled beer and nothing but techno beats (the latter being a plus against the other factors).  I sort of plowed my way through the packed bathroom line to reach the exit around 2:30 after quaffing a few cheap beers and yelling my way through several conversations in the smoky darkness.  An experience, to be sure.</p>
<p>I went to a wonderful Fulbright brunch on Sunday October 25<sup>th</sup> held by the generous Luisa Greenfield and Ming Tsao in Kreuzberg, where I met Jacob Comenetz, a former Fulbrighter now working at the Bundespresseagentur (more on him to come) and got a pile of great book recommendations from Ming about writing about the electronic music aesthetic (you want that list? Send a comment my way!).  Later that day, I picked up Kat at the Berlin Tegel airport, who successfully got her very heavy baggage out of the terminal without a cart (or my help, since that’s how European airports work) and we ate out at Tuk-Tuk, the Indonesian restaurant down the street from us.</p>
<p>Having Kat around has been great for <span style="text-decoration:underline;">many</span> reasons.  Here are a few:</p>
<p>* Cessation of married-man-long-distance loneliness;</p>
<p>* More satisfying sleep;</p>
<p>* The apartment is now warmer;</p>
<p>* Increased intake of generally nutritious food that tastes good;</p>
<p>* New impulse to plan social events and outings, and I can show her all the old stuff I’ve gotten to know;</p>
<p>* Celebrating birthdays and holidays is much more meaningful again!</p>
<p>In the first week (Oct. 26 &#8211; Nov. 1st), I purposefully overscheduled us with many social events, including coffee with Kira and Beverly and dinner with the same, carving pumpkins with Katie Weeks and Hilary Bown, Luisa’s film screening on Friday night, and a Fulbright alumni Halloween party at Joe’s Bar in Prenzlauer Berg on Saturday night with Jacob.  I did so to make Kat feel at home and connected here, which also conversely made <em>me</em> feel more at home and connected here as well.  Speaking of Luisa’s screening, we had a <em>great</em> turn-out for the two shorter, more experimental films (<em>Light</em> and <em>Bridegroom</em>&#8230; see below) but, since we started over an hour late, over half the audience missed the wonderful mess that was John Ford’s <em>Seven Women</em> (1966).  We hope that everybody returns for our continuing Ford/Straub pairings, as well as other assorted film gems we manage to procure.  As for the Halloween party, Kat and I went as a vampire-zombie duo who hated each other through our expressions on our T-shirts:  “Vampires Bite” and “Zombies Need Brains.”  Ha ha.</p>
<p>This last week has presented us with opportunities to walk around and shop (such as in Kreuzberg’s famous Bergmannstrasse), watch movies together (many reviewed below) and get our visas (by waking up at 3 a.m. and surmounting the evil LABO).  All in all a good time, and I anticipate more to come.</p>
<p>Professionally speaking, I’ve had some ups and downs the last two weeks.  Ups:  I spent four hours with Herr Dieter Kosslick, director of the Berlinale, and two hours with Dr. Gottfried Langenstein, director of ARTE; I’ve found hundreds of newspaper articles with revealing insights on the reception of the Indianerfilme in East Germany; I’ve met up with Reinhild Steingröver of the University of Rochester and established contact with several other scholars working on parallel topics to my dissertation.  Downs: I lost my first month’s worth of book/film notes due to a faulty data back-up attempt, so I’ve got another 10 hours of work to do in reconstructing it.  This is the way it goes.</p>
<p>And one final note:  if you’re ever on Akazienstrasse in Schöneberg, DO NOT eat at the South Indian restaurant called Chennai Dosai, not only because their food is not particularly good, but because they played the opening track from the Hrithik Roshan sci-fi Bollywood film <em>Koi Mil Gya</em> (2003) on a loop THE ENTIRE TIME WE SAT THERE.  It was a unique form of tourist torture, though I’m sure they weren’t expecting a customer who knew the film.</p>
<p><strong>Fantasy</strong></p>
<p><em>Posse</em> (dir. Mario van Peebles, USA 1993)</p>
<p>Woody Strode, Big Daddy Kane, and many other prominent African-Americans star in this somewhat violent, misogynist and cliché Western.  Its primary contradiction lies in its seeming original mission &#8211; to re-insert African-Americans into a Western film tradition absolutely dominated by actors coded as “white” -  and its aesthetic outcome &#8211; a cheap Leone treasure/revenge plot with a lot of melodramatic cheese and macho strutting from Van Peebles.  The fact that I couldn’t really read the blocky explanatory text at the end didn’t really detract from the palpably saccharine coating that Van Peebles put on this piece of macho-masculine self-glorification.</p>
<p><em>The Treasure of Silver Lake</em> (dir. Harald Reinl, FRG/France/Yugoslavia 1963)</p>
<p>The film that started the whole Euro-Western trend, and a completely necessary entry in the cinema books next to adventure films such as Errol Flynn’s <em>Captain Blood</em> (1935)or Lucas’ and Spielberg’s <em>Raiders of the Lost Ark</em> (1981).  The superhuman duo of Winnetou (Pierre Brice) and Old Shatterhand (Lex Barker) stumble upon an injustice committed (the murder of Götz George’s German immigrant father) and a treasure to discover.  Let’s just say that, on a superficial level, the film absolutely delivers:  colorful landscapes, bold action sequences, and plot twists that still convince the 8 year-old inside of you.  You only think about the crazy exoticism of the whole charade afterwards&#8230;</p>
<p><em>The Sons of Great Bear</em> (dir. Josef Mach, GDR 1966)</p>
<p>The East German response to Reinl and Wendlandt’s Winnetou films, <em>The Sons of Great Bear</em> is the most “historically accurate” of all the DEFA Indianerfilme and also one of the most visually compelling.  That being said, Mach had little idea how to direct an action sequence, so the ending fight scene is confusing and frustrating to say the least, not to mention more-or-less tacked on to Liselotte Welskopf-Henrich’s original source material.  The press reviews made sure to note how much actor Gojko Mitic’s physique looked like the “real-life” Shoshone, though their basis on which to judge that comes from other Westerns’ portrayal of Native Americans.  Hmmm&#8230;.</p>
<p><em>Little Big Man</em> (dir. Arthur Penn, USA 1970)</p>
<p>Thomas Berger’s picaresque about the only white survivor of Little Bighorn, a man brought up by the Cheyenne (a.k.a. the human beings) named Jack, is expertly executed by Penn, if awkwardly assembled as a whole.  General Custer’s portrayal in the film is nothing short of brilliant &#8211; an arrogant prick more than a proper villain &#8211; and the Cheyenne are given a lot of positive screen-time.  Of course, Dustin Hoffman’s Jack dominates the majority of the film, with mixed results.</p>
<p><em>Battleship Potemkin</em> (dir. Sergei Eisenstein, Russia 1925)</p>
<p>Restored 35mm print containing all the original scenes?  Check.<br />
Live accompaniment by an adept pianist?  Check.<br />
Kat’s first time seeing a leftist modernist classic?  Check.<br />
I really can’t say anything more, other than that the Kino Arsenal has a special place in my heart.</p>
<p><em>Trick ‘r Treat</em> (dir. Michael Dougherty, USA 2008)</p>
<p>A kind of <em>Four Rooms</em> treatment of Halloween, <em>Trick ‘r Treat</em> is a very smooth movie with regard to horror clichés, playing on one’s expectations, and the usual twists and turns one expects of even the slasher genre nowadays.  One should watch this with one’s tongue firmly in cheek, even through all the horrifying bits.  I say no more.</p>
<p><em>The Omen</em> (dir. Richard Donner, UK/USA 1976)</p>
<p>Um&#8230; Gregory Peck’s character is kind of dumb?  This is at least what the film suggests, after one is led through a constant barrage of corroborating evidence that demonstrates his son is the antichrist, and he <em>still doesn’t seem to get it</em>.  Oh well:  there are many other films with evil children that work with the formula that <em>The Omen</em> put forth, so I suppose it’s influential.</p>
<p><em>League of Extraordinary Gentlemen</em> (dir. Stephen Norrington, USA 2003)</p>
<p>This was the second time I’ve seen the film, and the second time I’ve seen it in Berlin (the last time was with Mary Brandel in 2003 &#8211; and I hated it then too.)  Alan Moore’s excellent graphic novel was to be transformed into a grand piece of pulp, and instead turned into a nightmarish gobbledy-gook of lame special FX (including the atrocious Venice sequence), too many characters running around (including “Tom Sawyer,” their worst revision), and sequel-baiting (the *ahem* “ending”).  Stuart Townsend is about the only redeeming feature of this feature, and that’s because he’s so damn charming in any case.</p>
<p><em>V for Vendetta</em> (dir. James McTeigue, UK/Germany 2006)</p>
<p>Another slightly second-rate “good” film from the Wachowski Brothers, <em>V for Vendetta</em> continuously bills itself as a smart action thriller which raises bits of moral ambiguity for the postmodern cinema-goer, but is ultimately far too utopian about the power of the masses to stomach.  Alan Moore wasn’t nearly as idealistic as this, and far more critical of the respective places within society that Evie, V and the masses inhabit.  You can tell through the exquisite detail of the sets that the Babelsberg people worked on this one, though.</p>
<p><em>Genau Gleich</em> (dir. Burkhart Wunderlich, Germany 2009)</p>
<p>A film that I’m currently subtitling for Burkhart about an incestuous relationship between German-Polish twins and an old woman on a bench waiting for Elvis.  An absolutely brilliant concluding shot is likely to give this one high marks at the Berlinale if, indeed, we manage to get the film into competition.</p>
<p><em>Light </em>(dir. Marie Menken, USA 1964)</p>
<p>Dizzying Christmas lights, spinning motion, elliptical editing.  The lost American avant-garde.  Shall we see it again?</p>
<p><em>The Bridegroom, the Comedienne and the Pimp </em>(dir. Jean-Marie Straub, Daniele Huillet, FRG 1968)</p>
<p>I must’ve seen this film something like eight or nine times since I’ve come to UMass.  Nevertheless, the mixture of prostitutes against an industrial backdrop, Ferdinand Bruckner’s “The Pains of Youth” by Fassbinder’s antitheater group, and the intense chase/marriage sequence at the end never fail to incite thoughts of alternatives to mainstream cinema and new spatial configurations of narrative.</p>
<p><em>Seven Women</em> (dir. John Ford, USA 1966)</p>
<p>Ford’s last film is an outright laugh riot starring Anne Bancroft as a self-confident doctor who winds up in a doomed community of American missionaries in Mongolia.  Oh wait &#8211; this wasn’t supposed to be funny?  Then perhaps there’s too much Sirkian irony in this overstuffed, full-color studio epic, which is probably why the film was buried after its creation:  Ford’s film is trapped between gender and a hard place.   Oh yeah, and there’s actually <em>eight</em> women, but one of them happens to be Chinese&#8230;</p>
<p><em>Coraline</em> (dir. Henry Selick, USA 2009)</p>
<p><em>Coraline</em> is a well-executed animated feature in glorious 3D that was screened at the HFF as part of our overall 3D research project.  Many of the fantastic landscapes, both interiors and exteriors, are enhanced by the 3D effects, but these effects don’t overwhelm the adaptation from the original text.  What <em>does</em> overwhelm the adaptation is the inclusion of a male character who has to save Coraline’s butt in the end, classifying it as yet another film with a strong female character who needs a man to both tame and save her.  Why can’t Hollywood ever be done with its male heroes?</p>
<p><em>G-Force</em> (dir. Hoyt Yeatman, USA 2009)</p>
<p>Most 3D films rely on re-vamped spatial relations that make tighter spaces seem even tighter and wide open spaces seem glorious.  So what better means of exploring tight spaces and big vistas than making a supremely small cast, through whose eyes we must view the world?  Such is the visual premise of <em>G-Force</em>, which has guinea pig commandos saving the world from a silly plot in a classic Jerry Bruckheimer fashion.  Nevertheless, the effects are convincing and most of the side-plots are not particularly annoying.  I would say:  Mr. Yeatman’s background in visual FX for advertising and trailers paid off in a big way for the film, though its effects scenes are <em>so</em> pronounced as to make all of the dialog sequences seem drawn-out and dull.  Definitely a movie that attempts to satiate a hyper-active age group.  Critics who don’t fully “get” 3D films and who are thoroughly in Pixar’s camp are liable to hate it,  but I can root for it from the sidelines.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Spring에서의 AOP]]></title>
<link>http://choijh.wordpress.com/2009/11/06/spring%ec%97%90%ec%84%9c%ec%9d%98-aop/</link>
<pubDate>Fri, 06 Nov 2009 08:46:50 +0000</pubDate>
<dc:creator>승냥이</dc:creator>
<guid>http://choijh.wordpress.com/2009/11/06/spring%ec%97%90%ec%84%9c%ec%9d%98-aop/</guid>
<description><![CDATA[Spring의 IoC적인 특징은 AOP를 구현하는 핵심적인 원리가 되어 왔습니다. AOP란 무엇입니까? 사실, AOP는 그닥 어려운 개념은 아닙니다. AOP는 그동안의 전통적인 프]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Spring의 IoC적인 특징은 AOP를 구현하는 핵심적인 원리가 되어 왔습니다.<br />
AOP란 무엇입니까? 사실, AOP는 그닥 어려운 개념은 아닙니다. AOP는 그동안의 전통적인 프로그래밍에서 개발자들이 느끼고 있던 불편함을 개선한 새로운 프로그래밍 패러다임이라고 보여집니다.</p>
<p><!--more--></p>
<p>AOP가 필요한 이유를 설명하기 전에 일반적인 형태의 프로그램을 작성하는 방식을 살펴보겠습니다.</p>
<p>우리가 은행업무를 위한 프로그램을 작성한다고 가정해 보겠습니다. 은행업무에는 기본적인 입/출금업무가 있을 것이고 계좌이체업무도 있을 것입니다. 이러한 업무들이 바로 은행업무에 있어서 본질적인 비즈니스 기능이라고 할 수 있을 것입니다. 하지만, 이런 업무들만 있는 것은 아니지요. 누군가 돈을 찾아갔다면 그 정보도 남겨야 할 것이고 ID도용이 발생했다면 원인을 밝혀내야 하며, 온라인 뱅킹이 발생했다면 정상적으로 거래은행에 입금이 되었는지도 체크해야 합니다.</p>
<p>이와같이 은행업무를 위한 프로그램에는 핵심 비즈니스 기능뿐 아니라 부가적이라고 말할 수도 있는 보안, 인증, 로그 , 중복체크등과 같은 기능들도 통합되어 있어야만 비로소 완전하게 구현되었다고 말할 수 있습니다. 어쩌면은 은행 본연의 업무를 위한 코드들보다 부가적인 측면을 다루는 코드가 더 많아질수도 있겠습니다.</p>
<p>하지만 이 부가적인 기능을 다루는 코드는 비즈니스 로직과는 상관관계가 없는 경우가 많아서 여러업무에 중복적으로 사용되는 것이 일반적이지요. 보통 개발이 진행되면 진행될수록 사실 핵심 비즈니스로직보다는 이러한 부가적인 처리에 사용되는 코드가 문제가 되기도 합니다. 시스템 전체에 걸쳐서 사용되고 있기 때문에 수정도 힘들고 관리도 힘들게 됩니다.</p>
<p>AOP세계에서는 상기 설명했던 기능중에서 비즈니스로직을 구현한 기능들을 Primary(Core) concern이라고 부릅니다. 보안, 인증, 로그등과 같은 부가적인 기능으로서 시스템 전반에 산재되어 사용되는 기능들은 Cross-cutting concern이라고 부르고 있습니다. 바로 AOP의 핵심이 여기에 있습니다. 바로 AOP는 우리에게 있어서 골치거리인 Cross-cutting concern을 어떻게 다룰 것인가에 대한 새로운 패러다임을 제고하고 있습니다.</p>
<p>사실 AOP가 등장하기 전에는 Primary concern과 Cross-cutting concern이 같이 하나의 프로그램에 구현되어져 왔습니다. 당연히 비즈니스 로직과 상관없는 코드들이 여기저기 산재해 있게 되었기에 가독성과 유지보수성에 악영향이 있을 수 밖에 없었을 것입니다. 생산성 저하와 비용증가는 당연한 결과였겠지요.</p>
<p>하지만, AOP세계에서는 다릅니다. AOP는 Primary concern과 Cross-cutting concern을 별도의 코드로 구현합니다. 최종적인 프로그램은 이 둘을 조합하여 완성하게 되는 것이죠. 이것은 하나의 프로그램에 각각의 코드들이 혼재해 있는 것과는 명확히 다른 것입니다. 사실 이렇게 되기를 많은 개발자들이 마음속으로 바래마지 않았을 것이지만 그 방법을 몰랐었습니다. AOP는 모든 개발자들이 바랬던 이상을 구현해 놓은 것에 불과(?)한것이지요.</p>
<p>이제, AOP세계에서 새로운 용어들이 등장하게 되었습니다. 바로 Advice와 Code , Point-Cut 그리고 Weaving입니다.</p>
<p>Code는 Primary(Core) concern을 구현해 놓은 코드를 이야기합니다. Advice는 Cross-cutting Concern을 구현한 코드를 지칭하고 있습니다. 그럼, Point-cut은 무엇일까요? 바로 Advice와 Code를 연결해주는 설정 정보를 말합니다. 다시 말하면 Point-cut은 Code의 어느 위치에 Advice를 위치할 것인가에 대한 것입니다. 마지막으로 Weaving은 이 둘(Code와 Advice)를 조합하여 완성된 어플리케이션을 만드는 과정을 이야기합니다.</p>
<p>정리해 볼까요?</p>
<ul>
<li><strong>Code :</strong> Primary(core) concern을 구현한 코드</li>
<li><strong>Advice:</strong>  Cross-cutting concern을 구현한 코드</li>
<li><strong>Jointpoint:</strong>Code와 Advice를 연결해주는 설정 정보, Advice가 적용 가능한 지점(메소드 호출, 필드값 변경)</li>
<li><strong>Point-cut:</strong> Jointpoint의 부분집합으로서 실제 Advice가 적용되는 Jointpint</li>
<li><strong>Weaving :</strong> Code, Advice, Point-cut등을 조합하여서 어플리케이션을 만들어 가는 과정</li>
</ul>
<p>이 용어들을 이해하는 것으로도 벌써 AOP세계의 절반은 여행하셨다고 볼 수 있습니다. 사실 이 용어를 이해한다면 AOP는 그닥 어려운 것이 아닐 수 있습니다. 따라서 위의 용어들은 반드시 숙지하시길 권면드립니다.</p>
<p>그럼 왜 AOP(Aspect Oriented Programming)이라고 하는 걸까요?</p>
<p>AOP의 Aspect는 Advice와 Point-cut을 함께 지칭하는 단어입니다. 따라서 AOP는 Advice와 Point-cut에 대한 이야기를 하고 싶었던 것이네요.</p>
<p>Spring의 AOP패키지는 이러한 AOP개념을 멋드러지게 구현한 것으로서 그 배경에는 IoC 또는 DI가 자리하고 있습니다.</p>
<p>Spring AOP도 여러 AOP 프레임워크중의 하나입니다. 따라서 나름의 특징이 있습니다. 간단히 소개를 해보자면 다음과 같습니다.</p>
<ul>
<li>자체적인 프록시 기반의 AOP 지원</li>
</ul>
<p>필드값 변경과 같은 Joinpoint는 사용할 수 없고 메서드 호출 Joinpoint만 지원합니다. Spring AOP는 완전한 AOP를 지원하는 것이 목적이 아니라 엔터프라이즈 어플리케이션을 구현하는데 필요한 정도의 기능 제공을 목적으로 하고 있습니다.</p>
<ul>
<li> Spring AOP는 자바 기반</li>
</ul>
<p>AspectJ는 별도의 문법을 알아야 하지만 Spring AOP는 자바를 기반으로 하고 있기때문에 다른 언어를 익힐 필요가 없습니다.</p>
<p>Spring AOP는 내부적으로 프록시를 이용하여 AOP가 구현되기 때문에 메서드 호출에 대해서만 AOP를 적용할 수 있다는 점이 아쉬운 점이라고 할 만하지만, 크게 문제될 것은 없다는 개인적인 생각입니다.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Why Spring? ]]></title>
<link>http://choijh.wordpress.com/2009/11/06/why-spring/</link>
<pubDate>Fri, 06 Nov 2009 07:06:22 +0000</pubDate>
<dc:creator>승냥이</dc:creator>
<guid>http://choijh.wordpress.com/2009/11/06/why-spring/</guid>
<description><![CDATA[Why Spring? 그 많은 Java진영의 프레임워크중에서도 단연 가장 화두가 되어 있는것은 Spring입니다. 우리가 Spring을 주목하는 이유는 여러가지가 있을 수 있습니다]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><ul>
<li><strong>Why Spring?</strong></li>
</ul>
<p>그 많은 Java진영의 프레임워크중에서도 단연 가장 화두가 되어 있는것은 Spring입니다. 우리가 Spring을 주목하는 이유는 여러가지가 있을 수 있습니다만, 제가 생각하는 것을 정리해 보자면 다음과 같습니다.<br />
<!--more--></p>
<ul>
<li> Spring은 다른 프레임워크가 하지 못하는 중요한 부분을 제시하고 있다</li>
</ul>
<p> Spring은 특히 비지니스 오브젝트를 관리하는 방법을 제시하는 면에 포커스를 맞추고 있습니다.</p>
<ul>
<li> Spring은 테스트가 쉬운 코드를 작성하도록 도움주는 방식으로 디자인되어 있다</li>
</ul>
<p> 특히, TDD방식의 프로젝트에 이상적인 프레임워크입니다.</p>
<ul>
<li>Spring은 아주 중요한 통합기술이다</li>
</ul>
<p>Spring의 중요한 역할에 대해서는 Big벤더와 Small벤더에 모두 인정받고 있습니다.  Spring의 목적은 기존에 존재하는 기술들을 보다 쉽게 사용할 수 있고 , 통합할 수 있도록 기반을 제공하는 것입니다. 결코 필요하다고 해서 새로 무언가를 개발해서 제공하지 않습니다. 필요한 것들은 대부분 OpenSource로 제공되기 때문에 그것을 재활용할 수 있도록 여지만 만들어 놓는 것이지요. 예를 들면 log4j라든가 Hibernate등이 있을 수 있겠네요.</p>
<ul>
<li><strong>아키텍쳐관점에서의 Spring의 이점들</strong></li>
</ul>
<p>Spring을 사용하게 되면 얻게되는 혜택들을 좀 살펴보겠습니다.  사실 현학적인 말들과 멋드러진 기술이야기보다도 현실적으로 내가 얻을 수 있는 혜택이 중요하겠지요.</p>
<ul>
<li>Spring은 미들티어 오브젝트들을 효과적으로 조직할 수 있다</li>
</ul>
<p>Spring의 환경설정 관리 서비스들은 어떤 아키텍쳐 레이어에서도 사용될 수 있습니다. </p>
<ul>
<li>Spring은 다양한 커스텀 Properties 파일들의 필요성을 제거해준다</li>
</ul>
<p>머리속에 숨어있는 보이지는 않지만 가려운 석캐(아실려나??)처럼 프로젝트를 어렵게 만드는 존재인 system properties 또는 Magic properties keys들에게서 해방되게끔 해줍니다. 어떻게? 바로 Inversion of Control(IoC)과 Dependency Injection(DI)를 통해서 말이죠.</p>
<ul>
<li>Spring은 가능한한 어플리케이션들이 Spring에 의존적이지 않게 프로그램이 가능하도록 디자인되어 있다</li>
</ul>
<p>Spring에서 사용되는 대부분의 비지니스 오브젝트들은 Spring에 의존관계가 존재하지 않습니다.</p>
<ul>
<li>Spring을 이용해서 제작된 어플리케이션들은 쉽게 테스트가 가능하다</li>
</ul>
<p>Spring TestContext Framework 와 JUnit3.8등이 지원해줍니다.</p>
<ul>
<li>Spring은 데이타 접근에 있어서 일관성이 있는 프레임워크를 제공한다</li>
</ul>
<p>JDBC를 사용하던 OR맵핑(TopLink,Hibernate)등을 사용하던지 말이지요. </p>
<ul>
<li>Spring은 가장 가벼운 구조로서 문제들을 해결할 수 있도록 도와준다</li>
</ul>
<p>Spring은 EJB의 대안으로서 제시될수 있습니다. 예를 들면, Spring은 EJB컨테이너를 사용하지 않고 명확한 트랜잭션 관리를 위해서 AOP를 사용할 수 있습니다.</p>
<p>사실, 가장 핵심적인 것으로서 Spring은 Plain Old Java Objects(POJOs)를 이용하여서 어플리케이션을 개발하도록 고안된 기술이라는 점입니다. 이것이 제가 Spring에 끌리게 된 결정적인 이유입니다. 개발자는 비지니스로직이 포함된 POJO콤포넌트만을 집중해서 개발한다면 나머지는 프레임워크에서 알아서 처리해주겠다는 것입니다. Spring은 개발자가 가장 간단한 방식으로 문제에 집중해서 개발이 가능하도록 해줍니다.<br />
정말일까요?? ㅎㅎ</p>
<p>* 이 내용은 Rod Johnson이 기고한 글 Introduction to the Spring Framework 2.5 란 글에서 참고하였습니다.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Signal Framework 0.4-beta]]></title>
<link>http://mobileswdev.wordpress.com/2009/11/05/signal-framework-0-4-beta/</link>
<pubDate>Thu, 05 Nov 2009 19:35:04 +0000</pubDate>
<dc:creator>Marek</dc:creator>
<guid>http://mobileswdev.wordpress.com/2009/11/05/signal-framework-0-4-beta/</guid>
<description><![CDATA[A new release of the Signal Framework is available and includes the following changes: Bugfixes, Doc]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div>
<div>
<p>A new release of the Signal Framework is <a href="https://sourceforge.net/projects/signal/files/Signal%20Framework/0.4-beta/signal-0.4-beta-dist.zip/download">available</a> and includes the following changes:</p>
<ul>
<li>Bugfixes,</li>
<li>Documentation updates,</li>
<li>Package names changed to reflect the new website domain.</li>
</ul>
</div>
</div>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Aspect Oriented Programming Tutorial :: Core Concept (Part-2) ]]></title>
<link>http://aasims.wordpress.com/2009/11/04/aspect-oriented-programming-part-2/</link>
<pubDate>Wed, 04 Nov 2009 19:28:13 +0000</pubDate>
<dc:creator>Ans</dc:creator>
<guid>http://aasims.wordpress.com/2009/11/04/aspect-oriented-programming-part-2/</guid>
<description><![CDATA[Hello All. Hope that you all are doing best in all aspects of your life&#8230; This is a second part]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hello All.<br />
Hope that you all are doing best in all aspects of your life&#8230;</p>
<p>This is a second part of tutorial on aspect oriented programming. In<a href="http://aasims.wordpress.com/2009/10/27/aspect-oriented-programming-part-1/" target="_blank"> last part</a>, we discussed little about object oriented approach to design and develop computer based system and some issues with this approach. We talked about issues those are not concerned with a developer of specific module but he/she has to care those things, we saw a small chunk of code and realized that same lines of code are repeating in different classes/methods time and again and a developer has to write them even when those lines are not concerned with core logic of that method or developer&#8217;s expertise. <img class="alignright size-full wp-image-586" title="aspect-modeling.org_browse_" src="http://aasims.wordpress.com/files/2009/11/aspect-modeling-org_browse_1.jpg" alt="aspect-modeling.org_browse_" width="340" height="207" /></p>
<p>In this part i will present aspect oriented approach to cope with such issues and to design/develop your application&#8217;s architecture with much better way. Again, may be my writing style, sentences structure, grammar, spells are not up to the mark, but it doesn&#8217;t matter, neither i&#8217;m going to tech you English nor it is an English literature class, so don&#8217;t worry <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  , i will try to focus on contents and concept so kindly accept my apology in advance.</p>
<p><strong>Concern</strong><br />
orite, lets start &#8230; we know that every class, method or package in our software system has some responsibility in over all flow of application. Like some packages/classes for session management, some classes to obtain and mange database connections, some classes act like delegates, some work at middle layer to control transaction management etc &#8230; there are many other classes too that we develop as per user interface or to perform some other functionality. Anyone can guess the purpose of a class or method by just looking at its name (if good programming practices are in practice). Mean every class/method has something to concern with it, and in any application there are many possible concerns like managing role/permissions, fetching data as per specific criteria at specific screen, to control navigation, to handle session management and many others. So concern mean anything important that has to be done in software system. Any logic, any piece of code, or even a complete module.</p>
<p><span style="color:#000000;"><strong>Cross Cutting Concerns</strong></span><br />
While analyzing the user requirements and business scenarios in client&#8217;s world, you can analyze different concerns that you have to handle &#8230; and while you list down them you will realize that there are few things that are overlapping in each module or in different business scenario, or more precisely they span over different module or concerns. They present in all modules or help other modules to perform their concerning task properly. Such overlapping things or concerns are called cross-utting concerns. Means they cross cut different modules or concerns and present across the application in same form. In other words, These cross-cutting concers are pieces of logic that have to be applied at many places but actually don&#8217;t have anything to do with the  core business logic of that particular class or method.</p>
<p><strong>Issues with Cross Cutting Concerns</strong><br />
At this point I’m assuming that you have understand the term of concern and cross-cutting concerns. Again in short, concern is any functionality/logic/module/code that you have to implement to achieve some business goal; cross-cutting concerns are those concerns that are spread over the application and replicates in different concerns, got that!!! Good.</p>
<p>The biggest issues with cross cutting concerns are that they replicates in all applications, exists in different part of your code in more or less same form. Let consider the previous example again to clarify this point.</p>
<p>method Fetch_Employee_Data{</p>
<p style="padding-left:30px;"><strong>log start of method;<br />
open data base session;</strong><br />
create query to fetch data;<br />
<strong>log query and its parameters;</strong><br />
call to database to fetch data;<br />
close database session;<br />
<strong>log returned data from database;<br />
log end of method;</strong><br />
return results;</p>
<p>}</p>
<p>Consider the above piece of code (in natural language).<a href="http://aasims.wordpress.com/2009/10/27/aspect-oriented-programming-part-1/" target="_blank"> Last time</a> we analyze that the bold lines can be found in every method of your application that fetch data from database, and wants to log different activities/interaction with database server. In any application, the logging and mechanism of interacting with database are major activities that have to perform again and again. In others words, logging and database interaction are two major concerns. Plus these concerns are also cross-cutting concerns because they are spreading across the application. In every method you can find them. You have no other option other than to write these lines of code in every method. What maximum you can do is to make separate classes and write all code there. Whenever you need logging and database interaction, just call methods of those classes. But again the problem is that you have to write call to those classes in every method; even a single line. This single line of code is much costly when you have to write them in every method of your class. One thing more, what if you need to have little change in that line? Again you have to edit/modify all those methods?</p>
<p>This thing become worst when a person that hasn’t concerned with such issue but he/she has to care about them. A person who has primary responsibility to write an optimal query to fetch data from database against a certain criteria but he/she is wasting his/her time in managing logging and database connectively issues. Is that fair? Absolutely not ..</p>
<p>The ideal solution for such issues is to identify and separate those piece of code/logic that span over the whole system, means their cross-cutting behavior or attribute should eliminate. Is there any way in OOP to do that? There isn&#8217;t unfortunately.</p>
<p><strong>Aspect Oriented Programming Approach</strong></p>
<p>No doubt Object-oriented programming (OOP) is a mainstream programming paradigm now a days. It provides software re-usability by providing design and language constructs for modularity, encapsulation, inheritance, and polymorphism. Though OOP has credit in implementing large scale projects and system, still it has some problems. It is practically proved that developers faces some problems in maintaining their code while working on large scale projects. An attempt to do a minor change in the program design may require several updates to a large number of unrelated modules. In other words, they have to change/update those modules that has no concern with core logic of required changes; more technically, they have to update many cross-cutting concerns at many places of code while doing a minor change in existing system. Hence OOP don&#8217;t have any concrete solution for managing and handling cross-cutting concerns in a software system. In object-oriented programming the natural unit of modularity is the class, and a cross-cutting concern is a concern that spans multiple classes (logging, context-sensitive error handling, performance optimization, and design patterns)</p>
<p>Aspect oriented approach provides solutions for such issues. It provides a way to design a software system architecture while considering the issue of cross-cutting concerns. It cleanly separate the cross-cutting concerns among different modules and treat them as autonomous construct hence remove their cross-cutting behavior.</p>
<p>To understand the core of AOP approach, again consider the previous example. If I remove the bold lines then remaining method will look like</p>
<p>method Fetch_Employee_Data{</p>
<p style="padding-left:30px;">create query to fetch data;<br />
call to database to fetch data;<br />
return results;</p>
<p>}</p>
<p>Here the developer hasn&#8217;t any worry about how connection with database is handling, how the logging happen. He just has to write those lines of code that belongs to core logic of that method. In other words, he is just concerned with core logic and doesn&#8217;t need to worry about other things. Doesn&#8217;t look good han??? AOP says that the class or method should perform only its concerned task and shouldn&#8217;t worry about other things. It provide a way to modularize different aspects of a system in least cohesive fashion.</p>
<p>How this happen? In AOP world, you pick all cross-cutting concern and develop them as separate entity, and when you need them in your code, just inject their functionality at run time. Looks strange?? i know at first glass it does. ok i try to clear by an example. Again consider the same example. In our Fetch_Employee_Data method we introduced logging to log all interaction with database server. We noticed that we have to write same line of code in every method. Now AOP says that pick these line of code, put them in separate entity, and wherever you need that logging functionality, just tell the compiler to inject logging in your method at your mentioned location; sounds good han &#8230;. it is indeed &#8230;. see you don&#8217;t need to write same code time and again in each method but only once in separate entity and compiler is injecting it in every method you mention. I will tell you latter how to write separate entity and how to tell compiler to inject at run time but right now just try to grasp core idea behind aspect oriented approach and how it is different from object oriented.</p>
<p>To me AOP is some kind of meta-programming. It complements object-oriented programming by facilitating another type of modularity that pulls together the widespread implementation of a cross-cutting concern into a single unit. These units are termed aspects, hence the name aspect-oriented programming.  By compartmentalizing aspect code, cross-cutting concerns become easy to deal with. Aspects of a system can be changed, inserted or removed at compile time, and even reused. One thing to be noted is, that AOP does not replace OOP but adds certain decomposition features. I say it a nice add-on to OOP.</p>
<p>In next part i will tell you about major term used in aspect oriented programming. You learn how to pick cross-cutting concerns from system and write them as aspect; and how to tell compiler to inject them at run time. Till now i was talking in much generic fashion just to clear the concept, in next part i will discuss things pragmatically so be ready&#8230;.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mont d'Or eller Vacherin Mont d'Or det är frågan]]></title>
<link>http://ostbloggen.wordpress.com/2009/11/04/mont-dor-eller-vacherin-mont-dor-det-ar-fragan/</link>
<pubDate>Wed, 04 Nov 2009 16:40:03 +0000</pubDate>
<dc:creator>Daddy-T</dc:creator>
<guid>http://ostbloggen.wordpress.com/2009/11/04/mont-dor-eller-vacherin-mont-dor-det-ar-fragan/</guid>
<description><![CDATA[Kärt barn har många namn och det gäller definitivt den goda osten Mont d&#8217;Or som har anor från ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Kärt barn har många namn och det gäller definitivt den goda osten Mont d&#8217;Or som har anor från 1800-talet.</p>
<p>Le Mont d&#8217;Or är namnet på en bergstopp i Jurabergen men även namnet på en fransk ost med AOC- och AOP-status. Denna franska ost kan även säljas under namnet Vacherin du Haut-Doubs medan man på andra sidan sluttningen av Mont d&#8217;Or tillverkar en i princip identisk ost vid namn Vacherin Mont d&#8217;Or med schweizisk AOC-status.</p>
<p>Osten har anor sedan 1800-talet och lär ha tillkommit sedan tillgången på getmjölk blivit för dålig i området. En getost kallad Chevrotin blev då ersatt av komjöksosten Vacherin. Namnen är logiska då get heter chevre och ko heter vache på franska. Tillverkningen skedde i godan ro på båda sidor gränsen men på 1970-talet lyckades schweizarna skaffa sig ensamrätten till namnet Vacherin Mont d&#8217;Or. Av någon anledningen så valde då fransmännen att ha två namn på sin ost, Mont d&#8217;Or respektive Vacherin du Haut-Doubs.</p>
<p>Alla tre säljs i träaskar tillverkade av gran och lagringstiden är ungefär densamma, ca tre veckor. De franska ostarna är till skillnad från sin schweiziska kusin tillverkade av opastöriserad mjölk. 1987 Schweizarna började pastörisera sin ost efter att det upptäckts att ett parti av osten spred salmonella. Efter denna åtgärd så öppnades även möjligheten för dem att exportera osten till USA dit det annars är omöjligt med tanke den korta lagringstiden. Volymmässigt så är Frankrike överlägset med en årsproduktion på ca 4 000 ton mot Schweiz 600 ton.</p>
<p>Sedan råkar det finnas en schweizisk ost vid namn Vacherin Fribourgeois, men den har inga större likheter med Mont d&#8217;Or-ostarna. Den är dock ett vanligt val när det vankas ostfondue.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Mont d'Or]]></title>
<link>http://ostbloggen.wordpress.com/2009/10/30/mont-dor-2/</link>
<pubDate>Fri, 30 Oct 2009 15:33:56 +0000</pubDate>
<dc:creator>Daddy-T</dc:creator>
<guid>http://ostbloggen.wordpress.com/2009/10/30/mont-dor-2/</guid>
<description><![CDATA[Den franska osten Mont d&#8217;Or hör hemma i departementet Doubs i östra Frankrike och gränstrakter]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Den franska osten Mont d&#8217;Or hör hemma i departementet Doubs i östra Frankrike och gränstrakterna mot Schweiz. Osten är gjord av opastöriserad komjölk och kan kategoriseras som en tvättad ost. Den har dock inte som många andra tvättade ostar  ett rödaktigt yttre utan ett mer gulbrunt skal.  Denna ost får bara tillverkas under perioden 15 augusti till den 15 mars och försäljning får ske mellan den 10 september och den 10 maj. Efter minimum 21 dagars lagring på granplanka omsluten av granbark så säljs den i en ask som även den är gjord av gran. Storleken på askarna varierar från 11 till 33 cm i diameter och vikten från 480 gram till 3,2 kg (ask inkluderad!). AOC-status sedan 1981.</p>
<p style="text-align:center;">
<div id="attachment_848" class="wp-caption aligncenter" style="width: 325px"><img class="size-full wp-image-848 " title="mont-d-or" src="http://ostbloggen.wordpress.com/files/2009/10/mont-d-or.gif" alt="mont-d-or" width="315" height="517" /><p class="wp-caption-text">Mont d&#39;Or</p></div>
<p>Vi avnjöt den på det troligen vanligaste sättet, &#8220;ugnsbakad&#8221;. Man gör ett hål i toppen och häller på vitt vin och gärna lite pressad vitlök, efter ca 20 minuter i ugnen kan man ta ut en härligt doftande och mycket krämig Mont d&#8217;Or som avnjuts tillsammans med kokt potatis och charkuterier. Vår vänlige vinhandlare hade tre förslag på vin; Rousette de Savoie, Crépy eller en Riesling från Alsace. Vårt val föll på en Crépy och den satt som en smäck.</p>
<p>Mont d&#8217;Or är även som hörs på namnet ett berg och det har sin högsta punkt 1463 meter över havet. Namnförvirringen kring denna ost är ganska total och i ett kommande inlägg så skall jag försöka reda ut begreppen kring de franska och schweiziska varianterna på denna ost.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Let Ant tasks choose the attribute values by themself]]></title>
<link>http://janmaterne.wordpress.com/2009/10/30/let-ant-tasks-choose-the-attribute-values-by-themself/</link>
<pubDate>Fri, 30 Oct 2009 06:49:30 +0000</pubDate>
<dc:creator>janmaterne</dc:creator>
<guid>http://janmaterne.wordpress.com/2009/10/30/let-ant-tasks-choose-the-attribute-values-by-themself/</guid>
<description><![CDATA[For a long time an idea travelled in my head. But now it arrived. In my several Ant build files I ha]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>For a long time an idea travelled in my head. But now it arrived.</p>
<p style="text-align:left;">In my several <a href="http://ant.apache.org">Ant </a>build files I have constructs like</p>
<pre>&#60;javac source=”${javac.source}” debug=”${javac.debug}” target=”${javac.target}” …</pre>
<p>and the according properties defined in an external file. Now have a compile run for the source code and the test code and you have doubled this amount of configuration. And I thought that just writing a &#60;javac&#62; and starting with an -autoconf option would be easier.</p>
<p>The idea is: apply the properties directly before the task execution.</p>
<p>So I could implement a method call in<em> oata.Task.perform()</em> direclty before calling the execute() method.    <br />Hhm …. I don’t want to change the Ant core that deeply because so many external tasks exist and I don’t want to (maybe) break their build.</p>
<p>Another idea is using an AOP framework like <a href="http://www.eclipse.org/aspectj/">AspectJ </a>for jumping in: before <em>&#60;? extends Task&#62;.execute() : applyAttributeValues() </em><br />(I am not familiar with AspectJ but you get the idea.)    <br />But then I would depend on the AOP library. That’s nothing for the Core. And Ant options should not depend on any further libraries.    <br />I could implement it as a task:</p>
<pre>  &#60;project&#62;&#60;autoconf/&#62;&#60;javac/&#62;&#60;/project&#62;    </pre>
<p>Better. But I have to learn AspectJ … so not for now…</p>
<p>On the <a href="http://hudson.dev.java.net/">Hudson</a> dev-mailinglist I heard from the <a href="http://wiki.hudson-ci.org/display/HUDSON/Clover+Plugin">Hudson Clover Plugin</a>. It gatheres code coverage from Ant jobs WITHOUT configuring the job itself.-It adds a <a href="http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/ant/BuildListener.java">BuildListener</a> which stores the srcdir and destdir values from &#60;javac&#62; tasks.   <br />Nice idea …. use the Listeners<em> taskStarted(event)</em> and<em> taskFinished(event)</em> methods for doing AOP-stuff.</p>
<p>This results in the <a href="http://svn.apache.org/repos/asf/ant/sandbox/autoconf/docs/autoconf.html">&#60;autoconf&#62;</a> task, currently in the <a href="http://svn.apache.org/repos/asf/ant/sandbox/autoconf/">sandbox</a> and feedback is welcome.</p>
<p>The goal:</p>
<ul>
<li>apply attribute values from properties</li>
<li>do not overwrite user specified values</li>
<li>switch on/off the behaviour</li>
<li>support name prefix for using different values for different targets</li>
</ul>
<p>While the last two points are easily to implement (add/remove the listener, use a prefix for property search) the first two are difficult.</p>
<h2>apply attribute values from properties / which attributes are supported by a given task?</h2>
<p>Why is this difficult? Just ask <em>mytask.getClass()</em> for declared setters ….</p>
<p>The problem is that you don’t get the task object. Due lazy instantiation/configuration the only thing you get from the BuildEvent is an UnknownElement. And therefore you cannot just ask getClass() for the class object you need.</p>
<p>I saw three different strategies according to that value:</p>
<ul>
<li>if it is a &#60;macrodef&#62; I could ask it directly for its &#60;attribute&#62;s</li>
<li>if it is a normal task I ask the class object</li>
<li>if it is a &#60;presetdef&#62; I ask the class object from <em>preset.getTypeClass()</em></li>
</ul>
<h2>do not overwrite user specified values</h2>
<p>I could ask an object for its values, but which are set by the user and which are just implementation defaults? From the Java perspective you cannot distinguish between them…</p>
<p>My strategy is using a “clean” object (I called it <em>template object</em>) and compare its values with the values from the given object.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Can AOP help fix bad architectures?]]></title>
<link>http://aabs.wordpress.com/2009/10/22/can-aop-help-fix-bad-architectures/</link>
<pubDate>Wed, 21 Oct 2009 22:55:34 +0000</pubDate>
<dc:creator>aabs</dc:creator>
<guid>http://aabs.wordpress.com/2009/10/22/can-aop-help-fix-bad-architectures/</guid>
<description><![CDATA[I recently posted a question on Stack Overflow on the feasibility of using IL rewriting frameworks t]]></description>
<content:encoded><![CDATA[I recently posted a question on Stack Overflow on the feasibility of using IL rewriting frameworks t]]></content:encoded>
</item>
<item>
<title><![CDATA[So What's New?]]></title>
<link>http://animeonpsp.wordpress.com/2009/10/14/so-whats-new/</link>
<pubDate>Thu, 15 Oct 2009 00:52:45 +0000</pubDate>
<dc:creator>epdemon</dc:creator>
<guid>http://animeonpsp.wordpress.com/2009/10/14/so-whats-new/</guid>
<description><![CDATA[Hi guys, It&#8217;s been a while since an update or a release (while not that long), so I&#8217;ll s]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hi guys,</p>
<p>It&#8217;s been a while since an update or a release (while not that long), so I&#8217;ll shed some light.</p>
<p>XviD4PSP fails on me now so I can&#8217;t rely on it anymore for encodes. I&#8217;ve moved on to HandBrake which works on both Windows and Ubuntu. Hopefully, this can throw up way better encodes for you guys. As always, if you want to help out with releases, feel free to speak up. Leave comments, register, leave comments on torrents, etc. Any sort of help is appreciated.</p>
<p>In other updates, I contacted the guy for the Nogizaka Haruka joint and he hasn&#8217;t replied as of yet. I&#8217;m giving until the end of the week until I start batching whatever is available. I just scrolled down the update list and InuYasha Ep 2, Nogizaka (no official fansubs yet &#8211; HorribleSubs don&#8217;t count), Queen&#8217;s Blade EP3 will be next in the pipe. Asura Cryin 2 will be dropped and that&#8217;s pretty much about it.</p>
<p>Keep your eyes out for the next few releases.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Veckans AOP - Banon ]]></title>
<link>http://ostbloggen.wordpress.com/2009/10/13/veckans-aop-banon/</link>
<pubDate>Tue, 13 Oct 2009 10:22:03 +0000</pubDate>
<dc:creator>Daddy-T</dc:creator>
<guid>http://ostbloggen.wordpress.com/2009/10/13/veckans-aop-banon/</guid>
<description><![CDATA[Banon är regionen Provence-Alpes-Côte d&#8217;Azurs bidrag till de franska AOP och AOC-ostarna. AOC ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:center;"><img class="aligncenter size-full wp-image-767" title="Banon" src="http://ostbloggen.wordpress.com/files/2009/10/banon.jpg" alt="Banon" width="359" height="253" /></p>
<p>Banon är regionen Provence-Alpes-Côte d&#8217;Azurs bidrag till de franska AOP och AOC-ostarna. AOC sedan 2003 gör den till en av de yngre AOC-ostarna men den har anor ända sedan medeltiden då den finns omnämnd i gamla skrifter. Tillverkningen sker i området kring den lilla byn Banon som ligger i departementet Alpes-de-Haute-Provence.</p>
<p>Den presenteras inlindad i torkade blad från kastanjträdet som hålls på plats med hjälp av snöre gjort av palmblad. När man öppnar upp de brunt höstfärgade bladen hittar man en cirkulär ost på 100 gram som lagrats i minimum 15 dagar, därav minst de sista 10 dagarna inlindad i kastanjebladen. Det förkommer även att den badas med eau-de-vie innan den lindas in i bladen. Till konsistensen så skiljer sig osten från de &#8220;vanliga&#8221; getostrana genom att den är väldigt krämig och nästan rinnig en lätt ammoniaksmak kan både doftas och kännas vid avsmakning av osten som är ganska stark. Osten är inte någon av mina favoriter och den påminner om annan ost som jag också har lite svårt för nämligen Pérail de Brebis. En fårost som tillverkas i Midi-Pyrénées och har en liknande konsistens.</p>
<p>Givetvis finns det även legender kring osten Banon. Den romerske kejsaren Antonius Pius (86-161)  dog i en magsjukdom efter att ha ätit för mycket ost och osten han åt för mycket av skall ha varit just Banon.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Spring AOP]]></title>
<link>http://jruntime.wordpress.com/2009/10/13/method-caching-using-ehcache/</link>
<pubDate>Tue, 13 Oct 2009 02:15:41 +0000</pubDate>
<dc:creator>jmoll26</dc:creator>
<guid>http://jruntime.wordpress.com/2009/10/13/method-caching-using-ehcache/</guid>
<description><![CDATA[Working on transferring from blogger &lt;bean id=&#8221;test&#8221; class=&#8221;*.*.finder() /&gt;]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Working on transferring from blogger</p>
<p>&#60;bean id=&#8221;test&#8221; class=&#8221;*.*.finder() /&#62;</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Spring AOP method caching with ehcache]]></title>
<link>http://jruntime.wordpress.com/2009/10/13/spring-aop-method-caching-with-ehcache/</link>
<pubDate>Tue, 13 Oct 2009 01:45:00 +0000</pubDate>
<dc:creator>jmoll26</dc:creator>
<guid>http://jruntime.wordpress.com/2009/10/13/spring-aop-method-caching-with-ehcache/</guid>
<description><![CDATA[Recently I was tasked with looking into configuring one of the webapps I work on to leverage caching]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Recently I was tasked with looking into configuring one of the webapps I work on to leverage caching. Here is a simple example of how one can accomplish this using Spring AOP and ehcache.</p>
<p>Dependencies (not complete list)
<ul>
<li>aspectjweaver-1.5.3.jar</li>
<li>ehcach-1.6.2.jar</li>
<li>spring-support-2.0.7.jar</li>
<li>spring-aop-2.5.5.jar</li>
</ul>
<p>I already had a bunch of the other Spring dependent jars that are not listed. Grab a copy of the <a href="http://ehcache.org/ehcache.xml">ehcach.xml</a> from their site and place it in your classpath, for me that is src/main/resourses. Not all of the options in the ehcache.xml are required but I highly recommend reading the comments in the file so you have a good understanding of the options you have.</p>
<p>Now to create an Interceptor class that will be responsible the caching logic. For this we will use something very simple such as:</p>
<pre class="java">public class MethodCacheInterceptor implements MethodInterceptor {

private Cache cache;

@Requiredpublic void setCache(Cache cache) {this.cache = cache;}

public Object invoke(MethodInvocation invocation) throws Throwable {String targetName  = invocation.getThis().getClass().getName();String methodName  = invocation.getMethod().getName();Object[] arguments = invocation.getArguments();Object result;

String cacheKey = getCacheKey(targetName, methodName, arguments);Element element = cache.get(cacheKey);

if (element == null) {//call target/sub-interceptorresult = invocation.proceed();

//cache method resultelement = new Element(cacheKey, (Serializable) result);cache.put(element);}return element.getValue();}

private String getCacheKey(String targetName,String methodName, Object[] arguments) {StringBuffer sb = new StringBuffer();sb.append(targetName).append(".").append(methodName);if ((arguments != null) &#38;&#38; (arguments.length != 0)) {for (int i=0; i sb.append(".").append(arguments[i]);}}return sb.toString();}}</pre>
<p>That&#8217;s it for coding, now we just need to wire it all together.</p>
<pre class="xml"><!-- Cache manager -->

<!-- Cache Factory beans - used to configure the individual cache settings -->

<!-- Cache interceptor -->
</pre>
<p>Now for the pointcut setup:
<pre class="xml">&#160;&#160;&#160;&#160;
</pre>
<p>Pretty simple, in my upcoming post I will give an example of how to use AOP to invoke a timed event which will be used to ping the Cache in this example to retrieve statistics.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Injured on the Job?]]></title>
<link>http://legallbug.wordpress.com/2009/10/09/workers-compensatio/</link>
<pubDate>Fri, 09 Oct 2009 13:06:54 +0000</pubDate>
<dc:creator>Legall Bug</dc:creator>
<guid>http://legallbug.wordpress.com/2009/10/09/workers-compensatio/</guid>
<description><![CDATA[What are your first steps if you are injured on the job? If you are injured on the job, here are som]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h1>What are your first steps if you are injured on the job?</h1>
<p>If you are injured on the job, here are some steps you should take to file a worker compensation claim and to preserve your rights under workers comp law:</p>
<ul>
<li>Report      the injury to your employer by telling your supervisor right away.</li>
<li>Get emergency treatment if you      need it. Your employer may tell you where to go for treatment.</li>
<li>Tell      the health care provider who treats you that your injury or illness is      job-related.</li>
<li>Complete and file a WC-14, with the      State Board of Workers&#8217; Compensation and send a copy of the form to your      employer and their workers&#8217; compensation insurance carrier.</li>
</ul>
<p>Report any accident to your employer (boss, foreman, or supervisor) immediately. This is important because if you wait longer than 30 days, you might lose the benefits due you under Atlanta worker compensation law.</p>
<p>If you are injured while working, contact an Workers&#8217; Compensation lawyer to assist you in claiming compensation for medical treatment, lost wages, and any permanent damage or disfigurement all of which are covered by Atlanta worker compensation law.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Excellent Article on Spring AOP]]></title>
<link>http://sphprakash.wordpress.com/2009/10/09/excellent-article-on-spring-aop/</link>
<pubDate>Fri, 09 Oct 2009 09:26:13 +0000</pubDate>
<dc:creator>Prakash  S</dc:creator>
<guid>http://sphprakash.wordpress.com/2009/10/09/excellent-article-on-spring-aop/</guid>
<description><![CDATA[http://www.javalobby.org/java/forums/t44746.html]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>http://www.javalobby.org/java/forums/t44746.html</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Commentator and summariser...]]></title>
<link>http://afragment.wordpress.com/2009/10/08/commentator-and-summariser/</link>
<pubDate>Thu, 08 Oct 2009 00:05:17 +0000</pubDate>
<dc:creator>Nathan Midgley</dc:creator>
<guid>http://afragment.wordpress.com/2009/10/08/commentator-and-summariser/</guid>
<description><![CDATA[I followed a bit of the Association of Online Publishers conference from my desk today, sporadically]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I followed a bit of the <a href="http://twitter.com/search?q=%23aop3c">Association of Online Publishers conference</a> from my desk today, sporadically and passively as work demanded.</p>
<p>Quotes and broad themes turned up regularly on Twitter, and in among them came a <a href="http://twitter.com/adders/status/4680612651">tweet</a> from <a href="http://www.onemanandhisblog.com/">Adam Tinworth</a> about <a href="http://strange.corante.com/2009/10/07/qsotd-journalists-shouldnt-confuse-important-with-simply-urgent">a Kevin Anderson post</a> that &#8216;builds an important point out of a few of the less obvious quotes&#8217;.</p>
<p>I followed the link, only thinking afterwards how the overall reading experience recalled the transition from commentator to summariser (US: <a href="http://en.wikipedia.org/wiki/Color_commentator">color commentator</a>) in cricket coverage.</p>
<p>On the production side, of course, what happened is five, six, maybe seven multiverses distant from that.</p>
<p>How often is it worth formalising the commentator-summariser dynamic in live web coverage, so that tweets, pics and links from a &#8216;ball-by-ball&#8217; person dovetail near-live with insight pieces from a blogger?</p>
<p>It would have to be some event, especially given that solo live blogs already do the com-sum mix quite well &#8211; and in cricket coverage, among other places&#8230;</p>
<p><em>PS: </em><em>Yes, you could also talk reporter-section head rather than commentator-summariser, but the latter doesn&#8217;t come with any management-tree baggage.</em></p>
<p><em></em><em>PPS: I daresay that there are sports other than cricket, and that they have commentators and summarisers too. I wish them well.</em></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Cost Per Engagement (CPE) Model pits Marketing against Sales ]]></title>
<link>http://digitalgenerator.wordpress.com/2009/10/07/cost-per-engagement-cpe-model-pits-marketing-against-sales/</link>
<pubDate>Wed, 07 Oct 2009 22:46:56 +0000</pubDate>
<dc:creator>digitalgenerator</dc:creator>
<guid>http://digitalgenerator.wordpress.com/2009/10/07/cost-per-engagement-cpe-model-pits-marketing-against-sales/</guid>
<description><![CDATA[The AOP conference today had plenty of speakers addressing the likely move from Cost Per Thousand (C]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>The AOP conference today had plenty of speakers addressing the likely move from Cost Per Thousand (CPM) models towards more Cost Per Engagement (CPE). On the face of it, this is a welcome shift. It is in line with the increasing demand for media spend to be clearly associated with performance &#8211; with achieving the objective of the campaign. P&#38;G is leading the way, with recent briefs offering to pay media owners more for delivering &#8221;engaged users&#8221;. (<a href="http://www.nma.co.uk/news/cover-story-pg-to-pay-publishers-based-on-online-engagement/3004452.article" target="_blank">NMA 17 Sept 09</a>)</p>
<p>So far so good.</p>
<p>But when advertisers place media budget with an agency, the agency control is only in delivering the best possible marketing effort, driving volumes of qualified prospects to the website. After that, it is the responsibility of the website to convert the prospect into a sale, be that a purchase, a download or subscribing to a newsletter. And that is in the hands of the website owner, not the marketers.</p>
<p>If the CPE model is to work, advertisers must address the Sale, not just the Marketing. And that means a shift in mindset &#8211; when consumers are confident that clicking on an ad will take them to a place that is a good experience, engaging, easy to use, maybe we&#8217;ll see clickthrough rates finally start to rise again.</p>
<p>Meanwhile, CPE pits Marketing against Sales and that is not a recipe for driving performance.</p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
