<?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>TYPO3Development &#187; CMS</title>
	<atom:link href="http://blog.typoplanet.de/tag/cms/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.typoplanet.de</link>
	<description>A blog for professional TYPO3 developers</description>
	<lastBuildDate>Mon, 28 Mar 2011 18:10:29 +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>Domain Driven Content Management</title>
		<link>http://blog.typoplanet.de/2009/03/07/domain-driven-content-management/</link>
		<comments>http://blog.typoplanet.de/2009/03/07/domain-driven-content-management/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 12:02:31 +0000</pubDate>
		<dc:creator>Jochen Rau</dc:creator>
				<category><![CDATA[Development Process]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[extension development]]></category>

		<guid isPermaLink="false">http://blog.typoplanet.de/?p=74</guid>
		<description><![CDATA[This Article is about the Domain of a Content Management System. What is the content all about? How is it structured, oredere, classified? How can it be transformed form one presentation form to another? And how can we deal with content in TYPO3 v5.x?]]></description>
			<content:encoded><![CDATA[<p>Domain Driven Design is—by experience—a strong concept and a good foundation to build TYPO3 extensions upon.</p>
<blockquote><p><strong>Domain-driven design</strong> (DDD) is an approach to the design of software, based on the two premises that complex domain designs should be based on a model, and that, for most software projects, the primary focus should be on the domain and domain logic [...].</p></blockquote>
<p>The domain represents structure, knowledge and data. A content management system (CMS) like TYPO3 has to handle the data of the domain with respect to the domain knowledge. It aggregates the data, and visualizes it as a content of an output format.</p>
<p>A question emerges: How should the data stored in a domain be mapped on the content of the output? <span id="more-74"></span>You might say: &#8220;Hey, what&#8217;s the problem? The data &#8216;stored&#8217; in the extension <em>is</em> already the content to be displayed!&#8221;. I don&#8217;t think so. Nowadays, the domain of an extension and the domain of the CMS are woven into another. And the following questions are answered by the extension itself:</p>
<ul>
<li>&#8220;What is the title of the article?&#8221;</li>
<li>&#8220;How many articles should be shown on the front-page?</li>
<li>&#8220;Should the subtitle of the article be emphasized?&#8221;</li>
</ul>
<p>So, we have to spend hours and hours to adapt all the templates of an extension to fit in the overall context of a web page. That&#8217;s annoying. Now, let&#8217;s try to solve that issue. The first thing is to assign the questions to the proper domain:</p>
<ul>
<li>&#8220;What is the title of the article?&#8221; → domain of the extension</li>
<li>&#8220;How many articles should be shown on the front-page? → domain of the CMS</li>
<li>&#8220;Should the subtitle of the article be emphasized?&#8221; → domain of the CMS</li>
</ul>
<p>If we finished the separation of the two domains we are ready to take the next step: mapping the domain of the extension onto the output generated by the CMS. I propose a two-step process:</p>
<ol>
<li>Map the domain objects of the extension onto the content object aggregate of the CMS</li>
<li>Transform the content object aggregate to the output format</li>
</ol>
<p>The first step maps the domain objects of the extension onto content objects. These aggregated content objects represent the structure and the semantics of the output, but not its syntax (like &#8220;&lt;h1&gt;The Title&lt;/h1&gt;&#8221;). The second step transforms the content objects to the output format. This can be done with a templating engine as usual.</p>
<p>The benefit of this two-step process is that the CMS &#8220;owns&#8221; the templates. So we can configure the visual representation of the domain objects of <em>all</em> extensions at one central place.</p>
<h3>An Example</h3>
<p>An example might clarify the process. Let&#8217;s assume I want to write a news extension. The first step is to design the domain of my new extension:</p>
<div id="attachment_171" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-171" title="news" src="http://blog.typoplanet.de/wp-content/uploads/2009/03/news-300x268.png" alt="news" width="300" height="268" /><p class="wp-caption-text">The domain model &quot;News Item&quot; of the extension</p></div>
<p>Then I have to examine, what the CMS built-in content object catalog offers to me. Hm, okay, there is already a content object called &#8220;article&#8221;. It seems to fit my purposes:</p>
<div id="attachment_174" class="wp-caption aligncenter" style="width: 274px"><img class="size-medium wp-image-174" title="article" src="http://blog.typoplanet.de/wp-content/uploads/2009/03/article-264x300.png" alt="The domain model &quot;Article&quot; of the CMS" width="264" height="300" /><p class="wp-caption-text">The domain model &quot;Article&quot; of the CMS</p></div>
<p>I configure the mapping as follows:</p>
<ul>
<li>Author → Author</li>
<li>Text  → Text</li>
<li>Title → Header</li>
<li>Subtitle → Subheader</li>
<li>Teaser → ShortDescription</li>
<li>PublishingDate → Date</li>
</ul>
<p>As a result, I have a generic &#8220;Article Object&#8221; which can be added to a higher-level content object, like &#8220;Main Content Area&#8221; or &#8220;Page&#8221;. My &#8220;News Item&#8221; will be rendered depending on the configuration of the transformation process and the context the article is displayed in. I—as an extension developer—don&#8217;t have to deal with the visualization of my domain objects.</p>
<p>But, what if I want to get the control back over the presentation of my domain object? Then I have to define my own content object class (which can of course extend an existing content object class).</p>
<p>This leads to much more decoupled way of content management based on domain driven design. That&#8217;s why I called it &#8220;Domain Driven Content Management&#8221;.</p>
<p>I&#8217;m anxious to read your comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.typoplanet.de/2009/03/07/domain-driven-content-management/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

