<?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>Gridshore &#187; DDD</title>
	<atom:link href="http://www.gridshore.nl/tag/ddd/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gridshore.nl</link>
	<description>A weblog about software engineering, Architecture, Technology an other things we like.</description>
	<lastBuildDate>Tue, 13 Dec 2011 15:36:58 +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>Axon Framework 0.6 released</title>
		<link>http://www.gridshore.nl/2010/08/08/axon-framework-0-6-released/</link>
		<comments>http://www.gridshore.nl/2010/08/08/axon-framework-0-6-released/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 17:53:45 +0000</pubDate>
		<dc:creator>Allard</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Axon Framework]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[cqrs]]></category>
		<category><![CDATA[Domain Driven Design]]></category>

		<guid isPermaLink="false">http://www.gridshore.nl/2010/08/08/axon-framework-0-6-released/</guid>
		<description><![CDATA[<p>Today, I released version 0.6 of the Axon Framework. 0.6 has many new features and is another step towards full production readiness. There is still some work to do, but first, let’s take a look at what has changed…</p> <p></p> <p>Test fixtures are now part of the axon-test module. These fixtures allow you to [...]]]></description>
			<content:encoded><![CDATA[<p>Today, I released version 0.6 of the Axon Framework. 0.6 has many new features and is another step towards full production readiness. There is still some work to do, but first, let’s take a look at what has changed…</p>
<p><span id="more-1070"></span></p>
<p>Test fixtures are now part of the axon-test module. These fixtures allow you to test your command handling logic based on events and commands. You define these tests in a given-when-then style: given these past events, when I execute this command, I expect these events to occur.</p>
<p>The <tt>CommandBus</tt> interface now allows for asynchronous command dispatching. Instead of using a return value, a Callback can be given to the command bus if you wish to be notified of the result of command execution.</p>
<p>The repositories make use of a <tt>UnitOfWork</tt> instance, which keeps track of changed aggregates and generated events. Instead of saving each aggregate separately, the <tt>UnitOfWork</tt> can be committed, causing changed aggregates to be stored, and events to be dispatched. With the new <tt>SimpleUnitOfWorkInterceptor</tt> or the <tt>SpringTransactionalInterceptor</tt>, it is no longer necessary to call <tt>repository.save()</tt>. In fact, you are discouraged from doing so.</p>
<p>Repositories are now capable of detecting conflicting modifications. When loading an aggregate, you may pass in the expected version of the aggregate. An exception is raised if that version does not match the actual version.</p>
<p>Event sourcing repositories allow for a more advanced way of detecting conflicts. Sometimes, not all concurrent modification are in conflict with each other. One user may very well change the shipping address of an order, while another user is adding items. Other modifications, however, are clearly conflicting, such as one user marking an order as shipped, and another one adding a product. For this purpose, you can register a <tt>ConflictResolver</tt> with the repository. This conflict resolver can, based on unseen and newly applied events, decide whether the changes made by the second user are accepted.</p>
<p>Axon now provides a mechanism to trigger snapshot creation based on the number of events needed to load to reconstitute an aggregate. When the number of events exceeds a given threshold, a snapshot is created and stored in the Event Store.</p>
<p>The <tt>SimpleCommandBus</tt> and <tt>SimpleEventBus</tt> now expose statistics over JMX. Although currently quite limited, the statistics will be improved in the coming versions.</p>
<p>All of these features help making applications with CQRS-based architectures even easier. But we’re not there yet. The coming months, we will try to make it even easier with features like Event versioning, support for aggregates with multiple entities, and whatever comes to mind in Axon’s growing community.</p>
<p>For more information about the Axon Framework, see <a href="http://www.axonframework.org">www.axonframework.org</a>.</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http%3A%2F%2Fwww.gridshore.nl%2F2010%2F08%2F08%2Faxon-framework-0-6-released%2F&amp;title=Axon%20Framework%200.6%20released&amp;t=2' height='25' width='155' frameborder='0' scrolling='no'></iframe></div></div><div style='clear:both'></div></div><!-- Social Buttons Generated by Digg Digg plugin v4.5.3.4, 
    Author : Yong Mook Kim
    Website : http://www.diggdigg2u.com -->]]></content:encoded>
			<wfw:commentRss>http://www.gridshore.nl/2010/08/08/axon-framework-0-6-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Axon Framework 0.5 released</title>
		<link>http://www.gridshore.nl/2010/04/24/axon-framework-0-5-released/</link>
		<comments>http://www.gridshore.nl/2010/04/24/axon-framework-0-5-released/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 15:27:59 +0000</pubDate>
		<dc:creator>Allard</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Axon Framework]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[cqrs]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[Domain Driven Design]]></category>
		<category><![CDATA[JTeam]]></category>

		<guid isPermaLink="false">http://www.gridshore.nl/2010/04/24/axon-framework-0-5-released/</guid>
		<description><![CDATA[<p> Today, I finalized the 0.5 release of the Axon Framework. There is quite a number of changes since the 0.4 version. The 0.5 version is a major step towards production readiness of the framework.</p> <p>Besides some changes to existing building blocks, such as the event bus, which is now much more powerful, the [...]]]></description>
			<content:encoded><![CDATA[<p><img style="margin: 5px; display: inline;" src="http://www.gridshore.nl/wp-content/uploads/axon_logo.png" alt="" align="left" /> Today, I finalized the 0.5 release of the Axon Framework. There is quite a number of changes since the 0.4 version. The 0.5 version is a major step towards production readiness of the framework.</p>
<p>Besides some changes to existing building blocks, such as the event bus, which is now much more powerful, the 0.5 version also includes some new features.</p>
<p>Read on to find out more.</p>
<p><span id="more-1047"></span></p>
<h2><strong>New features</strong></h2>
<ul>
<li><strong>Code restructuring.</strong> The package structure has been changed to better reflect the different architectural components Axon Framework provides. It should be easier to find the one you&#8217;re looking for.</li>
<li><strong>Command Bus.</strong> The command bus is added to Axon. It provides you the ability to explicitly define commands and dispatch them to your command handlers. Furthermore, the command bus provides you the ability to process commands regardless of their type using interceptors. This is useful for, for example, logging, authorization and correlation of incoming commands.</li>
<li><strong>JPA Event Store. </strong>The easiest CQRS configuration is on using full-consistency. That means everything should run within a single transaction. Since transactions over multiple data sources involve a huge performance penalty, Axon provides a JPA Event Store. Its performance is not as good as the FileSystem version, but is does provide transaction support.</li>
<li><strong>Easy switching between full-consistency and eventual consistency.</strong> You can easily choose to process all commands and related events inside a single transaction, or to handle events asynchronously. Choosing for consistency or high-performance is just a matter of configuration. No coding required.</li>
<li><strong>Per-event listener configuration of asynchronous processing.</strong> It is now possible to decide on synchronous vs asynchronous event processing for each event handler individually, just by adding an annotation. If you configure a transaction manager for your event listeners, Axon will process the events in batches and manage the transactions around them.</li>
<li><strong>Support for rolling snapshots.</strong> All event stores will automatically pick up snapshot events. Snapshot events are an important performance booster when aggregates generate a lot of events. Instead of reading all passed events, the event store just needs to read the last snapshot event and the regular events created since the snapshot.</li>
<li><strong>Transactional Event Processing.</strong> Configuring transactions in asynchronous event processing is now a lot easier. 0.5 includes a <tt>SpringTransactionManager</tt> you can use in combination with Spring&#8217;s <tt>PlatformTransactionManager</tt>.</li>
<li><strong>Major documentation update.</strong> The documentation has been restructured to make it easier to find what you&#8217;re looking for.</li>
</ul>
<h2><strong>Maven Central</strong></h2>
<p>Where the 0.4 version required configuration of a repository in your project’s pom.xml, the 0.5 version doesn’t. All required artifacts are available in the maven central repository.</p>
<h2>Workshop and professional support</h2>
<p>We believe that the 0.5 version of Axon Framework is a major step towards production readiness. Therefore, JTeam has decided to provide professional support for the Axon Framework and organize workshops to get you acquainted with the numerous features and choices involved with CQRS.</p>
<p>The first workshop is planned for Friday May 21st in Amsterdam, The Netherlands. For more information, visit <a href="http://www.jteam.nl/training/workshop/cqrs-axon-framework-training-workshop.html">http://www.jteam.nl/training/workshop/cqrs-axon-framework-training-workshop.html</a>.</p>
<h2>Getting started</h2>
<p>Want to get started? Visit <a href="http://www.axonframework.org">www.axonframework.org</a> and download the <a href="http://axonframework.googlecode.com/files/reference-guide-0.5.pdf">reference guide</a>. That should contain enough information to get you started. If you still have questions, drop me a message.</p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http%3A%2F%2Fwww.gridshore.nl%2F2010%2F04%2F24%2Faxon-framework-0-5-released%2F&amp;title=Axon%20Framework%200.5%20released&amp;t=2' height='25' width='155' frameborder='0' scrolling='no'></iframe></div></div><div style='clear:both'></div></div><!-- Social Buttons Generated by Digg Digg plugin v4.5.3.4, 
    Author : Yong Mook Kim
    Website : http://www.diggdigg2u.com -->]]></content:encoded>
			<wfw:commentRss>http://www.gridshore.nl/2010/04/24/axon-framework-0-5-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CQRS &#8211; Designing domain events</title>
		<link>http://www.gridshore.nl/2010/01/27/cqrs-designing-domain-events/</link>
		<comments>http://www.gridshore.nl/2010/01/27/cqrs-designing-domain-events/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 11:33:31 +0000</pubDate>
		<dc:creator>Allard</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Axon Framework]]></category>
		<category><![CDATA[cqrs]]></category>
		<category><![CDATA[DDD]]></category>

		<guid isPermaLink="false">http://www.gridshore.nl/2010/01/27/cqrs-designing-domain-events/</guid>
		<description><![CDATA[<p> Command-Query Responsibility Segregation (CQRS) is slowly but steadily gaining ground as an architecture that helps developers to develop scalable, extensible and maintainable applications. Events play a major role in this architecture, and the way you design these events greatly influence the extensibility of your application.</p> <p>In this post, I describe some CQRS event [...]]]></description>
			<content:encoded><![CDATA[<p><a title="AxonFramework logo" href="http://www.axonframework.org" target="_blank"><img style="border-right-width: 0px; margin: 5px 10px 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="logo" border="0" alt="logo" align="left" src="http://www.gridshore.nl/wp-content/uploads/logo.png" width="100" height="100" /></a> Command-Query Responsibility Segregation (CQRS) is slowly but steadily gaining ground as an architecture that helps developers to develop scalable, extensible and maintainable applications. Events play a major role in this architecture, and the way you design these events greatly influence the extensibility of your application.</p>
<p>In this post, I describe some CQRS event basics and design considerations that help keep your application extensible.</p>
<p>The full post is published on the JTeam blog. Continue to read here: <a title="http://blog.jteam.nl/2010/01/27/cqrs-designing-domain-events/" href="http://blog.jteam.nl/2010/01/27/cqrs-designing-domain-events/">http://blog.jteam.nl/2010/01/27/cqrs-designing-domain-events/</a></p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http%3A%2F%2Fwww.gridshore.nl%2F2010%2F01%2F27%2Fcqrs-designing-domain-events%2F&amp;title=CQRS%20%26ndash%3B%20Designing%20domain%20events&amp;t=2' height='25' width='155' frameborder='0' scrolling='no'></iframe></div></div><div style='clear:both'></div></div><!-- Social Buttons Generated by Digg Digg plugin v4.5.3.4, 
    Author : Yong Mook Kim
    Website : http://www.diggdigg2u.com -->]]></content:encoded>
			<wfw:commentRss>http://www.gridshore.nl/2010/01/27/cqrs-designing-domain-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CQRS made easy with cqrs4j</title>
		<link>http://www.gridshore.nl/2009/12/21/cqrs-made-easy-with-cqrs4j/</link>
		<comments>http://www.gridshore.nl/2009/12/21/cqrs-made-easy-with-cqrs4j/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 08:37:00 +0000</pubDate>
		<dc:creator>Allard</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[cqrs]]></category>
		<category><![CDATA[Domain Driven Design]]></category>

		<guid isPermaLink="false">http://www.gridshore.nl/?p=954</guid>
		<description><![CDATA[<p>&#160;</p> <p>Command Query Responsibility Segregation (CQRS) is an architectural style that makes a clear distinction between commands, which tell an application to do something, and queries, which are requests for information from an application. This distinction comes from the fact that the requirements (and thus also the model) for the execution and validation of [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="cqrs4j_logo" border="0" alt="cqrs4j_logo" align="left" src="http://www.gridshore.nl/wp-content/uploads/logo_large.png" width="100" height="100" /></p>
<p>Command Query Responsibility Segregation (CQRS) is an architectural style that makes a clear distinction between commands, which tell an application to do something, and queries, which are requests for information from an application. This distinction comes from the fact that the requirements (and thus also the model) for the execution and validation of commands are significantly different than those for queries. Events play an important role in the synchronization of application state resulting from executed command.</p>
<p>Applying a CQRS style architecture involves the development of quite a lot of “plumbing” code: event dispatching, asynchronous event processing, transactions, etc. <em>cqrs4j</em>, an Apache 2 licensed open source framework, takes care of all the plumbing for you. Read on to find out how…</p>
<p> <span id="more-954"></span><br />
<h2>A brief introduction to CQRS</h2>
<p>As I stated above, CQRS makes a distinction between the model that validates and executes commands and the model that is used for providing state information. This is quite significantly different than how most (web)app applications are build nowadays. In fact, the model used for commands (the box named “Domain” in the image below), does not expose any state, at all. You might wonder, but how do I know what to show in the front end? That comes directly from your data sources using a thin data layer. I’ll explain how the data gets there in a minute.<a href="http://www.gridshore.nl/wp-content/uploads/cqrs_architecture.jpg"><img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="cqrs_architecture" border="0" alt="cqrs_architecture" src="http://www.gridshore.nl/wp-content/uploads/cqrs_architecture_thumb1.jpg" width="404" height="281" /></a></p>
<p>When a command comes in, it will load an <a href="http://dddstepbystep.com/wikis/ddd/aggregate.aspx" target="_blank">aggregate</a> from the <a href="http://dddstepbystep.com/wikis/ddd/repository.aspx" target="_blank">repository</a> and execute certain operations on it. As a result of these operations, the aggregate produces events, which are picked up for storage by the repository and for dispatching by the event bus. The event bus will dispatch each event to all (interested) event handlers. Some of these event handlers will perform actions on other (related) aggregates, some others will update the database tables they manage.</p>
<p>Having handlers update the data in the database means that your tables do not have to be normalized anymore. Instead, CQRS allows you to optimize your tables for the way you want to query them. This makes the data layer processing your queries really simple, and maintainable. </p>
<p>Furthermore, since all state changes are initiated by events, these events become a reliable source for an audit trail. By storing these events, you have an audit trail that you can use to replay the entire application history. Instead of just seeing “current application state” only, you can see all the changes that have led to the current state, providing valuable information trying to find bugs or deal with customer complaints.</p>
<p>The asynchronous and event driven nature of CQRS makes it extremely valuable for complex applications that have different views on the information in the application. Integration with third party systems that need to be notified of certain changes in your application –and vice versa–&#160; is a lot easier if you use an event driven approach. And since event handling is done asynchronously, the application is more responsive and easier to scale. </p>
<p>But as you notice, there is quite a lot of processing and pushing around of events. When you have a customer breathing up your neck, you don’t want to be developing infrastructure code. You would want to be focusing on the business logic, which is quite complex by itself.</p>
<h2>cqrs4j</h2>
<p>cqrs4j is a Spring-oriented framework that provides the most important building blocks of a CQRS architecture. Creating an aggregate becomes really simple. You don’t have to worry about managing the storage and dispatching of (uncommitted) events. Event sourcing becomes as easy as wiring two beans in your application context.</p>
<p><strong>Annotation support</strong></p>
<p>cqrs4j comes with out-of-the-box annotation support. This makes is really easy to wire event handler methods. cqrs4j can automatically subscribe all your event handlers to the event bus and delegate all relevant events to the appropriate event handlers. Enabling annotation support is as easy as wiring a single bean in your application context.</p>
<p><strong>Spring Integration support</strong></p>
<p>Spring Integration is a framework that allows easy developments of a Messaging systems using the pipes-and-filters architecture. This fits nicely with most of the event dispatching process of CQRS. cqrs4j has support for Spring Integration, which allows you to publish all events as messages on a Spring Integration channel. Sending messages through JMS queues, via email, or through file system storage will only take a few lines of (XML) configuration.</p>
<p><strong>Transaction support</strong></p>
<p>If you update your database tables through incoming events, dealing with them one-by-one in a transaction can become time consuming and take up too much resources of your database. With cqrs4j, you can configure transactions just by setting the @Transactional annotation on your event handlers. You can also configure how many events should be handled in a single transaction.</p>
<h2>cqrs4j project page</h2>
<p>cqrs4j is an open source project, licensed under the Apache 2 license. Visit the project home page for the latest downloads, documentation and source code at <a href="http://code.google.com/p/cqrs4j" target="_blank">code.google.com/p/cqrs4j</a>.</p>
<p><strong>We welcome your feedback</strong></p>
<p>If you have any requests, remarks or other feedback, please let us know. You can report bugs and improvement requests on the <a href="http://code.google.com/p/cqrs4j/issues/" target="_blank">issues page</a>. You can also leave a message via the <a href="http://www.gridshore.nl/contact/" target="_blank">contact page</a> or by leaving a comment.</p>
<h2>Further reading</h2>
<p>I have some more CQRS related blog articles coming up, but there are already quite a few around. Here is a few that helped me get started:</p>
<ul>
<li><a href="http://www.infoq.com/presentations/greg-young-unshackle-qcon08" target="_blank">Greg Young @ QCon: Unshackle your domain</a> </li>
<li><a href="http://elegantcode.com/2009/11/11/cqrs-la-greg-young/" target="_blank">CQRS a la Greg Young</a> </li>
<li><a href="http://elegantcode.com/2009/11/20/cqrs-the-domain-events/" target="_blank">CQRS – The Domain Events</a> </li>
<li><a href="http://elegantcode.com/2009/12/08/cqrs-domain-state/" target="_blank">CQRS – Domain State</a> </li>
<li><a href="http://jonathan-oliver.blogspot.com/2009/10/dddd-why-i-love-cqrs.html" target="_blank">DDDD – Why I love CQRS</a> </li>
</ul>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http%3A%2F%2Fwww.gridshore.nl%2F2009%2F12%2F21%2Fcqrs-made-easy-with-cqrs4j%2F&amp;title=CQRS%20made%20easy%20with%20cqrs4j&amp;t=2' height='25' width='155' frameborder='0' scrolling='no'></iframe></div></div><div style='clear:both'></div></div><!-- Social Buttons Generated by Digg Digg plugin v4.5.3.4, 
    Author : Yong Mook Kim
    Website : http://www.diggdigg2u.com -->]]></content:encoded>
			<wfw:commentRss>http://www.gridshore.nl/2009/12/21/cqrs-made-easy-with-cqrs4j/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SOA and the domain: how new technology should not blind you to old wisdom</title>
		<link>http://www.gridshore.nl/2008/04/02/soa-and-the-domain-how-new-technology-should-not-blind-you-to-old-wisdom/</link>
		<comments>http://www.gridshore.nl/2008/04/02/soa-and-the-domain-how-new-technology-should-not-blind-you-to-old-wisdom/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 21:50:59 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://www.gridshore.nl/?p=98</guid>
		<description><![CDATA[<p>A couple of things happened to me over the past few days as I was taking on a new role within a new project that caused me to ponder a bit about the role of domains and domain driven development (DDD) within the drive towards service oriented architectures (SOA). The result of these ponderings [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of things happened to me over the past few days as I was taking on a new role within a new project that caused me to ponder a bit about the role of domains and domain driven development (DDD) within the drive towards service oriented architectures (SOA). The result of these ponderings was, as it often is in my case, that the more we think things change, the more they stay the same. And the more we think we learn, the more we find we already knew what we have learned.</p>
<p><span id="more-98"></span></p>
<h3>The first thing&#8230;</h3>
<p>The first thing that happened is that I moved to my new project and found myself in a discussion about dealing with the consequences of earlier choices about how to deal with the overall application domain in the context of an application that will exist of a number of different, independent components composed using Web Services. As you will have already guessed, my new project is trying to implement a SOA (with service components that will later be part of a larger SOA).</p>
<p>The situation the project was in had developed from an attempt at implementing SOA by the book (in a somewhat reversed style). As we all know by now, the main tenet of SOA is that it allows you to take specialised components that deal with a single task well and combine them into larger services or applications with business meaning. Of course one might also reason (as my new project had done) that this means that you can take the specification of a new application and decompose it into functionally separate and specialised blocks. Implement these separately and compose them using web services et voilá: instant SOA.</p>
<p>To ensure that the different components would fit together (especially when communicating over the wire, but in general as well) it had been decided that all XML schemata and all implementation classes would be derived from the overall, conceptual domain model. Specifically, the model would be captured in a single set of implementation classes and shared across all the different components. The same model would be reflected in the XML messages passed between components.</p>
<p>When I arrived the project had become embroiled in problems related to tight coupling of its independent components. On the design side the use of a single domain meant that each component had to compromise in how well elements from the domain were suited to its purpose. On the implementation side, using a single domain package in all components meant that every change in any one component meant a rebuild and redeployment of all components.</p>
<h3>The second thing</h3>
<p>The second thing that happened was a discussion I had with a colleague about an MSN message he had written. He had used the word &#8220;enthousiasts&#8221;, after which I chided him about speaking &#8220;Nenglish&#8221; (English mucked up with Dutch influence). A search through a diary proved that he was correct, enthousiasts is perfectly good English &#8212; in British spelling.</p>
<p>It took a little time for it to sink in that, even though he had misspelled the word in my eyes, I still knew what he was talking about. Even though it wasn&#8217;t my spelling, the concept of what he was saying had rung a bell in my head. One might model the situation like so:</p>
<p><img style="http://www.gridshore.nl/wp-admin/float;" src="http://www.gridshore.nl/wp-content/uploads/speakingenglish.jpg" alt="Two kings of English, one understanding..." width="388" height="245" /></p>
<p>What is illustrated by this diagram is that two people can speak different dialects of the same language yet share the meaning of words and concepts. They each have a language of their own, yet somehow both also &#8220;know&#8221; a second language that both share, speak perfectly and can use to communicate relatively flawlessly.</p>
<h3>So what does this teach us about SOA?</h3>
<p>The two situations described above teach us an important lesson about the role of domains and DDD when implementing a SOA: each component within a SOA has to deal with multiple domains, should be aware of this and should be allowed to do so.</p>
<p>A typical component in a SOA has a number of connections to components in the outside world. This is because a typical component in a proper SOA does a single task and does this well and is therefore of interest to other components within the same SOA. And of course, the component itself might use other components to complete its task, for the same reason. So let us say that a given component offers N services to the outside world and references M other components. I then claim that the component has to deal with N + M + 1 different (but obviously related) domains, N + M + 1 separate languages. N languages that it shares with its clients, M languages that it shares with its referenced components and one more: its internal domain that it uses to do its job so well. In practice of course not all these languages will be distinct (or at least not completely); there may be overlap or shared communication languages. But conceptually N + M + 1 is the number and this fact should not be feared but rather respected. After all, it is this fact that allows components within a SOA both to be efficient and proficient at their own tasks, yet interoperate with other components at the same time.</p>
<p><img class="alignleft" style="left;" src="http://www.gridshore.nl/wp-content/uploads/communicating-services.jpg" alt="A federation of service components" width="250" height="130" align="left" /></p>
<p>Developing a single component within a SOA is all about performing a single task and doing that right, then passing the results on in a usable form. In that respect SOA is just a reinvention of the Unix command line tools. Tools like sed, grep, ls and so on don&#8217;t all do the world &#8212; they do one thing, do it well and allow their results to be piped in to the next tool in the chain. At the same time, no single tool cares about <em>how</em> the previous tool reached the results it did &#8212; just that it did. SOA components are much the same.</p>
<p>It is at this junction that we reach DDD. Each SOA component deals with a single, solitary, complex problem. A problem no other component in the same SOA deals with, nor should. DDD teaches us that complex problems should be based on a domain suited to solving that problem and that that domain should be the primary focus of the component. The component should care about how to solve its own problem well; it should not care about what anybody else is doing beyond the extent of getting needed data and passing it on.</p>
<p>Moreover, DDD teaches us that the domain is divided into a number of different pieces. One of these pieces is focussed strictly on solving the actual problem (this is called the <em>core domain</em>), the other pieces are ancillary to accomplishing the task at hand. Some ancillary pieces might focus on communication with other components whose focus is on other problems. Eric Evans refers to this as <em>repositories</em> or in the extreme <em>anticorruption layers</em> (which prevent one model from leaking into another). It is therefore not at all unusual to see a structure within SOA components as illustrated on the right.</p>
<p><img class="alignright" style="right;" src="http://www.gridshore.nl/wp-content/uploads/service-internals.jpg" alt="Service component interals" width="445" height="430" /></p>
<p>The figure on the right illustrates a SOA component, which offers a business service. This service is accomplished by leveraging a specialised domain model, tailored to the problem at hand. At the same time the component does not live in isolation &#8212; it is published to other components and connected to underlying services. But the publishing and the connecting are not part of the component&#8217;s <strong>core </strong>domain; these task are undertaken by ancillary components. And a prime task of these ancillary components is to translate between the component&#8217;s own domain model and that used to communicate with other components. Let there be no mistake, these are anticorruption layers in the literal sense of the term: they allow component to be specialised and service-specific domains to exist in isolation without being corrupted by the needs of the domain of every other component in the same SOA.</p>
<p>Of course that does not mean that each domain of each component within a SOA is completely unrelated to all others. There will by necessity be overlap in the <em>concepts</em> that are captured by two communicating components. However, in order to allow for an optimal solution to the individual problem addressed by a component it is necessary for that component to have full freedom in how it embeds that shared concept within its own domain and how much weight it carries within that internal domain (one man&#8217;s priceless is another man&#8217;s worthless after all).</p>
<p>At the same time a SOA component is completely worthless if it cannot communicate. It must therefore be able to deal with the communication domains that it shares with other components (the first step in moving from the domain of one component to the domain of the next). The techniques that DDD teaches us for dealing with communicating domains are therefore essential to building SOA components that strike the right balance between interoperability and optimized problem solving.</p>
<p>And so, once again, we see that moving to a new technology and a &#8221;new&#8221; architecture is no reason to forget everything  we have learned. In fact, if anything, it shows the importance of recognising &#8220;new&#8221; ideas for what they are. If you know which wheel is being reinvented, you know which tools you must reinvent to make it run properly as well.</p>
<p>Reference: <a href="http://books.google.com/books?id=7dlaMs0SECsC&amp;dq=domain+driven+design">Domain Driven Design: Tackling Complexity in the Heart of Software</a></p>
<div class='dd_post_share'><div class='dd_buttons'><div class='dd_button'><iframe src='http://widgets.dzone.com/links/widgets/zoneit.html?url=http%3A%2F%2Fwww.gridshore.nl%2F2008%2F04%2F02%2Fsoa-and-the-domain-how-new-technology-should-not-blind-you-to-old-wisdom%2F&amp;title=SOA%20and%20the%20domain%3A%20how%20new%20technology%20should%20not%20blind%20you%20to%20old%20wisdom&amp;t=2' height='25' width='155' frameborder='0' scrolling='no'></iframe></div></div><div style='clear:both'></div></div><!-- Social Buttons Generated by Digg Digg plugin v4.5.3.4, 
    Author : Yong Mook Kim
    Website : http://www.diggdigg2u.com -->]]></content:encoded>
			<wfw:commentRss>http://www.gridshore.nl/2008/04/02/soa-and-the-domain-how-new-technology-should-not-blind-you-to-old-wisdom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

