<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>let x=x &#187; architecture</title>
	<atom:link href="http://www.crazymcphee.net/x/category/tech/architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.crazymcphee.net/x</link>
	<description>programming idiom and methodology</description>
	<lastBuildDate>Fri, 27 Jan 2012 09:36:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>High-performance system design by declarative specification</title>
		<link>http://www.crazymcphee.net/x/2011/11/28/high-performance-system-design-by-declarative-specification/</link>
		<comments>http://www.crazymcphee.net/x/2011/11/28/high-performance-system-design-by-declarative-specification/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 02:04:51 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[agile architecture]]></category>
		<category><![CDATA[business process]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[features]]></category>
		<category><![CDATA[i'm taking up drinking as a hobby instead of programming]]></category>
		<category><![CDATA[poorly attempted humour]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[requirements]]></category>
		<category><![CDATA[specification]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=705</guid>
		<description><![CDATA[&#8220;I want to get from London to New York in 12 minutes.&#8221; &#8220;Ok, we will have to design and build some sort of ICBM or buy one, that will cost a lot of money. Also, I&#8217;m not even sure you can get an ICBM that&#8217;s fast enough for that distance. And have we thought about [...]]]></description>
			<content:encoded><![CDATA[<p><em>&#8220;I want to get from London to New York in 12 minutes.&#8221;</em></p>
<p>&#8220;Ok, we will have to design and build some sort of ICBM or buy one, that will cost a lot of money. Also, I&#8217;m not even sure you can get an ICBM that&#8217;s fast enough for that distance. And have we thought about acquiring land for the launch site or what sort of launch system will we considering?.&#8221;</p>
<p><em>&#8220;But I want to do it in my car.&#8221;</em></p>
<p>&#8220;Oh, well, that&#8217;s a big ICBM, to hurtle that sort of load in that sort of timeframe across that sort of distance. Molto-dinero. Also, re-entry procedures at the New York end could be tricky and &#8230;&#8221;</p>
<p><em>&#8220;No, I meant, I want my car to be used for the journey.&#8221;</em></p>
<p>&#8220;But that&#8217;s not possible!&#8221;</p>
<p><em>&#8220;What sort of engineer are you? Can&#8217;t you just soup it up a little?&#8221;</em></p>
<p>&#8220;Well even if we could make your car amphibious, there&#8217;s no way it can travel 5,500 kilometres in 12 minutes&#8221;</p>
<p><em>&#8220;I don&#8217;t want an amphibious car!&#8221;</em></p>
<p>&#8220;Have you considered a ship of some type?&#8221;</p>
<p><em>&#8220;Yes a ship will get me and my car to New York.&#8221;</em></p>
<p>&#8220;Excellent. It takes about a week for a ship to cross the Atlantic I believe.&#8221;</p>
<p><em>&#8220;But I just said in my specification that it has to take 12 minutes! Also I wish to travel via the Pacific Ocean, as it is prettier this time of year.&#8221;</em></p>
<p>&#8221; &#8230; !!! &#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/11/28/high-performance-system-design-by-declarative-specification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Frustrated Architect</title>
		<link>http://www.crazymcphee.net/x/2011/11/16/the-frustrated-architect/</link>
		<comments>http://www.crazymcphee.net/x/2011/11/16/the-frustrated-architect/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 11:48:34 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[agile]]></category>
		<category><![CDATA[agile architecture]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[craftsmanship]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[methodology]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=701</guid>
		<description><![CDATA[An interesting set of slides by Simon Brown from a talk he gave about the role of the architect. A PDF is attached to the linked post or you can view the slides online. Wish I had heard the talk (see below). The Frustrated Architect: Software architecture plays a pivotal role in the delivery of [...]]]></description>
			<content:encoded><![CDATA[<p>An interesting set of slides by Simon Brown from a talk he gave about the role of the architect. A PDF is attached to the linked post or you can view the slides online. <strike>Wish I had heard the talk</strike> (see below).</p>
<p><a href="http://www.codingthearchitecture.com/presentations/skillsmatter2011-the-frustrated-architect/">The Frustrated Architect</a>:</p>
<blockquote><p>Software architecture plays a pivotal role in the delivery of successful software yet it&#8217;s frustratingly neglected by many teams. Whether performed by one person or shared amongst the team, the architecture role exists on even the most agile of teams yet the balance of up front and evolutionary thinking often reflects aspiration rather than reality.</p></blockquote>
<p>(Via <a href="http://www.codingthearchitecture.com/">coding the architecture</a>.)</p>
<p><strong>Update</strong> &#8211; if you go to <a href="http://skillsmatter.com/podcast/java-jee/frustrated-architect">this page</a> you can get a video of the presentation; it&#8217;s about an hour long. A word of warning: I couldn&#8217;t make the video play on the site with Chrome, I had to use Safari.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/11/16/the-frustrated-architect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Social Graph is Neither (Pinboard Blog)</title>
		<link>http://www.crazymcphee.net/x/2011/11/10/the-social-graph-is-neither-pinboard-blog/</link>
		<comments>http://www.crazymcphee.net/x/2011/11/10/the-social-graph-is-neither-pinboard-blog/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 07:02:42 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[apps]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[social media]]></category>
		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=696</guid>
		<description><![CDATA[The Social Graph is Neither (Pinboard Blog): You might almost think that the whole scheme had been cooked up by a bunch of hyperintelligent but hopelessly socially naive people, and you would not be wrong. Asking computer nerds to design social software is a little bit like hiring a Mormon bartender. Our industry abounds in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.pinboard.in/2011/11/the_social_graph_is_neither/">The Social Graph is Neither (Pinboard Blog)</a>:</p>
<blockquote><p>You might almost think that the whole scheme had been cooked up by a bunch of hyperintelligent but hopelessly socially naive people, and you would not be wrong. Asking computer nerds to design social software is a little bit like hiring a Mormon bartender. Our industry abounds in people for whom social interaction has always been more of a puzzle to be reverse-engineered than a good time to be had, and the result is these vaguely Martian protocols.</p>
</blockquote>
<p>(Via <a href="http://blog.pinboard.in/">Pinboard Blog</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/11/10/the-social-graph-is-neither-pinboard-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>blog link: world–</title>
		<link>http://www.crazymcphee.net/x/2011/10/14/blog-link-world%e2%80%93/</link>
		<comments>http://www.crazymcphee.net/x/2011/10/14/blog-link-world%e2%80%93/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 09:28:34 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[craftsmanship]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/2011/10/14/blog-link-world%e2%80%93/</guid>
		<description><![CDATA[world– by Robert Merkel at Larvatus Prodeo. Published October 14, 2011 at 09:02AM The technology world has just lost another giant, though one without the towering public persona of Steve Jobs. If you’re not actually a programmer, you’ve probably never heard of Dennis Ritchie. But the vast majority of software you use was built using [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://larvatusprodeo.net/2011/10/14/world/">world–</a> by Robert Merkel at <a href="http://larvatusprodeo.net">Larvatus Prodeo</a>. Published October 14, 2011 at 09:02AM</p>
<blockquote><p>The technology world has just lost another giant, though one without the towering public persona of Steve Jobs.</p>
<p>If you’re not actually a programmer, you’ve probably never heard of <a href="http://www.washingtonpost.com/blogs/blogpost/post/dennis-ritchie-father-of-c-programming-language-and-unix-dies-at-70/2011/10/13/gIQADGNbhL_blog.html">Dennis Ritchie</a>. But the vast majority of software you use was built using a tool that he originally designed, and the rest by tools that very liberally sample from his.</p>
<p>The “native language” that the central processor in a computer understands is an ornery beast. For one thing, back in the 1970s every two-bit computer company (if you’ll pardon the techy pun) had its own native language; these days, there still remain two very common ones, and dozens of less common examples out there. More importantly, it’s almost incomprehensible, even to most programmers. Take this little snippet, part of the preliminaries to a very simple program that just prints the message “hello, world” to the screen:</p>
<pre>_start:
        mov    eax, 4
        mov    ebx, 1
        mov    ecx, str
        mov    edx, str_len
        int    80h</pre>
<p>Writing long and complicated bits of software with such unhelpful notation is extremely slow and error-prone.</p>
<p>“High-level” languages, that allowed the logic of software to be expressed in more compact and readable notation, had existed since the 1950s; <a href="http://en.wikipedia.org/wiki/Grace_Hopper">Grace Hopper</a> was responsible for one of the first. Over time, more and more of the scientific and business software run on the large computers of the era was written in FORTRAN, COBOL, and other high-level langages. However, the “operating systems”, the software plumbing that joined those applications to the hardware, was invariably written in the machine language of specific systems.</p>
<p>In the late 1960s, Ritchie, working with Ken Thompson at Bell Laboratories, hacked together their own little operating system for an obsolete computer nobody was making use of. It was small, but it worked, and was one of the first practical systems to support “timesharing” – the ability for multiple users to run multiple programs simultaneously and interactively. Fairly early on, they had another brainwave; they would rewrite as much of the system – which became known as Unix – as possible in a high-level programming language, to speed development. But first, they needed a suitable high-level language. The resulting language, an evolution of earlier languages entitled BCPL and B, was called “C”.</p>
<p>Both C and Unix were raging successes, partly because of their inherent strengths. The use of C allowed Unix to be “ported” to many different computer systems, a process that continues today as its spiritual successor Linux, written in C, runs on everything from IBM mainframes (and the amphormous “Googleplex” of Google’s servers which, reportedly, draw 240 megawatts of power), to virtually every smartphone on the planet (the iPhone’s operating system is not Linux, but it is also a derivation of Unix and substantial parts are written in C). They also had the good fortune, as with the Internet and World Wide Web which owes so much to both, that they gradually escaped the crush of intellectual property law to become part of the intellectual commons of the field.</p>
<p>Almost as important was the elegance and economy that Ritchie, along with Brian Kernighan, brought to teaching the language. Their textbook <a href="http://en.wikipedia.org/wiki/The_C_Programming_Language">The C Programming Language</a> remains the best programming language textbook ever written, in my view, and the one that I still strongly recommend to my students.</p>
<p>Much of the Windows operating system, and Mac OS X, are implemented in C. Those parts that aren’t, are implemented in computer languages directly derived from it – C++ and Objective-C. Most of the software that runs on those systems is also written in C or its successor languages. And perhaps the most pervasive “new” high-level language of the last 20 years – Java – retains so much of C’s “look and feel” that it often takes a second glance to tell which language a piece of code is written in.</p>
<p>Neither C nor Unix were by any means perfect. While some of its design faults have been eliminated in its successors others remain, and will likely continue to bamboozle neophyte (and, all too often, experienced) programmers, for generations to come. But there was so much he and his colleagues got right. Fate did play its part, but there are very good reasons that generations of software developers not yet born will express themselves in notations largely based on Ritchie’s.</p>
<p>RIP, dmr.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/10/14/blog-link-world%e2%80%93/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dennis Ritchie: The Shoulders Steve Jobs Stood On &#124; Wired Enterprise &#124; Wired.com</title>
		<link>http://www.crazymcphee.net/x/2011/10/14/dennis-ritchie-the-shoulders-steve-jobs-stood-on-wired-enterprise-wired-com/</link>
		<comments>http://www.crazymcphee.net/x/2011/10/14/dennis-ritchie-the-shoulders-steve-jobs-stood-on-wired-enterprise-wired-com/#comments</comments>
		<pubDate>Fri, 14 Oct 2011 09:28:02 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=662</guid>
		<description><![CDATA[“Jobs’ genius is that he builds these products that people really like to use because he has taste and can build things that people really find compelling. Ritchie built things that technologists were able to use to build core infrastructure that people don’t necessarily see much anymore, but they use everyday.” via Dennis Ritchie: The [...]]]></description>
			<content:encoded><![CDATA[<p>“Jobs’ genius is that he builds these products that people really like to use because he has taste and can build things that people really find compelling. Ritchie built things that technologists were able to use to build core infrastructure that people don’t necessarily see much anymore, but they use everyday.”</p>
<p>via <a href="http://www.wired.com/wiredenterprise/2011/10/thedennisritchieeffect">Dennis Ritchie: The Shoulders Steve Jobs Stood On | Wired Enterprise | Wired.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/10/14/dennis-ritchie-the-shoulders-steve-jobs-stood-on-wired-enterprise-wired-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spring, JPA/JTA, and multiple persistence units, with view transactions</title>
		<link>http://www.crazymcphee.net/x/2011/10/13/spring-jpajta-and-multiple-persistence-units-with-view-transactions/</link>
		<comments>http://www.crazymcphee.net/x/2011/10/13/spring-jpajta-and-multiple-persistence-units-with-view-transactions/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 13:31:32 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=655</guid>
		<description><![CDATA[I have grappled with this topic before. Tonight, after 13 hours of struggle, I finally got my web app perfected in this regard. It all started when I needed to start the Transaction out in the view, i.e. as soon as the resource is opened on the HTTP side (rather than when the database service [...]]]></description>
			<content:encoded><![CDATA[<p>I have <a href="http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/">grappled with this topic</a> before. Tonight, after 13 hours of struggle, I finally got my web app perfected in this regard.</p>
<p>It all started when I needed to start the Transaction out in the view, i.e. as soon as the resource is opened on the HTTP side (rather than when the database service layer is called). I&#8217;m using JPA for a number of reasons;</p>
<ol>
<li>I need to access multiple databases each with a different schema (this means different connections)</li>
<li>They need to have XA transactions.</li>
<li>I&#8217;d like the transactions managed by the container (JTA).</li>
</ol>
<p>JPA provides all these things easily without all the complex Hibernate.xbm.xml mapping files and what-have-you.</p>
<p>The trick to starting the transaction with the web session is to use spring&#8217;s <span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">OpenEntityManagerInViewFilter</span>. Unfortunately I was using  <span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">PersistenceAnnotationBeanPostProcessor</span> to manage my multiple persistence units. The filter wants to know what <span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">EntityManagerFactory </span>it should bind to, and fair enough. But with my minimal configuration, there was no addressable EntityManagerFactory!</p>
<p>The solution was to stop the <span class="Apple-style-span" style="font-family: Consolas, Monaco, monospace; font-size: 12px; line-height: 18px; white-space: pre;">PersistenceAnnotationBeanPostProcessor <span class="Apple-style-span" style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-size: 13px; line-height: 19px; white-space: normal;">from doing the JNDI look ups and bind each PersistenceUnit into the Spring context with a manual JNDI lookup;</span></span></p>
<pre>  &lt;tx:annotation-driven /&gt;
  &lt;tx:jta-transaction-manager /&gt;

  &lt;bean id="pabpp" 
   class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" /&gt;</pre>
<pre>
  &lt;jee:jndi-lookup id="onePU" jndi-name="persistence/onePU" /&gt;
  &lt;jee:jndi-lookup id="twoPU" jndi-name="persistence/twoPU" /&gt;
  &lt;jee:jndi-lookup id="threePU" jndi-name="persistence/threePU" /&gt;</pre>
<p>then, in the web.xml the ViewFilter could be bound explicitly to the required persistence unit, in this case &#8220;onePU&#8221;. A fuller explanation can be found on my spring source forum post here; <a href="http://forum.springsource.org/showthread.php?115844-OpenEntityManagerInViewFilter-with-JPA-PersistenceAnnotationBeanPostProcessor">http://forum.springsource.org/showthread.php?115844-OpenEntityManagerInViewFilter-with-JPA-PersistenceAnnotationBeanPostProcessor</a></p>
<p>Overall, this is now quite an elegant solution.</p>
<p><strong>UPDATE</strong>. More documentation of the solution and the various configurations at the Spring forum here: <a href="http://forum.springsource.org/showthread.php?115587-Example-for-using-two-databases-w-Spring-amp-JTA-transaction-manager&amp;p=383432#post383432">http://forum.springsource.org/showthread.php?115587-Example-for-using-two-databases-w-Spring-amp-JTA-transaction-manager&amp;p=383432#post383432</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/10/13/spring-jpajta-and-multiple-persistence-units-with-view-transactions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UNIX timezone database shut down</title>
		<link>http://www.crazymcphee.net/x/2011/10/07/unix-timezone-database-shut-down/</link>
		<comments>http://www.crazymcphee.net/x/2011/10/07/unix-timezone-database-shut-down/#comments</comments>
		<pubDate>Thu, 06 Oct 2011 22:38:38 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[business]]></category>
		<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[copyright]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[time]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=641</guid>
		<description><![CDATA[The UNIX time zone database has been shut down because of copyright complaints! Overthrow the DCMA! http://blog.joda.org/2011/10/today-time-zone-database-was-closed.html]]></description>
			<content:encoded><![CDATA[<p>The UNIX time zone database has been shut down because of copyright complaints! Overthrow the DCMA! <a href="http://blog.joda.org/2011/10/today-time-zone-database-was-closed.html">http://blog.joda.org/2011/10/today-time-zone-database-was-closed.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/10/07/unix-timezone-database-shut-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>REST-based architectural style, a big winner</title>
		<link>http://www.crazymcphee.net/x/2011/09/15/rest-based-architectural-style-a-big-winner/</link>
		<comments>http://www.crazymcphee.net/x/2011/09/15/rest-based-architectural-style-a-big-winner/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 09:45:09 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[technical]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[emergent design]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[refactor]]></category>
		<category><![CDATA[REST]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=629</guid>
		<description><![CDATA[Recently been deeply stuck in building software (apart from starting my PhD part-time). A long time ago I wrote about dynamically loading Spring contexts and component discovery &#8211; this system I&#8217;ve been building is an evolution of that one. We decided to adopt an most REST-based style to integrate between our components. Now, &#8220;run-time&#8221; discovery [...]]]></description>
			<content:encoded><![CDATA[<p>Recently been deeply stuck in building software (apart from starting my <a href="http://monumentum.tumblr.com/">PhD</a> part-time). A long time ago I wrote about <a href="http://www.crazymcphee.net/x/2010/04/29/dynamically-loading-spring-contexts-from-the-classpath-at-runtime/">dynamically loading Spring contexts and component discovery</a> &#8211; this system I&#8217;ve been building is an evolution of that one. We decided to adopt an most REST-based style to integrate between our components. Now, &#8220;run-time&#8221; discovery and configuration is easy, a matter of scraping REST URLs for the resources they contain (or even, just assuming a resource URL will be available and finding out its capabilities, or even its unavailability. at run-time). We&#8217;re using this architecture in places where you&#8217;d otherwise be employing messaging-based systems or pure-Java database service layers. Now we just convert the payload to XML/JSON and POST/PUT/GET/DELETE etc to a http URL! You&#8217;d think that this would kill performance, but we&#8217;ve found the degradation to be minimal (it helps that our transactions tend to be infrequent, but large in data set size). This is a big saving on complexity for our system &#8211; the transaction boundaries nearly always relate to the http URL calls so no more heavy reliance on things like <a href="http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/">XA transactions and JTA Transaction Managers</a>. We still have them, as we need them in a couple of places for the moment, but it&#8217;s no longer such a big freaking deal for us in every situation.</p>
<p>Our system has generic components which &#8220;pass off&#8221; specific knowledge of specific data sets to specific processing components, where there are not a fixed set of these specific components available to all the generic components. In classic OO design this is achieved with interfaces and many design patterns like the Visitor Pattern. In our design we&#8217;ve replaced much of the complexity of the interface with REST-based architecture. Our application has become far more modular (despite its run-time complexity). More importantly, we are at the the point where we can easily start delivering the advanced features that the business has now specified for us without introducing a massive bloat-o-burger one-size-fits-all set of &#8220;common data definitions&#8221; that are the union of all possible sub-system functionalities.  Each sub-system can have its specific features required for that data set and still satisfy the handful of generic actions it is required to support. Each of these specific features can be developed in isolation. It&#8217;s a big win for us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/09/15/rest-based-architectural-style-a-big-winner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Broken Weblogic JMS &#8220;clustering&#8221;</title>
		<link>http://www.crazymcphee.net/x/2011/03/04/broken-weblogic-jms-clustering/</link>
		<comments>http://www.crazymcphee.net/x/2011/03/04/broken-weblogic-jms-clustering/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 08:54:15 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[coherence]]></category>
		<category><![CDATA[ejb]]></category>
		<category><![CDATA[jms]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[weblogic]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=606</guid>
		<description><![CDATA[I&#8217;ve ranted before that Weblogic 11g clustering/distribution technology of its messaging is fundamentally broken. Despite what Oracle claims, JMS in Weblogic is not clustered. Load balanced is a better description. It&#8217;s architectural &#8211; if any other technology (e.g. SOA Suite, EDN, etc) uses Weblogic JMS as its underlying messaging implementation, it will be broken too. [...]]]></description>
			<content:encoded><![CDATA[<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial; min-height: 17.0px} -->I&#8217;ve ranted before that Weblogic 11g clustering/distribution technology of its messaging is <a href="http://www.crazymcphee.net/x/2010/11/05/stuff-that-is-just-plain-wrong-part-1893567/">fundamentally broken</a>. Despite what Oracle claims, JMS in Weblogic is not clustered. <em>Load balanced </em>is a better description. It&#8217;s architectural &#8211; if any other technology (e.g. SOA Suite, EDN, etc) uses Weblogic JMS as its underlying messaging implementation, it will be broken too.</p>
<p>The problem is simple. In Weblogic, if you cluster a <em>logical</em> topic (or a queue) across two machines, underlying this you&#8217;ve actually got two uniquely named and non-cooperating <em>physical</em> topics, one on each member of the cluster. A topic message that is sent to the <em>logical</em> topic is delivered (copied) to both physical topics. Now, if your logical topic <em>listener</em> is also clustered, you&#8217;ve got, in effect, <em>two</em> physical topic listeners on <em>two</em> different, and non-cooperating, physical topics. The topic message is then always delivered twice &#8211; even if both listeners have <em>identical</em> durable subscription ids (i.e. indicating that they belong to the same <em>logical</em> component, which should only get the topic message once). This terrible architectural blunder occurs because there is physically underlying your logical configuration, totally separate, non-cooperating, uniquely-named topics on each of the cluster members, with what amounts to a JNDI name service hack in the middle to spray the load about your cluster. In other words, it is <em>load balanced</em>, not clustered. JMS <em>Queues</em> are the same &#8211; however its just that the implicit side-effects of the queue semantics &#8211; which ever only delivers to a single consumer even if there are many configured &#8211; means it isn&#8217;t impacted as much. Because of that semantic, a queue message is only delivered to <em>one</em> of the two physical queues (i.e. again, it&#8217;s load-balanced) so only one of your two clustered queue listeners gets the message. And there&#8217;s a terrible time-out based hack to redeliver the message to another member of your queue cluster just in case there isn&#8217;t any listener instances on the cluster that the message ends up on.</p>
<p>N.B. Coherence does not, apparently, have this massive architectural fail. If you need to do <em>clustered</em> fail-safe broadcast messaging in an Oracle Weblogic environment, do yourself a favour and use Coherence.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/03/04/broken-weblogic-jms-clustering/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Come back Gavin King, all is forgiven (Spring is the new EJB 2.1)</title>
		<link>http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/</link>
		<comments>http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 12:38:47 +0000</pubDate>
		<dc:creator>Scot Mcphee</dc:creator>
				<category><![CDATA[infrastructure and frameworks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[tools and techniques]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hibernate]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jpa]]></category>
		<category><![CDATA[persistence]]></category>
		<category><![CDATA[poorly attempted humour]]></category>
		<category><![CDATA[spring]]></category>

		<guid isPermaLink="false">http://www.crazymcphee.net/x/?p=600</guid>
		<description><![CDATA[I&#8217;ve just spent the past two days trying to make Spring transaction management work with JPA-annotated Hibernate-backed persistence classes that need to have multiple persistence units with transaction propagation REQUIRES_NEW between the two. For a start, the documentation is merely a series of outlines of brief hints. One measly section.The laughably short Spring 3 doco [...]]]></description>
			<content:encoded><![CDATA[<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial; min-height: 17.0px} -->I&#8217;ve just spent the past <em>two days </em>trying to make Spring transaction management work with JPA-annotated Hibernate-backed persistence classes that need to have multiple persistence units with transaction propagation REQUIRES_NEW between the two.</p>
<p>For a start, the documentation is merely a series of outlines of brief hints. One measly section.The laughably short Spring 3 doco section 13.5.1.4 &#8220;Dealing with multiple persistence units&#8221; conveniently omits  the transaction manager configuration from the example. The problem appears to be that the JPA transaction manager only (and compulsorily) deals with <em>one</em> entity manager factory. And an entity manager factory only deals with <em>one</em> persistence unit. So therefore you have to have <em>two</em> JPA transaction managers. Which means the two persistence unit transactions won&#8217;t co-operate properly even though they may share the underlying datasource and are configured through the single persistence unit manager bean.</p>
<p>The above scenario is totally trivial in an EJB 3 container backed with Hibernate, or Eclipselink, as the provider. About one-quarter of the configuration. If I have to use a JTA transaction manager obtained by JNDI lookup from the container, to run a transaction across two JPA persistence units which share the same underlying datasource, why the hell am I using Spring in the first place?</p>
<p>All I wanted was to isolate one set of db transactions from another, use JPA persistence units so the two sets of tables could live easily in two different schemas, and use the annotations to kill the fragile AOP regex-like-but-not-like-regex class and method pattern-matching jiggery pokery from the Spring configuration.</p>
<p>My god, this is such a stonkingly non-trivial forest of horrible configuration and a trial and error morass of filthy swamp miasma &#8230; an equivalent EJB3 backed by Hibernate JPA set up is, by comparison, an almost effortless task. I can produce a unit-tested all singing all dancing multiple persistence unit JPA app running in an EJB 3 container with XA datasources using Hibernate as the JPA implementation in almost no time at all. Getting the same thing with Spring (oh, and running some tests with Jetty inside Maven) is like having all your teeth pulled while you&#8217;re coming down from a three day methamphetamine binge. Getting Spring to run with multiple JPA persistence units on the same JDBC connection (without XA, across the same database connection) with a transaction propagation of REQUIRES_NEW on the entry point of one of the units is a hair-pulling, beard-greying, head-desk banging, co-worker punching, drunken ranting, blood-pressure raising experience of pure horror. Which apparently doesn&#8217;t end.</p>
<p><!-- p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial; min-height: 17.0px} p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 15.0px Arial} -->Die, Spring, die. Can&#8217;t come soon enough as far as I am concerned. It&#8217;s more evil than Oracle. At least you <em>know</em> with Oracle you&#8217;re in for an un-lubed hard and fast backdoor job from Ellison with no reach-around before you even unpack the box. Spring is like a beautiful young sexy soft-porn film that turns into some relentlessly horrific succubus-filled horror film half way through.</p>
<p>Seriously, its enough to make one pine for bloody Weblogic. Spring is the new EJB 2.1.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.crazymcphee.net/x/2011/02/16/come-back-gavin-king-all-is-forgiven-spring-is-the-new-ejb-2-1/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

