Browse files

New blog post on the observer pattern

  • Loading branch information...
1 parent e068838 commit a8f4adc311ed79a5c891c102f7247833990dd4d0 @skuro committed Mar 10, 2013
View
123 2013/03/06/java-stringbuilder-myth/index.html
@@ -0,0 +1,123 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>SKURO! -- Shading lights</title>
+ <meta name="generator" content="skuro.tk/0.1 | jekyll/0.11.0" />
+ <meta charset="utf-8" />
+ <meta name="description" content="Personal Blog of Carlo Sciolla" />
+ <meta name="keywords" content="clojure,enlive,moustache,java,alfresco,lambdalf,performance" />
+ <link rel="stylesheet" href="/stylesheets/styles.css" />
+ <link rel="stylesheet" href="/stylesheets/pygment_trac.css" />
+ <link rel="stylesheet" href="/stylesheets/skuro.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
+
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ </head>
+ <body>
+ <div class="adsense">
+ <script type="text/javascript"><!--
+ google_ad_client = "ca-pub-5536661153340295";
+ /* ghpages-skyscraper */
+ google_ad_slot = "1277668326";
+ google_ad_width = 120;
+ google_ad_height = 600;
+ //-->
+ </script>
+ <script type="text/javascript"
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+ </script>
+ </div>
+ <div class="wrapper">
+ <header>
+ <span class="avatar">
+ <img src="http://www.gravatar.com/avatar/3246c43cf35485e40a18e72fa1fa7ace" />
+ </span>
+ <h1><a href="/">SKURO!</a></h1>
+ <ul>
+ <li><a href="/archive">Browse the <strong>Archive</strong></a></li>
+ <li><a href="/category">Browse by <strong>Categories</strong></a></li>
+ <li><a href="/about">Learn more <strong>About me</strong></a></li>
+ </ul>
+ <p class="persona">
+ <a href="https://github.com/skuro"><img src="/img/github.png" /></a>
+ <a href="http://nl.linkedin.com/in/carlosciolla"><img src="/img/linkedin.png" /></a>
+ <a href="https://twitter.com/skuro"><img src="/img/twitter.png" /></a>
+ <a href="/rss2.xml"><img src="/img/rss.png" /></a>
+ <span>shading lights</span>
+ </p>
+ </header>
+
+ <section>
+ <div class="post">
+ <h1>
+ Java StringBuilder myth debunked
+ <a href="/2013/03/06/java-stringbuilder-myth">
+ <img src="/img/link.jpg" alt="Permalink to Java StringBuilder myth debunked" />
+ </a>
+</h1>
+<blockquote class="date-wrapper">
+ <h5 class="date">
+ March 6, 2013
+
+ &nbsp;
+
+ <a href="/category/java">#java</a><span>&nbsp;&nbsp;</span>
+
+ <a href="/category/performance">#performance</a><span>&nbsp;&nbsp;</span>
+
+ <a href="/category/development">#development</a><span>&nbsp;&nbsp;</span>
+
+
+ </h5>
+</blockquote>
+
+
+ <img src="/img/post/jirasvn.png" class="primary" />
+
+
+
+
+ <div id="disqus_thread"></div>
+<script type="text/javascript">
+ /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
+ var disqus_shortname = 'skuro';
+// var disqus_id = '/2013/03/06/java-stringbuilder-myth';
+// var disqus_url = [location.protocol, '//', location.host, location.pathname].join('');
+
+ /* * * DON'T EDIT BELOW THIS LINE * * */
+ (function() {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
+</script>
+<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+
+
+
+</div>
+
+ </section>
+
+ </div>
+ <footer>
+ <p><a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license"><img src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" style="border-width:0;margin-bottom:10px" alt="Creative Commons License" /></a> licensed under a Creative Commons <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">license</a>
+ <p><span rel="dct:type" property="dct:title" href="http://purl.org/dc/dcmitype/Text">SKURO! blog</span> by <a rel="cc:attributionURL" property="cc:attributionName" href="http://skuro.tk">Carlo Sciolla</a></p>
+ </footer>
+
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try{
+ var pageTracker = _gat._getTracker("UA-6754361-1");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+
+ </body>
+</html>
View
176 2013/03/10/observer-pattern-spring-framework/index.html
@@ -0,0 +1,176 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>SKURO! -- Shading lights</title>
+ <meta name="generator" content="skuro.tk/0.1 | jekyll/0.11.0" />
+ <meta charset="utf-8" />
+ <meta name="description" content="Personal Blog of Carlo Sciolla" />
+ <meta name="keywords" content="clojure,enlive,moustache,java,alfresco,lambdalf,performance" />
+ <link rel="stylesheet" href="/stylesheets/styles.css" />
+ <link rel="stylesheet" href="/stylesheets/pygment_trac.css" />
+ <link rel="stylesheet" href="/stylesheets/skuro.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
+
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ </head>
+ <body>
+ <div class="adsense">
+ <script type="text/javascript"><!--
+ google_ad_client = "ca-pub-5536661153340295";
+ /* ghpages-skyscraper */
+ google_ad_slot = "1277668326";
+ google_ad_width = 120;
+ google_ad_height = 600;
+ //-->
+ </script>
+ <script type="text/javascript"
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+ </script>
+ </div>
+ <div class="wrapper">
+ <header>
+ <span class="avatar">
+ <img src="http://www.gravatar.com/avatar/3246c43cf35485e40a18e72fa1fa7ace" />
+ </span>
+ <h1><a href="/">SKURO!</a></h1>
+ <ul>
+ <li><a href="/archive">Browse the <strong>Archive</strong></a></li>
+ <li><a href="/category">Browse by <strong>Categories</strong></a></li>
+ <li><a href="/about">Learn more <strong>About me</strong></a></li>
+ </ul>
+ <p class="persona">
+ <a href="https://github.com/skuro"><img src="/img/github.png" /></a>
+ <a href="http://nl.linkedin.com/in/carlosciolla"><img src="/img/linkedin.png" /></a>
+ <a href="https://twitter.com/skuro"><img src="/img/twitter.png" /></a>
+ <a href="/rss2.xml"><img src="/img/rss.png" /></a>
+ <span>shading lights</span>
+ </p>
+ </header>
+
+ <section>
+ <div class="post">
+ <h1>
+ The Observer Pattern in Spring
+ <a href="/2013/03/10/observer-pattern-spring-framework">
+ <img src="/img/link.jpg" alt="Permalink to The Observer Pattern in Spring" />
+ </a>
+</h1>
+<blockquote class="date-wrapper">
+ <h5 class="date">
+ March 10, 2013
+
+ &nbsp;
+
+ <a href="/category/java">#java</a><span>&nbsp;&nbsp;</span>
+
+ <a href="/category/spring">#spring</a><span>&nbsp;&nbsp;</span>
+
+ <a href="/category/patterns">#patterns</a><span>&nbsp;&nbsp;</span>
+
+
+ </h5>
+</blockquote>
+
+
+ <img src="http://mimg.ugo.com/200907/10229/cuts/the-observer_288x288.jpg" class="primary" />
+
+ <h1>Observers in Spring</h1>
+
+<blockquote><p>To the man-in-the-street, who, I'm sorry to say,<br/>
+Is a keen observer of life,<br/>
+The word "Intellectual" suggests straight away<br/>
+A man who's untrue to his wife.</p>
+
+<p>-- W.H. Auden</p></blockquote>
+
+<p>The Observer pattern is a very basic one out of the GoF bible which is unbelivably easy to implement and still quote
+powerful so use. Here I present my take on it using the Spring observer pattern which I found quite helpful in designing
+extension points for my software.</p>
+
+<h1>Core classes</h1>
+
+<p>Pushing back the little NIH devil whispering in my ears, I started by reusing the standard building blocks for the
+Observer pattern: <code>java.util.Observable</code> and <code>java.util.Observer</code>. The Observable class provides the logic to handle a
+registry of Observers, and to propagate updates (I prefer to think more of in terms of events) to all of the registered
+Observers.</p>
+
+<p>In the context of a Spring container, there will be beans to configure and hook together, and it's key to this exercise
+to find a flexible and handy way to connect things together.</p>
+
+<h1>Automatic registration</h1>
+
+<p>Supporting code for this blog post can be found on <a href="https://github.com/skuro/spring-observer">GitHub</a>.</p>
+
+<p>When developing a Spring application you're always instantiating your classes as singletons within the Spring container.
+Annotations or XML configurations will take care of initialize instances of your classes, wiring them together in a
+connected graph of objects with loose dependencies on the specific concrete classes you adopt in your code.</p>
+
+<p>As you will always have to declare beans, it would be nice to let Spring wire obects for you in an Observer fashion,
+with a minimal coding effort required. The most minimalistic approach I could think of is to just require developers to
+declare their observer beans, and put in place enough machinery to automatically hook them to an Observable provided by
+the application. In this example I create a <code>ObserverBeanPostProcessor</code> and a <code>SpringObserver</code>
+tagging interface to identify which beans are actually declaring valid Observers, and register them automatically.</p>
+
+<p>To complete the picture, the <code>SpringObservable</code> interface declares which <code>Observer</code> class it's able to notify, thus
+leveraging the tagging interface and letting the <code>ObserverBeanPostProcessor</code> know which beans to filter and registser.</p>
+
+<p>This enables a software component to provide the desired <code>SpringObservable</code> and the <code>ObserverBeanPostProcessor</code> beans, where
+consumers of such API will be only required to instantiate their <code>Observer</code> beans.</p>
+
+<p>Note that <code>Observers</code> can be themselves <code>Observables</code>, so that you can easily construct chains of beans in which events
+will be propagated. As long as you ensure not to form any cyclic graph, of course.</p>
+
+<h1>Conclusions</h1>
+
+<p>In object oriented languages such as Java, patterns are a powerful tool to apply. The Observer is a neat strategy for
+cascading changes on objects, or just to propagate events through a series of processors. All in a clean, loosly coupled
+fashion.</p>
+
+<p>The code here is just a proof of concept, not a library which is intended for production use. The concepts and the
+implementation are easy enough to be applied in your Spring application without any need for depending on this code.</p>
+
+
+ <div id="disqus_thread"></div>
+<script type="text/javascript">
+ /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
+ var disqus_shortname = 'skuro';
+// var disqus_id = '/2013/03/10/observer-pattern-spring-framework';
+// var disqus_url = [location.protocol, '//', location.host, location.pathname].join('');
+
+ /* * * DON'T EDIT BELOW THIS LINE * * */
+ (function() {
+ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
+ dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
+ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
+ })();
+</script>
+<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
+<a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
+
+
+
+</div>
+
+ </section>
+
+ </div>
+ <footer>
+ <p><a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license"><img src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" style="border-width:0;margin-bottom:10px" alt="Creative Commons License" /></a> licensed under a Creative Commons <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">license</a>
+ <p><span rel="dct:type" property="dct:title" href="http://purl.org/dc/dcmitype/Text">SKURO! blog</span> by <a rel="cc:attributionURL" property="cc:attributionName" href="http://skuro.tk">Carlo Sciolla</a></p>
+ </footer>
+
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try{
+ var pageTracker = _gat._getTracker("UA-6754361-1");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+
+ </body>
+</html>
View
30 archive/index.html
@@ -56,6 +56,36 @@
<ul>
<li>
+ <span class="date">10 March 2013</span>
+ <a href="/2013/03/10/observer-pattern-spring-framework">The Observer Pattern in Spring</a>
+ <span class="categories">
+
+ <a class="tag" href="/category/java">#java</a>
+
+ <a class="tag" href="/category/spring">#spring</a>
+
+ <a class="tag" href="/category/patterns">#patterns</a>
+
+ </span>
+</li>
+
+
+ <li>
+ <span class="date"> 6 March 2013</span>
+ <a href="/2013/03/06/java-stringbuilder-myth">Java StringBuilder myth debunked</a>
+ <span class="categories">
+
+ <a class="tag" href="/category/java">#java</a>
+
+ <a class="tag" href="/category/performance">#performance</a>
+
+ <a class="tag" href="/category/development">#development</a>
+
+ </span>
+</li>
+
+
+ <li>
<span class="date">18 February 2013</span>
<a href="/2013/02/18/svn-postcommit-hook-jira-comments">A svn post commit hook to comment on Jira</a>
<span class="categories">
View
2 category/developer/clojure/feed
@@ -3,7 +3,7 @@
<title type="text" xml:lang="en">SKURO! -- Shading lights</title>
<link type="application/atom+xml" href="http://skuro.tk/rss2/" rel="self"/>
<link type="text" href="http://skuro.tk" rel="alternate"/>
- <updated>2013-02-19T00:05:54+01:00</updated>
+ <updated>2013-03-10T00:10:08+01:00</updated>
<id>http://skuro.tk</id>
<author>
<name>Carlo Sciolla</name>
View
15 category/development/index.html
@@ -74,6 +74,21 @@ <h1 class="title">
</li>
+ <li>
+ <span class="date"> 6 March 2013</span>
+ <a href="/2013/03/06/java-stringbuilder-myth">Java StringBuilder myth debunked</a>
+ <span class="categories">
+
+ <a class="tag" href="/category/java">#java</a>
+
+ <a class="tag" href="/category/performance">#performance</a>
+
+ <a class="tag" href="/category/development">#development</a>
+
+ </span>
+</li>
+
+
</ul>
</div>
</div>
View
54 category/index.html
@@ -54,57 +54,63 @@
<h1>Categories</h1>
<div>
- <a class="tag" href="/category/maven/" style="font-size:32px">#maven</a>
-
- <a class="tag" href="/category/alfresco/" style="font-size:59px">#alfresco</a>
+ <a class="tag" href="/category/windows/" style="font-size:23px">#windows</a>
- <a class="tag" href="/category/apple/" style="font-size:32px">#apple</a>
+ <a class="tag" href="/category/meetup/" style="font-size:35px">#meetup</a>
<a class="tag" href="/category/presentation/" style="font-size:23px">#presentation</a>
- <a class="tag" href="/category/h2-support/" style="font-size:32px">#h2-support</a>
+ <a class="tag" href="/category/linux/" style="font-size:38px">#linux</a>
- <a class="tag" href="/category/italian/" style="font-size:26px">#italian</a>
+ <a class="tag" href="/category/software/" style="font-size:23px">#software</a>
- <a class="tag" href="/category/meetup/" style="font-size:35px">#meetup</a>
+ <a class="tag" href="/category/h2support/" style="font-size:23px">#h2support</a>
- <a class="tag" href="/category/software/" style="font-size:23px">#software</a>
+ <a class="tag" href="/category/performance/" style="font-size:23px">#performance</a>
- <a class="tag" href="/category/sonatype/" style="font-size:26px">#sonatype</a>
+ <a class="tag" href="/category/orgmode/" style="font-size:23px">#orgmode</a>
+
+ <a class="tag" href="/category/maven/" style="font-size:32px">#maven</a>
+
+ <a class="tag" href="/category/alfresco/" style="font-size:59px">#alfresco</a>
+
+ <a class="tag" href="/category/spring/" style="font-size:23px">#spring</a>
<a class="tag" href="/category/amsterdam/" style="font-size:29px">#amsterdam</a>
- <a class="tag" href="/category/java/" style="font-size:23px">#java</a>
+ <a class="tag" href="/category/jira/" style="font-size:23px">#jira</a>
<a class="tag" href="/category/emacs/" style="font-size:26px">#emacs</a>
- <a class="tag" href="/category/eclipse/" style="font-size:23px">#eclipse</a>
+ <a class="tag" href="/category/javascript/" style="font-size:26px">#javascript</a>
- <a class="tag" href="/category/orgmode/" style="font-size:23px">#orgmode</a>
+ <a class="tag" href="/category/java/" style="font-size:29px">#java</a>
- <a class="tag" href="/category/clojure/" style="font-size:50px">#clojure</a>
+ <a class="tag" href="/category/patterns/" style="font-size:23px">#patterns</a>
- <a class="tag" href="/category/alm/" style="font-size:53px">#alm</a>
+ <a class="tag" href="/category/slides/" style="font-size:23px">#slides</a>
- <a class="tag" href="/category/blog/" style="font-size:35px">#blog</a>
+ <a class="tag" href="/category/sonatype/" style="font-size:26px">#sonatype</a>
- <a class="tag" href="/category/subversion/" style="font-size:23px">#subversion</a>
+ <a class="tag" href="/category/h2-support/" style="font-size:32px">#h2-support</a>
- <a class="tag" href="/category/h2support/" style="font-size:23px">#h2support</a>
+ <a class="tag" href="/category/clojure/" style="font-size:50px">#clojure</a>
- <a class="tag" href="/category/slides/" style="font-size:23px">#slides</a>
+ <a class="tag" href="/category/development/" style="font-size:26px">#development</a>
- <a class="tag" href="/category/linux/" style="font-size:38px">#linux</a>
+ <a class="tag" href="/category/apple/" style="font-size:32px">#apple</a>
- <a class="tag" href="/category/intellij/" style="font-size:23px">#intellij</a>
+ <a class="tag" href="/category/blog/" style="font-size:35px">#blog</a>
- <a class="tag" href="/category/development/" style="font-size:23px">#development</a>
+ <a class="tag" href="/category/subversion/" style="font-size:23px">#subversion</a>
- <a class="tag" href="/category/jira/" style="font-size:23px">#jira</a>
+ <a class="tag" href="/category/intellij/" style="font-size:23px">#intellij</a>
- <a class="tag" href="/category/javascript/" style="font-size:26px">#javascript</a>
+ <a class="tag" href="/category/italian/" style="font-size:26px">#italian</a>
- <a class="tag" href="/category/windows/" style="font-size:23px">#windows</a>
+ <a class="tag" href="/category/alm/" style="font-size:53px">#alm</a>
+
+ <a class="tag" href="/category/eclipse/" style="font-size:23px">#eclipse</a>
</div>
</section>
View
30 category/java/index.html
@@ -68,6 +68,36 @@ <h1 class="title">
</li>
+ <li>
+ <span class="date"> 6 March 2013</span>
+ <a href="/2013/03/06/java-stringbuilder-myth">Java StringBuilder myth debunked</a>
+ <span class="categories">
+
+ <a class="tag" href="/category/java">#java</a>
+
+ <a class="tag" href="/category/performance">#performance</a>
+
+ <a class="tag" href="/category/development">#development</a>
+
+ </span>
+</li>
+
+
+ <li>
+ <span class="date">10 March 2013</span>
+ <a href="/2013/03/10/observer-pattern-spring-framework">The Observer Pattern in Spring</a>
+ <span class="categories">
+
+ <a class="tag" href="/category/java">#java</a>
+
+ <a class="tag" href="/category/spring">#spring</a>
+
+ <a class="tag" href="/category/patterns">#patterns</a>
+
+ </span>
+</li>
+
+
</ul>
</div>
</div>
View
99 category/patterns/index.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>SKURO! -- Shading lights</title>
+ <meta name="generator" content="skuro.tk/0.1 | jekyll/0.11.0" />
+ <meta charset="utf-8" />
+ <meta name="description" content="Personal Blog of Carlo Sciolla" />
+ <meta name="keywords" content="clojure,enlive,moustache,java,alfresco,lambdalf,performance" />
+ <link rel="stylesheet" href="/stylesheets/styles.css" />
+ <link rel="stylesheet" href="/stylesheets/pygment_trac.css" />
+ <link rel="stylesheet" href="/stylesheets/skuro.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
+
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ </head>
+ <body>
+ <div class="adsense">
+ <script type="text/javascript"><!--
+ google_ad_client = "ca-pub-5536661153340295";
+ /* ghpages-skyscraper */
+ google_ad_slot = "1277668326";
+ google_ad_width = 120;
+ google_ad_height = 600;
+ //-->
+ </script>
+ <script type="text/javascript"
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+ </script>
+ </div>
+ <div class="wrapper">
+ <header>
+ <span class="avatar">
+ <img src="http://www.gravatar.com/avatar/3246c43cf35485e40a18e72fa1fa7ace" />
+ </span>
+ <h1><a href="/">SKURO!</a></h1>
+ <ul>
+ <li><a href="/archive">Browse the <strong>Archive</strong></a></li>
+ <li><a href="/category">Browse by <strong>Categories</strong></a></li>
+ <li><a href="/about">Learn more <strong>About me</strong></a></li>
+ </ul>
+ <p class="persona">
+ <a href="https://github.com/skuro"><img src="/img/github.png" /></a>
+ <a href="http://nl.linkedin.com/in/carlosciolla"><img src="/img/linkedin.png" /></a>
+ <a href="https://twitter.com/skuro"><img src="/img/twitter.png" /></a>
+ <a href="/rss2.xml"><img src="/img/rss.png" /></a>
+ <span>shading lights</span>
+ </p>
+ </header>
+
+ <section>
+ <div class="post">
+ <h1 class="title">
+ Posts filed under <a href="category/patterns/index.html">#patterns</a>
+ </h1>
+ <div id="archive" class="archive">
+ <ul>
+
+ <li>
+ <span class="date">10 March 2013</span>
+ <a href="/2013/03/10/observer-pattern-spring-framework">The Observer Pattern in Spring</a>
+ <span class="categories">
+
+ <a class="tag" href="/category/java">#java</a>
+
+ <a class="tag" href="/category/spring">#spring</a>
+
+ <a class="tag" href="/category/patterns">#patterns</a>
+
+ </span>
+</li>
+
+
+ </ul>
+ </div>
+</div>
+
+ </section>
+
+ </div>
+ <footer>
+ <p><a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license"><img src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" style="border-width:0;margin-bottom:10px" alt="Creative Commons License" /></a> licensed under a Creative Commons <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">license</a>
+ <p><span rel="dct:type" property="dct:title" href="http://purl.org/dc/dcmitype/Text">SKURO! blog</span> by <a rel="cc:attributionURL" property="cc:attributionName" href="http://skuro.tk">Carlo Sciolla</a></p>
+ </footer>
+
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try{
+ var pageTracker = _gat._getTracker("UA-6754361-1");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+
+ </body>
+</html>
View
99 category/performance/index.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>SKURO! -- Shading lights</title>
+ <meta name="generator" content="skuro.tk/0.1 | jekyll/0.11.0" />
+ <meta charset="utf-8" />
+ <meta name="description" content="Personal Blog of Carlo Sciolla" />
+ <meta name="keywords" content="clojure,enlive,moustache,java,alfresco,lambdalf,performance" />
+ <link rel="stylesheet" href="/stylesheets/styles.css" />
+ <link rel="stylesheet" href="/stylesheets/pygment_trac.css" />
+ <link rel="stylesheet" href="/stylesheets/skuro.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
+
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ </head>
+ <body>
+ <div class="adsense">
+ <script type="text/javascript"><!--
+ google_ad_client = "ca-pub-5536661153340295";
+ /* ghpages-skyscraper */
+ google_ad_slot = "1277668326";
+ google_ad_width = 120;
+ google_ad_height = 600;
+ //-->
+ </script>
+ <script type="text/javascript"
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+ </script>
+ </div>
+ <div class="wrapper">
+ <header>
+ <span class="avatar">
+ <img src="http://www.gravatar.com/avatar/3246c43cf35485e40a18e72fa1fa7ace" />
+ </span>
+ <h1><a href="/">SKURO!</a></h1>
+ <ul>
+ <li><a href="/archive">Browse the <strong>Archive</strong></a></li>
+ <li><a href="/category">Browse by <strong>Categories</strong></a></li>
+ <li><a href="/about">Learn more <strong>About me</strong></a></li>
+ </ul>
+ <p class="persona">
+ <a href="https://github.com/skuro"><img src="/img/github.png" /></a>
+ <a href="http://nl.linkedin.com/in/carlosciolla"><img src="/img/linkedin.png" /></a>
+ <a href="https://twitter.com/skuro"><img src="/img/twitter.png" /></a>
+ <a href="/rss2.xml"><img src="/img/rss.png" /></a>
+ <span>shading lights</span>
+ </p>
+ </header>
+
+ <section>
+ <div class="post">
+ <h1 class="title">
+ Posts filed under <a href="category/performance/index.html">#performance</a>
+ </h1>
+ <div id="archive" class="archive">
+ <ul>
+
+ <li>
+ <span class="date"> 6 March 2013</span>
+ <a href="/2013/03/06/java-stringbuilder-myth">Java StringBuilder myth debunked</a>
+ <span class="categories">
+
+ <a class="tag" href="/category/java">#java</a>
+
+ <a class="tag" href="/category/performance">#performance</a>
+
+ <a class="tag" href="/category/development">#development</a>
+
+ </span>
+</li>
+
+
+ </ul>
+ </div>
+</div>
+
+ </section>
+
+ </div>
+ <footer>
+ <p><a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license"><img src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" style="border-width:0;margin-bottom:10px" alt="Creative Commons License" /></a> licensed under a Creative Commons <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">license</a>
+ <p><span rel="dct:type" property="dct:title" href="http://purl.org/dc/dcmitype/Text">SKURO! blog</span> by <a rel="cc:attributionURL" property="cc:attributionName" href="http://skuro.tk">Carlo Sciolla</a></p>
+ </footer>
+
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try{
+ var pageTracker = _gat._getTracker("UA-6754361-1");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+
+ </body>
+</html>
View
99 category/spring/index.html
@@ -0,0 +1,99 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+ <head>
+ <title>SKURO! -- Shading lights</title>
+ <meta name="generator" content="skuro.tk/0.1 | jekyll/0.11.0" />
+ <meta charset="utf-8" />
+ <meta name="description" content="Personal Blog of Carlo Sciolla" />
+ <meta name="keywords" content="clojure,enlive,moustache,java,alfresco,lambdalf,performance" />
+ <link rel="stylesheet" href="/stylesheets/styles.css" />
+ <link rel="stylesheet" href="/stylesheets/pygment_trac.css" />
+ <link rel="stylesheet" href="/stylesheets/skuro.css" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
+
+ <!--[if lt IE 9]>
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
+ <![endif]-->
+ </head>
+ <body>
+ <div class="adsense">
+ <script type="text/javascript"><!--
+ google_ad_client = "ca-pub-5536661153340295";
+ /* ghpages-skyscraper */
+ google_ad_slot = "1277668326";
+ google_ad_width = 120;
+ google_ad_height = 600;
+ //-->
+ </script>
+ <script type="text/javascript"
+ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
+ </script>
+ </div>
+ <div class="wrapper">
+ <header>
+ <span class="avatar">
+ <img src="http://www.gravatar.com/avatar/3246c43cf35485e40a18e72fa1fa7ace" />
+ </span>
+ <h1><a href="/">SKURO!</a></h1>
+ <ul>
+ <li><a href="/archive">Browse the <strong>Archive</strong></a></li>
+ <li><a href="/category">Browse by <strong>Categories</strong></a></li>
+ <li><a href="/about">Learn more <strong>About me</strong></a></li>
+ </ul>
+ <p class="persona">
+ <a href="https://github.com/skuro"><img src="/img/github.png" /></a>
+ <a href="http://nl.linkedin.com/in/carlosciolla"><img src="/img/linkedin.png" /></a>
+ <a href="https://twitter.com/skuro"><img src="/img/twitter.png" /></a>
+ <a href="/rss2.xml"><img src="/img/rss.png" /></a>
+ <span>shading lights</span>
+ </p>
+ </header>
+
+ <section>
+ <div class="post">
+ <h1 class="title">
+ Posts filed under <a href="category/spring/index.html">#spring</a>
+ </h1>
+ <div id="archive" class="archive">
+ <ul>
+
+ <li>
+ <span class="date">10 March 2013</span>
+ <a href="/2013/03/10/observer-pattern-spring-framework">The Observer Pattern in Spring</a>
+ <span class="categories">
+
+ <a class="tag" href="/category/java">#java</a>
+
+ <a class="tag" href="/category/spring">#spring</a>
+
+ <a class="tag" href="/category/patterns">#patterns</a>
+
+ </span>
+</li>
+
+
+ </ul>
+ </div>
+</div>
+
+ </section>
+
+ </div>
+ <footer>
+ <p><a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license"><img src="http://i.creativecommons.org/l/by-sa/3.0/88x31.png" style="border-width:0;margin-bottom:10px" alt="Creative Commons License" /></a> licensed under a Creative Commons <a href="http://creativecommons.org/licenses/by-sa/3.0/" rel="license">license</a>
+ <p><span rel="dct:type" property="dct:title" href="http://purl.org/dc/dcmitype/Text">SKURO! blog</span> by <a rel="cc:attributionURL" property="cc:attributionName" href="http://skuro.tk">Carlo Sciolla</a></p>
+ </footer>
+
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try{
+ var pageTracker = _gat._getTracker("UA-6754361-1");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+
+ </body>
+</html>
View
87 index.html
@@ -56,72 +56,85 @@
<!-- copied from post_header include -->
<h1>
- A svn post commit hook to comment on Jira
- <a href="/2013/02/18/svn-postcommit-hook-jira-comments">
- <img src="/img/link.jpg" alt="Permalink to A svn post commit hook to comment on Jira" />
+ The Observer Pattern in Spring
+ <a href="/2013/03/10/observer-pattern-spring-framework">
+ <img src="/img/link.jpg" alt="Permalink to The Observer Pattern in Spring" />
</a>
</h1>
<blockquote class="date-wrapper">
<h5 class="date">
- February 18, 2013
+ March 10, 2013
&nbsp;
- <a class="tag" href="/category/subversion">#subversion</a><span>&nbsp;&nbsp;</span>
+ <a class="tag" href="/category/java">#java</a><span>&nbsp;&nbsp;</span>
- <a class="tag" href="/category/jira">#jira</a><span>&nbsp;&nbsp;</span>
+ <a class="tag" href="/category/spring">#spring</a><span>&nbsp;&nbsp;</span>
- <a class="tag" href="/category/development">#development</a><span>&nbsp;&nbsp;</span>
-
- <a class="tag" href="/category/software">#software</a><span>&nbsp;&nbsp;</span>
+ <a class="tag" href="/category/patterns">#patterns</a><span>&nbsp;&nbsp;</span>
</h5>
</blockquote>
<!-- end copy -->
- <img src="/img/post/jirasvn.png" class="primary" />
+ <img src="http://mimg.ugo.com/200907/10229/cuts/the-observer_288x288.jpg" class="primary" />
- <p>If I had to pick a single thing that really bothers me of <a href="https://confluence.atlassian.com/display/AOD/JIRA+OnDemand">Jira OnDemand</a>
-is that it <a href="https://jira.atlassian.com/browse/AOD-710">doesn't support our hosted svn</a> in any
-possible way.</p>
+ <h1>Observers in Spring</h1>
+
+<blockquote><p>To the man-in-the-street, who, I'm sorry to say,<br/>
+Is a keen observer of life,<br/>
+The word "Intellectual" suggests straight away<br/>
+A man who's untrue to his wife.</p>
+
+<p>-- W.H. Auden</p></blockquote>
+
+<p>The Observer pattern is a very basic one out of the GoF bible which is unbelivably easy to implement and still quote
+powerful so use. Here I present my take on it using the Spring observer pattern which I found quite helpful in designing
+extension points for my software.</p>
+
+<h1>Core classes</h1>
-<p>The biggest pain developers like me have without any basic integration between the VCS and the ticketing system is that any time you have to
-test an issue, perform some code reviews, sort out some merging or simply digging the history of a given piece of code, it wastes your time to
-switch between all of your unconnected tools to accomplish your task. As an example, at <a href="http://www.backbase.com">Backbase</a> we use
-<a href="http://trac.edgewall.org/">Trac</a> to look at our code on a browser, and we end up having to type URLs by hand to switch on and off Jira.</p>
+<p>Pushing back the little NIH devil whispering in my ears, I started by reusing the standard building blocks for the
+Observer pattern: <code>java.util.Observable</code> and <code>java.util.Observer</code>. The Observable class provides the logic to handle a
+registry of Observers, and to propagate updates (I prefer to think more of in terms of events) to all of the registered
+Observers.</p>
-<p>How hard could it be to simply <em>link</em> Jira to our commits?</p>
+<p>In the context of a Spring container, there will be beans to configure and hook together, and it's key to this exercise
+to find a flexible and handy way to connect things together.</p>
-<h2>A hint to the solution</h2>
+<h1>Automatic registration</h1>
-<p>Looking at a way to fix this issue, I first had an intuition: what our Jira <em>does</em> support are web links to an issue. Trac is
-just another web site, why can't we use application links instead of listing the commit messages as Jira comments? After all,
-there's a <a href="https://developer.atlassian.com/display/JIRADEV/JIRA+REST+API+for+Remote+Issue+Links">rich API</a> that I can use to
-script the hell out of our commits! It literally took me 40 minutes to come up with the following:</p>
+<p>Supporting code for this blog post can be found on <a href="https://github.com/skuro/spring-observer">GitHub</a>.</p>
-<script src="https://gist.github.com/skuro/4981464.js"></script>
+<p>When developing a Spring application you're always instantiating your classes as singletons within the Spring container.
+Annotations or XML configurations will take care of initialize instances of your classes, wiring them together in a
+connected graph of objects with loose dependencies on the specific concrete classes you adopt in your code.</p>
+<p>As you will always have to declare beans, it would be nice to let Spring wire obects for you in an Observer fashion,
+with a minimal coding effort required. The most minimalistic approach I could think of is to just require developers to
+declare their observer beans, and put in place enough machinery to automatically hook them to an Observable provided by
+the application. In this example I create a <code>ObserverBeanPostProcessor</code> and a <code>SpringObserver</code>
+tagging interface to identify which beans are actually declaring valid Observers, and register them automatically.</p>
-<p>It currently features:</p>
+<p>To complete the picture, the <code>SpringObservable</code> interface declares which <code>Observer</code> class it's able to notify, thus
+leveraging the tagging interface and letting the <code>ObserverBeanPostProcessor</code> know which beans to filter and registser.</p>
-<ul>
-<li>creates a <em>Related commits</em> link on each Jira issue mentioned in your commit comment</li>
-<li>multiple Jira keys in the same commit message supported</li>
-</ul>
+<p>This enables a software component to provide the desired <code>SpringObservable</code> and the <code>ObserverBeanPostProcessor</code> beans, where
+consumers of such API will be only required to instantiate their <code>Observer</code> beans.</p>
+<p>Note that <code>Observers</code> can be themselves <code>Observables</code>, so that you can easily construct chains of beans in which events
+will be propagated. As long as you ensure not to form any cyclic graph, of course.</p>
-<p>That's it. Not an impressive list of features, but enough for 40m hacking on bash scripts. When we'll have this hook installed
-in our svn server, we can easily go from the Jira issue to all the diffs associated with it.</p>
+<h1>Conclusions</h1>
-<p>This facilitates code reviews and
-issue verification or analysis at a later stage, enormously simplifying the life of every developer by providing that dead-simple
-integration that Atlassian doesn't want to provide out of the box.</p>
+<p>In object oriented languages such as Java, patterns are a powerful tool to apply. The Observer is a neat strategy for
+cascading changes on objects, or just to propagate events through a series of processors. All in a clean, loosly coupled
+fashion.</p>
-<p>I understand the performance reasons behind avoid fully integrating
-on-premise svn with OnDemand instances. Still, they could do much, much better than say they're sorry and live their customers
-lives being miserable because of it.</p>
+<p>The code here is just a proof of concept, not a library which is intended for production use. The concepts and the
+implementation are easy enough to be applied in your Spring application without any need for depending on this code.</p>
</div>
View
125 rss2.xml
@@ -3,14 +3,87 @@
<title type="text" xml:lang="en">SKURO! -- Shading lights</title>
<link type="application/atom+xml" href="http://skuro.tk/rss2/" rel="self"/>
<link type="text" href="http://skuro.tk" rel="alternate"/>
- <updated>2013-02-19T00:05:54+01:00</updated>
+ <updated>2013-03-10T00:10:08+01:00</updated>
<id>http://skuro.tk</id>
<author>
<name>Carlo Sciolla</name>
</author>
<rights>Copyright (c) 2010-2011 Carlo Sciolla</rights>
<entry>
+ <title>The Observer Pattern in Spring</title>
+ <link href="http://skuro.tk/2013/03/10/observer-pattern-spring-framework/"/>
+ <updated>2013-03-10T00:00:00+01:00</updated>
+ <id>http://skuro.tk/2013/03/10/observer-pattern-spring-framework/</id>
+ <summary type="html">&lt;h1&gt;Observers in Spring&lt;/h1&gt;
+
+&lt;blockquote&gt;&lt;p&gt;To the man-in-the-street, who, I'm sorry to say,&lt;br/&gt;
+Is a keen observer of life,&lt;br/&gt;
+The word &quot;Intellectual&quot; suggests straight away&lt;br/&gt;
+A man who's untrue to his wife.&lt;/p&gt;
+
+&lt;p&gt;-- W.H. Auden&lt;/p&gt;&lt;/blockquote&gt;
+
+&lt;p&gt;The Observer pattern is a very basic one out of the GoF bible which is unbelivably easy to implement and still quote
+powerful so use. Here I present my take on it using the Spring observer pattern which I found quite helpful in designing
+extension points for my software.&lt;/p&gt;
+
+&lt;h1&gt;Core classes&lt;/h1&gt;
+
+&lt;p&gt;Pushing back the little NIH devil whispering in my ears, I started by reusing the standard building blocks for the
+Observer pattern: &lt;code&gt;java.util.Observable&lt;/code&gt; and &lt;code&gt;java.util.Observer&lt;/code&gt;. The Observable class provides the logic to handle a
+registry of Observers, and to propagate updates (I prefer to think more of in terms of events) to all of the registered
+Observers.&lt;/p&gt;
+
+&lt;p&gt;In the context of a Spring container, there will be beans to configure and hook together, and it's key to this exercise
+to find a flexible and handy way to connect things together.&lt;/p&gt;
+
+&lt;h1&gt;Automatic registration&lt;/h1&gt;
+
+&lt;p&gt;Supporting code for this blog post can be found on &lt;a href=&quot;https://github.com/skuro/spring-observer&quot;&gt;GitHub&lt;/a&gt;.&lt;/p&gt;
+
+&lt;p&gt;When developing a Spring application you're always instantiating your classes as singletons within the Spring container.
+Annotations or XML configurations will take care of initialize instances of your classes, wiring them together in a
+connected graph of objects with loose dependencies on the specific concrete classes you adopt in your code.&lt;/p&gt;
+
+&lt;p&gt;As you will always have to declare beans, it would be nice to let Spring wire obects for you in an Observer fashion,
+with a minimal coding effort required. The most minimalistic approach I could think of is to just require developers to
+declare their observer beans, and put in place enough machinery to automatically hook them to an Observable provided by
+the application. In this example I create a &lt;code&gt;ObserverBeanPostProcessor&lt;/code&gt; and a &lt;code&gt;SpringObserver&lt;/code&gt;
+tagging interface to identify which beans are actually declaring valid Observers, and register them automatically.&lt;/p&gt;
+
+&lt;p&gt;To complete the picture, the &lt;code&gt;SpringObservable&lt;/code&gt; interface declares which &lt;code&gt;Observer&lt;/code&gt; class it's able to notify, thus
+leveraging the tagging interface and letting the &lt;code&gt;ObserverBeanPostProcessor&lt;/code&gt; know which beans to filter and registser.&lt;/p&gt;
+
+&lt;p&gt;This enables a software component to provide the desired &lt;code&gt;SpringObservable&lt;/code&gt; and the &lt;code&gt;ObserverBeanPostProcessor&lt;/code&gt; beans, where
+consumers of such API will be only required to instantiate their &lt;code&gt;Observer&lt;/code&gt; beans.&lt;/p&gt;
+
+&lt;p&gt;Note that &lt;code&gt;Observers&lt;/code&gt; can be themselves &lt;code&gt;Observables&lt;/code&gt;, so that you can easily construct chains of beans in which events
+will be propagated. As long as you ensure not to form any cyclic graph, of course.&lt;/p&gt;
+
+&lt;h1&gt;Conclusions&lt;/h1&gt;
+
+&lt;p&gt;In object oriented languages such as Java, patterns are a powerful tool to apply. The Observer is a neat strategy for
+cascading changes on objects, or just to propagate events through a series of processors. All in a clean, loosly coupled
+fashion.&lt;/p&gt;
+
+&lt;p&gt;The code here is just a proof of concept, not a library which is intended for production use. The concepts and the
+implementation are easy enough to be applied in your Spring application without any need for depending on this code.&lt;/p&gt;
+</summary>
+</entry>
+
+
+<entry>
+ <title>Java StringBuilder myth debunked</title>
+ <link href="http://skuro.tk/2013/03/06/java-stringbuilder-myth/"/>
+ <updated>2013-03-06T00:00:00+01:00</updated>
+ <id>http://skuro.tk/2013/03/06/java-stringbuilder-myth/</id>
+ <summary type="html">
+</summary>
+</entry>
+
+
+<entry>
<title>A svn post commit hook to comment on Jira</title>
<link href="http://skuro.tk/2013/02/18/svn-postcommit-hook-jira-comments/"/>
<updated>2013-02-18T00:00:00+01:00</updated>
@@ -777,55 +850,5 @@ hibernate.dialect=org.hibernate.dialect.H2Dialect
</entry>
-<entry>
- <title>Verifying my Technorati claim</title>
- <link href="http://skuro.tk/2011/05/11/verifying-my-technorati-claim/"/>
- <updated>2011-05-11T00:00:00+02:00</updated>
- <id>http://skuro.tk/2011/05/11/verifying-my-technorati-claim/</id>
- <summary type="html">&lt;p&gt;You can safely ignore this entry, as it's only to comply to &lt;a href=&quot;http://technorati.com/&quot;&gt;technorati&lt;/a&gt; request to add a random code in a blog post to validate it.&lt;/p&gt;
-
-&lt;p&gt;I placed the code in this page, can you spot it?&lt;/p&gt;
-
-&lt;p&gt;&lt;span style=&quot;color: #ffffff;&quot;&gt; UVBRKNJTRFH7&lt;/span&gt;&lt;/p&gt;
-
-&lt;p&gt;&amp;nbsp;&lt;br/&gt;
-&amp;nbsp;&lt;br/&gt;
-&amp;nbsp;&lt;br/&gt;
-&amp;nbsp;&lt;br/&gt;
-&amp;nbsp;&lt;/p&gt;
-</summary>
-</entry>
-
-
-<entry>
- <title>More Clojure for Spring Surf</title>
- <link href="http://skuro.tk/2011/05/10/more-clojure-for-spring-surf/"/>
- <updated>2011-05-10T00:00:00+02:00</updated>
- <id>http://skuro.tk/2011/05/10/more-clojure-for-spring-surf/</id>
- <summary type="html">&lt;p&gt;After some time from my &lt;a href=&quot;http://www.skuro.tk/2010/05/23/spring-surf-meets-clojure&quot;&gt;initial announcement&lt;/a&gt;, I've started again working on my &lt;a href=&quot;https://github.com/skuro/spring-webscripts-addon-clojure&quot;&gt;Clojure addon for Spring Surf&lt;/a&gt;. While it's still a rudimentary piece of glue code, it's now getting better and better, so much that I decided it's good enough now to release an alpha version on &lt;a href=&quot;http://clojars.org/it.sk.spring.surf.clojure/spring-webscripts-addon-clojure&quot;&gt;clojars&lt;/a&gt;. Here's what this library currently provides:&lt;/p&gt;
-
-&lt;ul&gt;
- &lt;li&gt;a &lt;a href=&quot;https://github.com/skuro/spring-webscripts-addon-clojure/blob/master/src/main/java/org/springframework/extensions/webscripts/processor/ClojureScriptProcessor.java&quot;&gt;ScriptProcessor&lt;/a&gt; that allows webscript controllers to be written in Clojure&lt;/li&gt;
- &lt;li&gt;&lt;a href=&quot;https://github.com/skuro/spring-webscripts-addon-clojure/blob/master/src/main/clojure/spring/surf/webscript.clj&quot;&gt;a &lt;em&gt;WebScript&lt;/em&gt; protocol and some utility functions&lt;/a&gt; to ease development of your own web scripts&lt;/li&gt;
- &lt;li&gt;enough &lt;a href=&quot;https://github.com/skuro/spring-webscripts-addon-clojure/tree/master/src/main/resources/org/springframework/extensions/clj/webscripts&quot;&gt;spring configuration&lt;/a&gt; to enable this addon just by importing the provided contextes&lt;/li&gt;
-&lt;/ul&gt;
-
-
-&lt;p&gt;The approach is indeed easy and hopefully straightforward: the idea is to have your WebScript clojure controllers return an instance of a concrete implementation of the WebScript protocol, which will implement the &lt;em&gt;run&lt;/em&gt; method the way you like.&lt;/p&gt;
-
-&lt;p&gt;Here's the sample code from a &lt;a href=&quot;https://gist.github.com/965008&quot;&gt;gist&lt;/a&gt; you might want to have a look at to better understand how to use this library:&lt;/p&gt;
-
-&lt;script src=&quot;https://gist.github.com/965008.js?file=sample.get.clj&quot;&gt;&lt;/script&gt;
-
-
-&lt;p&gt;You can also find other samples in the project &lt;a href=&quot;https://github.com/skuro/spring-webscripts-addon-clojure/tree/master/src/test/resources/webscripts/test&quot;&gt;tests&lt;/a&gt;.&lt;/p&gt;
-
-&lt;p&gt;The next episode will be about &lt;a href=&quot;https://github.com/skuro/lambdalf&quot;&gt;&lt;em&gt;lambdalf&lt;/em&gt;&lt;/a&gt;, an Alfresco AMP I've been initially developing to prove the Clojure surf addon works fine, but that is now growing to be a full blown project by itself: a Clojure API for Alfresco!&lt;/p&gt;
-
-&lt;p&gt;Stay tuned. &lt;span style=&quot;color: #ffffff;&quot;&gt;UVBRKNJTRFH7&lt;/span&gt;&lt;/p&gt;
-</summary>
-</entry>
-
-
</feed>
View
30 sitemap.xml
@@ -3,7 +3,7 @@
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://skuro.tk/</loc>
- <lastmod>2013-02-19T00:05:54+01:00</lastmod>
+ <lastmod>2013-03-10T00:10:08+01:00</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
@@ -15,6 +15,20 @@
</url>
<url>
+ <loc>http://skuro.tk/2013/03/10/observer-pattern-spring-framework/</loc>
+ <lastmod>2013-03-10T00:00:00+01:00</lastmod>
+ <changefreq>weekly</changefreq>
+ <priority>0.8</priority>
+ </url>
+
+ <url>
+ <loc>http://skuro.tk/2013/03/06/java-stringbuilder-myth/</loc>
+ <lastmod>2013-03-06T00:00:00+01:00</lastmod>
+ <changefreq>weekly</changefreq>
+ <priority>0.8</priority>
+ </url>
+
+ <url>
<loc>http://skuro.tk/2013/02/18/svn-postcommit-hook-jira-comments/</loc>
<lastmod>2013-02-18T00:00:00+01:00</lastmod>
<changefreq>weekly</changefreq>
@@ -140,18 +154,4 @@
<priority>0.8</priority>
</url>
- <url>
- <loc>http://skuro.tk/2011/05/11/verifying-my-technorati-claim/</loc>
- <lastmod>2011-05-11T00:00:00+02:00</lastmod>
- <changefreq>weekly</changefreq>
- <priority>0.8</priority>
- </url>
-
- <url>
- <loc>http://skuro.tk/2011/05/10/more-clojure-for-spring-surf/</loc>
- <lastmod>2011-05-10T00:00:00+02:00</lastmod>
- <changefreq>weekly</changefreq>
- <priority>0.8</priority>
- </url>
-
</urlset>

0 comments on commit a8f4adc

Please sign in to comment.