<?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; MVC</title>
	<atom:link href="http://blog.typoplanet.de/tag/mvc/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>A walk through the persistence layer of Extbase</title>
		<link>http://blog.typoplanet.de/2009/07/16/a-walk-trough-the-persistence-layer-of-extbase/</link>
		<comments>http://blog.typoplanet.de/2009/07/16/a-walk-trough-the-persistence-layer-of-extbase/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 09:34:16 +0000</pubDate>
		<dc:creator>Jochen Rau</dc:creator>
				<category><![CDATA[Extbase]]></category>
		<category><![CDATA[extension development]]></category>
		<category><![CDATA[flow3]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">http://blog.typoplanet.de/?p=275</guid>
		<description><![CDATA[Extbase is the new frame-work for TYPO3 extension developers introduced in TYPO3 v4.3. In this article I will give you a brief overview over the persistence layer of Extbase. It falls into different (sub)layers — each of the with different responsibilities. Let&#8217;s start our journey from the top level. 1. Repository A Repository is the first [...]]]></description>
			<content:encoded><![CDATA[<p>Extbase is the new frame-work for <a title="TYPO3 project page" href="http://www.typo3.org">TYPO3</a> extension developers introduced in TYPO3 v4.3. In this article I will give you a brief overview over the persistence layer of Extbase. It falls into different (sub)layers — each of the with different responsibilities. Let&#8217;s start our journey from the top level.<span id="more-275"></span></p>
<p><strong>1. Repository</strong></p>
<p>A Repository is the first objects a developer comes in contact to. It handles only domain objects and provide task oriented interface to retrieve them by saying findByFoo(&#8216;Bar&#8217;). Most of the time you are done.</p>
<p><strong>2. Query</strong></p>
<p>The next level is the Query object. It provides methods to create an abstract query (abstract in sense of abstracted from where the objects come from). It has no clue about the underlying structure of the storage. It even does not now if it is based on a relational model or a tree model (like the content repository of [FLOW3|FLOW3 is a next generation web application framework built for the upcoming TYPO3 v5]). It also invokes the DataMapper (see below). An extension developer uses the Query object to create his own findByFoo() methods for  his Repositories.</p>
<p><strong>3. QueryObjectModel</strong></p>
<p>Deeper and deeper we dig &#8230; In comparison to the Query object Query Object Model knows about the underlying concepts of relations and thus Joins and Orderings. An extension developer may use this class to specify more complex and &#8220;relational model&#8221; aware queries. That makes the creation of queries (esp. Joins) al little bit laborious. But it helps to keep abstraction.</p>
<p><strong>4. StorageBackend</strong></p>
<p>The Storage Backend translates the Query Object Model in syntactical correct statement (SQL). It also invokes the call to the database via a handler. An extension developer normally does not have to mak his hands dirty with SQL (which is in most cases the best way to improve performance and security).</p>
<p><strong>5. DatabaseHandler</strong></p>
<p>The Database Handler prepares queries, fetches the result set. It can be simply the [t3lib_db|A class in TYPO3 providing methods to access a database], or [PDO|PHP Data Objects], or your preferred solution.</p>
<p><strong>6. DataMapper</strong></p>
<p>And finally the Data Mapper. It maps the resulting rows on the Domain Object (it creates an empty object and fills it with the converted property values). It also resolves relations according to the loading strategy (eg. Lazy Loading Proxy).</p>
<p>Puh! Now we are done. Hope you enjoyed the journey.</p>
<p><strong>F.A.Q</strong></p>
<p><strong>Q</strong> Are you nuts! Six different layers, dozens of objects, and bunch of new things to learn! I only wanted to say &#8220;SELECT * FROM Tx_MyExt_Foo WHERE &#8230;&#8221;!<br />
<strong>A</strong> You are right: I am nuts (at least a litte bit ;-)). But now we are fully compatible to the (Query) API of FLOW3 and reached the best level to port Extensions forward. And I really like the Idea of having totally freedom of choice.</p>
<p><strong>Q</strong> And what about performance?<br />
<strong>A</strong> That’s indeed a very important point. We will do some extensive profiling sessions, implement Lazy Loading strategies, and strive for optimized Queries.</p>
<p>And please keep in mind: 90% of the work is based on the concepts and code of <a title="FLOW3 project page" href="http://flow3.typo3.org/">FLOW3</a>. Credits goes to the FLOW3 team.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.typoplanet.de/2009/07/16/a-walk-trough-the-persistence-layer-of-extbase/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Some thoughts on extension development</title>
		<link>http://blog.typoplanet.de/2009/03/03/some-thoughts-on-extension-development/</link>
		<comments>http://blog.typoplanet.de/2009/03/03/some-thoughts-on-extension-development/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 17:02:15 +0000</pubDate>
		<dc:creator>Jochen Rau</dc:creator>
				<category><![CDATA[Development Process]]></category>
		<category><![CDATA[DDD]]></category>
		<category><![CDATA[extension development]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[ontology]]></category>

		<guid isPermaLink="false">http://blog.typoplanet.de/?p=92</guid>
		<description><![CDATA[Todays development process of a TYPO3 extension can be characterized by "Database Driven Design". In this article I describe my personal vision of a more modern approach - and beyond.]]></description>
			<content:encoded><![CDATA[<p>Today&#8217;s development process of a TYPO3 extension comprises (usually) the following steps:</p>
<ol>
<li>collect clients&#8217; or personal needs</li>
<li>design the relational model (database design)</li>
<li>scaffold the extension using the kickstarter</li>
<li>add a lot of database queries template handling to the file _pi1, _pi2, _pi3 etc.</li>
<li>design the templates</li>
</ol>
<p>This ends up in an extension design which is hard to maintain &#8211; especially for larger projects. A more modern approach uses the Model View Controller Pattern.<span id="more-92"></span> One of the advantages of this pattern is to enable the developer to focus on the domain of the client (and thus the domain model of the extension). So, the MVC pattern is a prerequisite for Domain Driven Design. This leads to a slightly different development process:</p>
<ol>
<li>collect clients or personal needs</li>
<li>design the domain model (classes) translating the domain knowledge of the client into UML</li>
<li>scaffolding the extension using a kickstarter</li>
<li>adding the business logic to the domain model classes</li>
<li>design the templates</li>
</ol>
<p>What are the pros of this approach</p>
<ul>
<li>The developer and the client use a common language.</li>
<li>The domain model is more decoupled from the implementation architecture.</li>
<li>It&#8217;s clearly defined where the business logic resides (in the domain model classes).</li>
</ul>
<p>&#8230; and the cons</p>
<ul>
<li>It adds complexity to the extension.</li>
<li>It forces the developer to learn new programing paradigms, which might be difficult to schedule in the daily work.</li>
</ul>
<p>To be consequent we have to go one step further. The domain knowledge is captured in natural language. But natural language is much more expressive than object oriented software design in UML. As a consequence, there is a mismatch between the domain model expressed by the domain experts (the client) and the object oriented model expressed in UML.</p>
<p>If we want to keep all the information of the domain experts we have to define an ontology. To express the domain knowledge in an ontology, OWL seems to be a good solution to me, as it is a W3C standard and targets web applications. To edit ontologies I played around with Protégé.</p>
<p>In the end, we will have a process which can be named &#8220;Ontology Driven Extension Development Process&#8221;:</p>
<ol style="text-align: left; ">
<li>collect clients or personal needs</li>
<li>design the ontology using the same language as the client does</li>
<li>scaffolding the extension using a new ontology driven kickstarter</li>
<li>adding the business logic to the domain model classes</li>
<li>design the templates</li>
</ol>
<p>What are the pros of this approach</p>
<ul>
<li>The developer and the client use a common language.</li>
<li>The ontology based domain model is independent from the implementation and can be shared across different extensions with different purposes.</li>
</ul>
<p>&#8230; and the cons</p>
<ul>
<li>It adds complexity to the development processes.</li>
<li>It&#8217;s forces the developer to learn completely new paradigms an terms.</li>
</ul>
<p>I&#8217;m looking forward to your comments an appreciate any questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.typoplanet.de/2009/03/03/some-thoughts-on-extension-development/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

