<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
	<channel>
		
		<title>typo3-media.com: Latest TYPO3 Blog News</title>
		<link>http://www.typo3-media.com/</link>
		<description>Latest News of the TYPO3 Blog</description>
		<language>en</language>
		<image>
			<title>typo3-media.com: Latest TYPO3 Blog News</title>
			<url>http://www.typo3-media.com/fileadmin/tt_news_article.gif</url>
			<link>http://www.typo3-media.com/</link>
			<width />
			<height />
			<description>Latest News of the TYPO3 Blog</description>
		</image>
		<generator>TYPO3 - get.content.right</generator>
		<docs>http://blogs.law.harvard.edu/tech/rss</docs>
		
		
		
		<lastBuildDate>Wed, 21 Oct 2009 21:44:00 +0200</lastBuildDate>
		
		
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/Typo3Blog" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
			<title>Catching browser back</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/0eDjYPYNm9Y/catching-browser-back.html</link>
			<description>Today we searched for a solution to catch the browser back button.
The problem is, that the...</description>
			<content:encoded><![CDATA[Today we searched for a solution to catch the browser back button.
The problem is, that the browser per default has no way to catch the back and forward actions. Also the browser does not allow to modify the browser history.
But there are two things you can do:
<ol><li>call location.replace to load a diffrent url and replace the history of the current page.</li><li>add a hash (like its used for anchor links) to the url with location.hash='hash'</li></ol>
Basically the idea was to add a hash when the page is loaded. When the user then clicks the browser back button, the url just changes back to the url without the hash. Then all you need to do is to detect that url change and react like you want (e.g. set a new location.href)
<br />Here is the <link fileadmin/files/examples/history.html _blank>example</link>

<pre>$(function(){<br />			<br />	var lastjavascripthash='';<br />			<br />	//if the current url has a hash on dom ready - than the user loads this url directly in browser<br />	if (location.hash) {<br />		alert('you navigated to this link using the browser address!');<br />		lastjavascripthash=location.hash;<br />	}<br />	//just add a dummy hash:<br />	lastjavascripthash=location.hash='#loaded';	<br />	<br />	//optional - when clicking the links append the hash to the url:<br />	$('#tostep1').click(function() {<br />			lastjavascripthash=location.hash='#step1';					<br />		});		<br />	<br />	//do regular check if the hash in the location still fits the last hash that was set via a valid javascript call<br />	// if not it means someone else modified the hash - typically the browser back<br />	setInterval(function() {<br />			if (location.hash != lastjavascripthash) {<br />				alert('you navigated to this link using the browser back!');<br />				lastjavascripthash=location.hash;<br />			}<br />		}, 300);<br />}</pre>
Since the loaction.hash declaration is not interpreted by all browsers, a better way is to use one of the history javascript plugins.
This is the case in this modified <link fileadmin/files/examples/history2.html>example</link><br />(using jquery.history.js Links:   http://plugins.jquery.com/project/history; http://nix.lv/history/)<link fileadmin/files/examples/history2.html _blank><br /><br /></link>
<pre>var browserback = {<br />        lastjavascripthash: '',<br /><br />        setLastHash: function(hash) {            <br />            browserback.lastjavascripthash=hash;<br />        },    <br />        historyChangeHandler: function(hash) {<br />        	if (browserback.lastjavascripthash != hash) {<br />        		alert('you propably used browser back!');<br />        		browserback.setLastHash(hash);<br />        	}		<br />        },<br /><br />        disableBrowserBack: function() {<br />        	$.history.init(this.historyChangeHandler);<br />        	var hash=new Date().getTime()+ Math.floor(Math.random()*1000)<br />        	browserback.setLastHash(hash);<br />        	$.history.load(hash);		<br />        }<br />}<br /><br /><br />$(function(){			<br />	browserback.disableBrowserBack();<br />}<br /> </pre><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=0eDjYPYNm9Y:gs8Rk8MwveI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=0eDjYPYNm9Y:gs8Rk8MwveI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/0eDjYPYNm9Y" height="1" width="1"/>]]></content:encoded>
			<category>news</category>
			
			
			<pubDate>Wed, 21 Oct 2009 21:44:00 +0200</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/catching-browser-back.html</feedburner:origLink></item>
		
		<item>
			<title>Automatic testing with Selenium</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/3-yrPX4pLgc/testing-selenium-qa.html</link>
			<description>Quality Assurance: Automatic testing of web applications with Selenium
 
Introduction
Every...</description>
			<content:encoded><![CDATA[<h1><span lang="EN-US">Quality Assurance: Automatic testing of web applications with Selenium</span></h1>
<p class="MsoNormal">&nbsp;</p>
<h2><span lang="EN-US">Introduction</span></h2>
<p class="MsoNormal">Every web application needs proper testing to ensure that it works like expected. Therefore you should have a set of test-cases, that verify the functionality of the application. For large applications you often need a separate test planning phase, where many test cases are designed – there can be &nbsp;many hundreds of them. </p>
<p class="MsoNormal">A proper design of stable and useful test-cases is required – but that’s not part of this article. But at least we can say that:</p>
<ul><li><span style="font-family: Symbol;"></span>Most of the test-cases should focus on a single feature or requirement</li><li><span style="font-family: Symbol;"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span>In order to keep the overview test cases should have speaking names</li><li><span style="font-family: Symbol;"></span>test-cases should be grouped in test suites</li></ul>
<p class="MsoNormal">Before a new release of a website or web-application is released, the test cases should be executed to ensure the quality of the application. For business critical websites, this phase is even more important! It’s obvious that this process can take a lot of time and effort. If you want to keep up with your competitors you do not only need a robust and high quality application - but you also need a short release cycles that adds new innovations and features to your website. </p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">The key to solve both requirements, short release cycles and proper quality assurance, is <b>automated frontend testing</b>. Automated tests for web applications are furthermore also very useful in agile development processes: In an optimal way they can be used together with continuous integration, to provide early feedback for changes in the source.</p>
<h2><span lang="EN-US">Getting started with Selenium</span></h2>
<p class="MsoNormal">Selenium is a suite of tools to automate web application testing across many platforms. The easiest way to start with it, is to <link http://release.openqa.org/selenium-ide/1.0.2/selenium-ide-1.0.2.xpi>install the Firefox add-on Selenium IDE.</link> With this IDE you have an easy way to record and edit your test cases. </p>
<p class="MsoNormal"><img src="uploads/RTEmagicC_selenium_ide.jpg.jpg" height="206" width="368" alt="" /></p>
<p class="MsoNormal">Let’s start with a simple test:</p>
<p class="MsoListParagraphCxSpFirst">1)<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Open your IDE and select &quot;new&quot; &gt; &quot;testsuite&quot;. A new test suite is created, with a first empty test-case.</p>
<p class="MsoListParagraphCxSpMiddle">2)<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Now just click the red record button and switch to your browser window.</p>
<p class="MsoListParagraphCxSpMiddle">3)<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Open <link http://www.google.de>www.google.de</link></p>
<p class="MsoListParagraphCxSpMiddle">4)<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Do a search for &quot;typo3&quot;.</p>
<p class="MsoListParagraphCxSpMiddle">5)<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>On the result page highlight the website &quot;typo3.org&quot; and click the left mouse button. Select &quot;assertTextPresent&quot; from the context menu. (screenshot)</p>
<p class="MsoListParagraphCxSpMiddle">6)<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Now save your test and give it the name &quot;can search for typo3.org&quot;. </p>
<p class="MsoListParagraphCxSpLast">7)<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Save your test suite and give it the name &quot;google search&quot;.</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Every time you want to check if google still can search for typo3 and returns the expected result &quot;typo3.org&quot; you can run this test case. Do this by clicking the play button in the IDE.</p>
<h2><span><br /></span><span lang="EN-US"></span></h2>
<h2><span lang="EN-US">Speaking Selenese</span></h2>
<p class="MsoNormal">If you have a closer look at your test case, you see that it consist of a list of commands. The Selenium IDE records your actions in the browser and adds the correct commands to the test-case. All commands support one or two parameters. </p>
<p class="MsoNormal">In fact the commands create a testing language - and they are often referred to as &quot;<b>selenese</b>&quot;. For having robust test cases, it’s often necessary to tune your test case commands after recording them with the Selenium IDE. Robust means that the test cases are stable against small changes in the markup. Also while running a test case, selenium executes the commands faster than a human&nbsp; - that might cause unexpected behavior, of course a test case or the application should be insensible against this too.</p>
<p class="MsoNormal">Therefore let’s have a closer look at the commands. In general commands are divided into actions, accessors and assertions. As mentioned commands can have 1 or 2 parameters. In most cases the first parameter is a locator to a specific UI element and the second parameter is a text pattern.</p>
<p class="MsoNormal"><b>Actions</b> do something in the browser, like clicking (command <i>click</i>) a link or selecting some Selectbox entry (command <i>select</i>). Mostly it is necessary that your test-case will wait after an action, until the web application is ready doing something. Most of the action commands can be used with the suffix &quot;<b>AndWait</b>&quot;. That means that Selenium waits till the server has send back the response for the action. (See below for an example how to deal with ajax)</p>
<p class="MsoNormal"><b>Assertions</b> are mainly the <i>verification*</i> or <i>assert*</i> commands (Like <i>verifyTextPresent</i>). The difference between assert and verify is, that a failed assert ends the test case and a verification only marks the test case as failed - but the following commands are still executed.</p>
<h3><span lang="EN-US">Simple Selenium test case example</span></h3>
<p class="MsoNormal">Let’s have a look at a simple test-case example</p>
<table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0" height="133" width="423">  <tbody><tr style="height: 12.7pt;">   <td style="border: 1pt solid black; padding: 0cm 5.4pt; width: 18.2pt; height: 12.7pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">1</span></p>   </td>   <td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">open</span></p>   </td>   <td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">/download/</span></p>   </td>   <td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>  </tr>  <tr style="height: 13.15pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 13.15pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">2</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">assertTitle</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">Downloads</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>  </tr>  <tr style="height: 12.7pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 12.7pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">3</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">verifyText</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">//h2</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">Downloads</span></p>   </td>  </tr>  <tr style="height: 13.15pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 13.15pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">4</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">clickAndWait</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">link=next</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>  </tr>  <tr style="height: 12.7pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 12.7pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">5</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">assertText</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">showing*page 2</span></p>   </td>  </tr>  <tr style="height: 13.15pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 13.15pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">6</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>  </tr> </tbody></table>
In this testcase we start to open the url &quot;/download/&quot; (btw. the test case can be executed on different base Urls). The next commands checks that the title of the page is really &quot;Downloads&quot; (2) and that a text &quot;Download&quot; is somewhere in a H&quot; Tag on the website(3). After that the link with the text &quot;next&quot; is clicked (4), and after the page is reloaded we assert that somewhere on the website a text &quot;showing*page 2&quot; is present. (Where the asterix is a wildcard).
<h4><span lang="EN-US">A more advanced selenese example</span></h4>
<p class="MsoNormal">Let’s have a look at a more advanced example:</p>
<table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0" height="260" width="643">  <tbody><tr style="height: 12.7pt;">   <td style="border: 1pt solid black; padding: 0cm 5.4pt; width: 18.2pt; height: 12.7pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">1</span></p>   </td>   <td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">open</span></p>   </td>   <td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">/ ajaxtest /</span></p>   </td>   <td style="border-style: solid solid solid none; border-color: black black black -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>  </tr>  <tr style="height: 13.15pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 13.15pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">2</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">assertTitle</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">*ajax*</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>  </tr>  <tr style="height: 12.7pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 12.7pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">3</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">click</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">link=glob:*ajax</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>  </tr>  <tr style="height: 13.15pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 13.15pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">4</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">waitForElementPresent</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">//div[@id=&quot;ajaxresult&quot;]/span[contains(@class,   'activated')]</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>  </tr>  <tr style="height: 12.7pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 12.7pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">5</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">pause</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">1000</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 12.7pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">showing*page 2</span></p>   </td>  </tr>  <tr style="height: 13.15pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 13.15pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">6</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">store</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">javascript{'test_'+ new   Date().getTime()+ Math.floor(Math.random()*1000)}</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">$userName</span></p>   </td>  </tr>  <tr style="height: 13.15pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 13.15pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">7</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">echo</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">&nbsp;</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">generated Username:   ${$userName}</span></p>   </td>  </tr>  <tr style="height: 13.15pt;">   <td style="border-style: none solid solid; border-color: -moz-use-text-color black black; border-width: medium 1pt 1pt; padding: 0cm 5.4pt; width: 18.2pt; height: 13.15pt;" valign="top" width="24">   <p class="MsoNormal"><span lang="EN-US">8</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.5pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">type</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">id=login</span></p>   </td>   <td style="border-style: none solid solid none; border-color: -moz-use-text-color black black -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0cm 5.4pt; width: 94.55pt; height: 13.15pt;" valign="top" width="126">   <p class="MsoNormal"><span lang="EN-US">${$userName}</span></p>   </td>  </tr> </tbody></table>
<p class="MsoNormal">Again we start with opening some URL. Than a click action is performed on a link that has a text ending with &quot;ajax&quot; (3). In AJAX applications you cannot use the &quot;*AndWait&quot; actions, since the website is not reloaded. Here it is better to place a seperate WaitFor* command after the action command. That’s what we did on line (4), we expect that after the Ajax Response is finished when a &quot;span&quot; element with a class &quot;activated&quot; is present. The &quot;pause&quot; command right after a waitFor* command tends to be useful to have a better robustness of the test case.</p>
<p class="MsoNormal">The next commands show what else is possible. In line (6) a random value is stored in the variable $userName. This variable is used in the echo command on line (7) and then an inputfield with the id &quot;login&quot; is filled with this value (8).</p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">Interesting are the possibilities of the different locators. Here some examples:</p>
<ul><li><span style="font-family: Symbol;"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </span></span>Using the identifier locator like: “identifier=loginForm” &nbsp;(identifier prefix is optional)</li><li><span style="font-family: Symbol;"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span>Using CSS Selectors: “css=.content div.grid”</li><li><span style="font-family: Symbol;"></span>Selecting a link with a special text: “link=my link”</li><li><span style="font-family: Symbol;"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </span></span>DOM Selektors: “dom=document.forms[0].username”</li><li><span style="font-family: Symbol;"></span>Using XPath Selektors: “xpath=//form[@id='loginForm']” (xpath prefix is optional, a “//” is sufficient)</li></ul>
<h2><span lang="EN-US">Whats next</span></h2>
<p class="MsoNormal">If you want to run your tests in other browser you can use Selenium Core. Selenium Core comes with a HTML based Test-Suite Runner that can simply be called from other browsers too:</p>
<p class="MsoNormal">&nbsp;<img src="uploads/RTEmagicC_selenium-core.jpg.jpg" height="126" width="519" alt="" /></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">There are more useful Selenium Tools. First to be mentioned is the Selenium RC Server. This is a Java based Server, that can run tests on multiple platforms and browsers. The cool thing is that you can connect to this server from other applications. So it is possible to run Unit Tests that use Selenese to test your web application.</p>
<h2><span lang="EN-US">The TYPO3 extension “selenium”</span></h2>
<p class="MsoNormal">The TYPO3 extension “selenium” can help to build Selenium Tests for TYPO3 extensions. It has:</p>
<ul><li><span style="font-family: Symbol;"></span>A backendmodul that scans for *TestSuite*.html files inside “tests/selenium” folders and links them with the Selenium Core Runner. So you can easily start Selenium tests from the backend of TYPO3.</li><li><span style="font-family: Symbol;"></span>In the extension configuration you can configure a Selenium RC Server (default port 4444) and you can use this in your phpunit tests.</li><li><span style="font-family: Symbol;"></span>Therefore two abstract testsuite classes are provided.<ul><li><span style="font-family: &quot;Courier New&quot;;"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"> </span></span>tx_selenium_phpunittestcase: Uses the Selenium Testcase class that is part of phpunit.</li><li><span style="font-family: &quot;Courier New&quot;;"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">&nbsp;</span></span>tx_selenium_testcase: Uses the PHP selenium Driver, that is part of the Selenium RC package.</li><li><span style="font-family: &quot;Courier New&quot;;"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span>Each of this classes has a method initializeSelenium($browser,$url) that instanciates the $this-&gt;selenium based on the configured RC Server.</li></ul></li></ul>
<p class="MsoNormal"></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal">&nbsp;<img src="uploads/RTEmagicC_selenium-phpunit.jpg.jpg" height="331" width="430" alt="" /></p>
<p class="MsoNormal">&nbsp;</p>
<h2><span lang="EN-US">Links</span></h2>
<p class="MsoNormal"><link http://seleniumhq.org/>http://seleniumhq.org/</link></p>
<p class="MsoNormal"><link http://seleniumhq.org/docs/>http://seleniumhq.org/docs/</link> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=3-yrPX4pLgc:wxn97OXaXzg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=3-yrPX4pLgc:wxn97OXaXzg:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/3-yrPX4pLgc" height="1" width="1"/>]]></content:encoded>
			<category>agile</category>
			
			
			<pubDate>Tue, 06 Oct 2009 16:11:00 +0200</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/testing-selenium-qa.html</feedburner:origLink></item>
		
		<item>
			<title>Crawler 3.0 released</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/4yVBVJT9LxI/crawler-30-released.html</link>
			<description>A new version of the famous crawler extension - initially maintained by Kasper - was released today...</description>
			<content:encoded><![CDATA[<br />A new version of the famous crawler extension - initially maintained by Kasper - was released today by AOEmedia. The new version ships with lot's of improvements and bugfixes.<br />Added by Tolleiv Nietsch about 8 hours ago<br /><br />Especially the performance improvements and the enhancements for the configuration of the crawler are the most remarkable parts of the new version.<br /><br />Regarding the performance improvements we've implemented a full multi-process crawling-model for the crawler. This allows to scale up performance of the crawler with your hardware and push through urgent jobs very quick.<br /><br />The configuration improvements enable a more flexible way to configure your crawl-jobs through configuration-records instead of TSConfig.<br /><br />Even though all the changes happened with backwards compatibility in our minds so all your old settings should still work as supposed.<br /><br />Big kudus for all the good work goes to Timo Schmidt and Fabrizio Branca for AOEmedia.<br /><br /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=4yVBVJT9LxI:9UYbb4L0oe0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=4yVBVJT9LxI:9UYbb4L0oe0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/4yVBVJT9LxI" height="1" width="1"/>]]></content:encoded>
			<category>news</category>
			
			
			<pubDate>Fri, 11 Sep 2009 17:30:00 +0200</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/crawler-30-released.html</feedburner:origLink></item>
		
		<item>
			<title>small Javascript Objects example</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/FTA4Sw5zs4w/javascript-objects-example.html</link>
			<description>In addition to article "Javascript object notation" I still have a small example lieing...</description>
			<content:encoded><![CDATA[In addition to article &quot;<link record:tt_news:106>Javascript object notation</link>&quot; I still have a small example lieing around.
Its just a simple table element that is bind to a javascript object that is responsible for controlling the actions related to this table widget - the widgets with its javascript controller part are independend from each other. In theory they could delegate the actions in that widget to a coresponding controller on the server.
<b><link fileadmin/files/examples/javascript-objects.html _blank>To the example</link> </b>
There is one &quot;trick&quot; to mention. We need a way to bind the html element &quot;table&quot; to the object that should control this widget. With jQuery you can do this with the &quot;.data&quot; method - it allows you to bind any stuff to a html element.
So in this case - to ensure that on a click on the  &quot;change color&quot; link  the correct object answers - we just bind the object itself to the link element:
<pre id="line1">// register for clicks on the &quot;change color Link&quot;<br />this.registerEvents=function() { 				<br />	$('#'+this.id+' .click').data('object',this).click(function(event) { $(this).data('object').clickColorAction(); });<br />};</pre><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=FTA4Sw5zs4w:IRtmAJ4m2KY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=FTA4Sw5zs4w:IRtmAJ4m2KY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/FTA4Sw5zs4w" height="1" width="1"/>]]></content:encoded>
			<category>pattern</category>
			<category>development</category>
			
			
			<pubDate>Sat, 16 May 2009 09:53:00 +0200</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/javascript-objects-example.html</feedburner:origLink></item>
		
		<item>
			<title>MVC - Part 2: "TYPO3 mvcnews example"</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/mizQ_rD-V-Q/mvc-news-example.html</link>
			<description>We have T3DD and its time to publish the new release of the "mvc" extension together with...</description>
			<content:encoded><![CDATA[We have T3DD and its time to publish the new release of the <link http://typo3.org/extensions/repository/view/mvc/current/ _blank>&quot;mvc&quot; extension</link> together with a first version of an <link http://forge.typo3.org/projects/show/extension-mvcnews _blank>example extension</link>. <br /> 
<h3> Introducing the example:</h3>
 The extension &quot;mvcnews&quot; is planned as a normal news application with articles and categorys, articles can have comments and there can be downloads attached to the article. <br /> <br /> The requirements to the frontend are common: We need a article overview with the features: searchform, pagination and resultlist. Also we need a detailview of an article. That should be all for now.
<h3>Model</h3>
 So the domain model is pretty simple (only relevant parts are shown for now)
<img src="uploads/RTEmagicC_uml-mvcnews-ddd.jpg.jpg" height="297" width="300" alt="" /><br /> 
<h3> Controller</h3>
 Like explained above we need two frontend outputs: a listview and a detailview. We put this both in one controller, that has two actions: &quot;showlistAction()&quot; and &quot;showdetailAction()&quot;. Because the controller needs to access articles, it needs at least the articleRepository. With dependency injection its the best to let the articleRepository inject into the controller.<br /> <br /> With that its pretty easy to fill the showdetailAction with live: Its straight forward: 1. ask the repository for the article that should be displayed <br />2. pass it to the view, and return the view result.
<pre>/**<br />* detail action shows the single view of an object, if a detail view of an object is<br />* requested.<br />*<br />* @return string<br />*/<br />public function showdetailAction() {<br />   if (empty ( $this-&gt;arguments ['id'] )) {<br />    throw new InvalidArgumentsExcepton('no valid id given');<br />   }<br />   $this-&gt;view-&gt;setArticle ( $this-&gt;articleRepository-&gt;findById ( $this-&gt;arguments ['id'] ) );<br />   return $this-&gt;view-&gt;render ();<br />}</pre>
<h3>The detail view</h3>
Like shown above there needs to be a view that is able to render an article. And the view - of course - has to know the article it should render. Therefore the view has a &quot;setArticle&quot; method to set the article the view should render. 
Our detail view actually implements the phpTemplateView, so a template that belongs to that view can look like that:
<pre><br /><br />&lt;div id=&quot;objects&quot;&gt;<br /> &lt;h2&gt;&lt;?php echo $this-&gt;article-&gt;getTitle();&nbsp; ?&gt;&lt;/h2&gt;<br /> &lt;p&gt;&lt;small&gt;&lt;?php echo<br />$this-&gt;labels-&gt;get('field_category'); ?&gt;:&lt;?php echo<br />$this-&gt;article-&gt;getCategory()-&gt;getTitle();<br />?&gt;&lt;/small&gt;&lt;/p&gt;<br /> &nbsp;&nbsp; &nbsp;&nbsp;&nbsp;<br />&nbsp;&lt;p&gt;&lt;small&gt;&lt;?php echo<br />$this-&gt;labels-&gt;get('field_date'); ?&gt;:&lt;?php echo<br />$this-&gt;article-&gt;getDate(); ?&gt;&lt;/small&gt;&lt;/p&gt;<br />  &lt;div class=&quot;image&quot;&gt;<br />    &lt;?php &nbsp;&nbsp; &nbsp;echo $this-&gt;article-&gt;getImage();&nbsp;&nbsp; ?&gt;<br />  &lt;/div&gt;<br />  &lt;?php &nbsp;&nbsp; &nbsp;echo $this-&gt;article-&gt;getDescription();&nbsp;&nbsp; ?&gt;<br />&lt;/div&gt;<br /><br /></pre>
 There is one thing thats not perfect: In the view I expect that the getImage returns a Imagetag, and that the description is processed by the TYPO3 parseFunc_RTE stuff.&nbsp; There are two ways to solve that:
<ol><li>we could use viewhelpers (like $this-&gt;fieldRenderer-&gt;asImage(...)) to transform the imagepath to a imagetag for example.</li><li>we can use a presentationmodel and do the transformation of fields for the view there.</li></ol>
 (Btw.: we should not add logic to the domain model, because a imagetag is purely view related and has no meaning in the domain)<br /> <br /> We decide to go with version 2 - just because we might need this transformation in the listview again. 
The mvc framework offers a TCA <b>presentationmodel</b>, that does most of the transformations magic with the help of the TCA informations, so we just need to wrap a presentationmodel around our article object:
<pre>new tx_mvcnews_presentation_articlePresentationModel ( $this-&gt;articleRepository-&gt;findById ( $this-&gt;arguments ['id'] ), $this-&gt;configuration-&gt;get ( 'presentationModel.article.' ), 'tx_mvcnews_article' );</pre>
<h3> The showlistAction and the listview:</h3>
 For the listview we need to find a clean and flexible solution to:
<ol><li>get the correct collection of articles, that matches the search</li><li>render the output with: searchform, pagination and actual results.<br />   </li></ol>
 For the first problem we use a seperate <i>searchCriteriaObject</i>, that has all the informations for the current search - this object is build from the current arguments. Then we pass the <i>searchCriteria</i> to the articleRepository-&gt;findByCriteria method and all the application-specific searchlogic has to be part of this repository. So the call sequenz&nbsp; looks something like this:<br /> <img src="uploads/RTEmagicC_uml-mvcnews-sequenz.jpg.jpg" height="211" width="463" alt="" /><br /> <br /> For the second problem we use the pattern <i>compositeView</i>. Thats mainly a view that consits of other views - and just like the requirements say: we have three subviews: pagination, searchform and list. Of course all of this subviews require a model that they can render:
<ul><li>the paginationSubView has setter methods to provide the required informations for the pagination</li><li>the searchformSubView - well it needs a formmodel. The formmodel tells the searchForm which formelements it can render. The seperate formmodel is also greate to validate the users input before doing anything.</li><li>and finaly the listSubView needs the collection of articles that it should render.<br />   </li></ul>
 The main advantage of splitting your view into subviews is that you can reuse the views. So imagine you need the searchform as a standalone form, or you might need just the list of lastest articles -&gt; you can reuse the existing views.
<br /> This is how the class diagramm of the listview looks like:<br /> <img src="uploads/RTEmagicC_uml-mvcnews-views.jpg.jpg" height="247" width="300" alt="" /><br /> <br /> And finaly this is the output:<br /> <img src="uploads/RTEmagicC_mvcnews-listview.jpg.jpg" height="239" width="367" alt="" /><br /> <br /> 
<h3> Whats next?</h3>
 You can have a look in the example extension and see yourself how it works.
By now the example &quot;mvcnews&quot; has just a basic output without any advanced features, here is whats planned next:
<ul><li> add AJAX loading for searching and paginating</li><li>add more features like commenting and rating, that propably results in a richer domain model and more action methods in the controller.<br />   </li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=mizQ_rD-V-Q:6q8Ue4snXcc:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=mizQ_rD-V-Q:6q8Ue4snXcc:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/mizQ_rD-V-Q" height="1" width="1"/>]]></content:encoded>
			<category>pattern</category>
			
			
			<pubDate>Fri, 15 May 2009 09:59:00 +0200</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/mvc-news-example.html</feedburner:origLink></item>
		
		<item>
			<title>MVC - Part1: "Introduction and History"</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/8_lCO4_5aQc/mvc-mvp-typo3-introduction.html</link>
			<description>
Everybody speaks about MVC - the de facto standard for building modern application. Here is a...</description>
			<content:encoded><![CDATA[
Everybody speaks about MVC - the de facto standard for building modern application. Here is a short article to the basics and history of MVC.
<h3>Short introduction to Model View Controller</h3>
MVC intention is to build applications in a modular way, where we have 3 general parts responsible for creating the output and allowing the interaction&nbsp; with the user: 
<h4> Model: </h4>
 In the context of the MVC the model has the data that is required to render things in the view. So it represents the data that are required for rendering. It also takes over the operation related to the domain.The model is used to do something and get the data. 
<h4> View:</h4>
 takes over the display of the applications state. A view takes care of „rendering the pixels on the screen“ and should be as dump as possible. Typically a view class understands one or more model(s) and outputs the information of that model. ( A view is not allowed to write in the model.) So the view is aware of the model and knows how to read the data out of it – but never the model should know something about the view!
<h4> Controller: </h4>
 It glues together Model and View, it controls the user interaction with the model and the view. (Its a thin layer that connects models with there views)<br /> <br /> 
<h3>The historic basic &quot;smalltalks-80&quot; classical MVC:</h3>
One of the first MVC framework was the smalltalks-80 MVC implementation in the 80s. Smalltalk is a pure objectoriented programming language, and the MVC concept was a key feature.<br /><img src="uploads/RTEmagicC_classical-mvc.jpg.jpg" height="204" width="230" alt="" /><br />It was designed for Desktopapplications and the main idea is to seperate the presentation from the domainmodel.<br />Controller and view do not know each other. Instead the view updates itself through observing the relevant model. Therefore the models needs to implement the observer pattern. Controller handles the userinputs and delegates the useractions to methodcalls in the models.<br /><br />A complete screen can be understand as a collection of widgets - each widgetelement consit of its own View and Controllerobject. 
<h4>Downsides of the smalltalks 80 MVC concept:</h4>
Usage of the Observer Pattern: You dont know whats going on by reading the code.<br />Complex Screens get really complex because of a hierarchie of widgets with own View and Controller part. Specially if you have the requirement to know about a user action in more controllers. <br /><br />Problem of handling logic that is only related to presentation =&gt; that is put into the view - so the view gets some logic which is not optimal.<br /><br />This MVC concept is not really relevant for typical Webapplications!<br /><br />
<h3>MVP vs MVC</h3>
The smalltalk developers recognized the downsides of the classical MVC concept and introduced a simelar concept called MVP (Model View Presenter).
<img src="uploads/RTEmagicC_mvp.jpg.jpg" height="276" width="300" alt="" />
The role of the presenter within MVP is to interpret the events and gestures initiated by the user and provide the business logic that maps them onto the appropriate commands for manipulating the model in the intended fashion. <br />While it is the view’s responsibility to display model data it is the presenter that governs how the model can be manipulated and changed by the user interface. This is where the heart of an application's behaviour resides. 
In many ways, a MVP presenter is equivalent to the MVC controller.<br />The main difference is that a presenter is directly linked to its associated view so that the two can closely collaborate in their roles of supplying the user interface for a particular model. This can be very handy at times and is one of the most obvious benefits over MVC where the application model only has an indirect link to its associated view. 
However the shortcut &quot;MVP&quot; is not so common like &quot;MVC&quot; but most of the MVC frameworks you find for webapplications follows more the MVP concept.
<h3>MVC for Webapplications</h3>
The concepts above were initialy developed for desktop applications. In desktop applications you have a direct connect between UI components and the responsible controller or presenter. In webapplications you normally dont have this: The HTML for a complete screen is sended to the browser. If the user do some actions in the UI a request is send to the webserver - this request has to be interpreted and normally the complete (updated) screen needs to be sended to the browser again.
<img src="uploads/RTEmagicC_mvc-for-web.jpg.jpg" height="122" width="300" alt="" />
The HTML for the complete screen can be understand as a set of widgets (or subviews). For example it can contain a &quot;mainmenu&quot;, a &quot;newslist&quot;, a &quot;basket&quot; etc. The webserver always needs to generate the complete view with all its subviews. 
A MVC Framework for webapplications therefore normally works this way:
<ul><li>The request that is send from the browser to the webserver is send to a front controller. This front controller builds a request object and starts the processing of this request.</li><li>That means Controller Objects are called (normally action methods in the controller that belongs the current request. This process is called &quot;dispatching&quot;) and this controllers are responsible to return the correct response. Like normal controllers they do:<ul><li>The controller loads/modify model objects</li><li>Pass the model to a view</li><li>calls the view &quot;render()&quot; method to get the response.</li></ul></li><li>Normally the view that is returned to the browser consist of a hierarchie of subviews and/or widgets.</li></ul>
<b>MVC Frameworks for webappications:</b>
<ul><li>http://flow3.typo3.org - the upcoming framework for TYPO3 5.0</li><li>http://typo3.org/extensions/repository/view/mvc/current/ - extension enables MVC based plugin on top of the CMS TYPO3 4.x</li><li>http://framework.zend.com/ - powerful collection of PHP5 classes and modules, includes also a full featured MVC framework</li></ul><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=8_lCO4_5aQc:htSG5W1YkIQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=8_lCO4_5aQc:htSG5W1YkIQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/8_lCO4_5aQc" height="1" width="1"/>]]></content:encoded>
			<category>news</category>
			<category>pattern</category>
			
			
			<pubDate>Sun, 15 Mar 2009 12:21:00 +0100</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/mvc-mvp-typo3-introduction.html</feedburner:origLink></item>
		
		<item>
			<title>running FLOW3 with PHP 5.3.0 on mac (up)</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/iw-nGL6Qv5o/flow3-on-mac.html</link>
			<description>Just some small notes about how to run FLOW3 on a mac.</description>
			<content:encoded><![CDATA[Just some small notes about how to run FLOW3 on a mac.
<h3>Installing PHP 5.3.0beta1</h3>
FLOW3 requires PHP 5.3 in the current version. Macport is a greate tool (like apt*) for compiling and upgrading software. So the first thing you need to do is download: http://www.macports.org/.
After downloading and installing macport you can use the port commands to download and install new software with its dependencies. For PHP 5.3 you can use this commands:
<pre>cd /opt/local/bin<br />sudo ./port selfupdate -f<br />sudo ./port search php5<br />sudo ./port variants php5-devel<br />sudo ./port install php5-devel +apache2 +macosx +mysql5 +sqlite</pre>
More details on <link http://guide.macports.org/.>http://guide.macports.org/.</link> 
<h3>Installing FLOW3</h3>
You can get the current version from SVN: svn co https://svn.typo3.org/FLOW3/Distribution/trunk/.
<h3>Update (18.10.2009)</h3>
Since php 5.3 is released its now available with the port &quot;php5&quot;:
<pre>( sudo ./port installed )<br />sudo ./port uninstall php5-devel<br />sudo ./port install php5 +apache2 +macosx +mysql5 +sqlite</pre><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=iw-nGL6Qv5o:s3SJMRnVTfA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=iw-nGL6Qv5o:s3SJMRnVTfA:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/iw-nGL6Qv5o" height="1" width="1"/>]]></content:encoded>
			<category>news</category>
			
			
			<pubDate>Sat, 28 Feb 2009 08:21:00 +0100</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/flow3-on-mac.html</feedburner:origLink></item>
		
		<item>
			<title>Dependency Injection in TYPO3 4.x</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/r5KlqI4OGOo/dependency-injection-for-typo3.html</link>
			<description>What is dependency injection
Its a concept following the IoC (=Inversion of Control)...</description>
			<content:encoded><![CDATA[<h3>What is dependency injection</h3>
Its a concept following the IoC (=<link http://martinfowler.com/articles/injection.html#InversionOfControl>Inversion of Control</link>) principle.&nbsp;
In object oriented programming most of the objects needs other objects in order to solve the task. Normally this might be done simply this way:
<pre>$object= new class_i_need();</pre>
That means your class depends on another class. And it gets the dependency itself. If you want to Unit Test this class you (more or less) cannot really test this class alone because you will also depend on the dependency. 
Dependency injection means that the object itself is not responsible of getting the instances it needs - instead it is &quot;injected&quot; from outside.
The most common way is constructor injection - the first step therefore is to explicit request the dependency in the constructor of your class:
<pre>class foo {  <br /> public function __construct(class_i_need $object) {<br />   $this-&gt;object=$object;  <br /> }<br />}</pre>
So now the class cleary describe the dependency - and whoever wants to instanciate this class needs to pass the correct object instance. This way you allready can build better Unit Tests for this class - using Mock or Stub objects.
The next step is that a framework is responsible for resolving the dependency, so creating a instance of your class would look something like:
<pre>$myFooInstance=tx_picocontainer_IoC_manager:create('foo');</pre>
The framework knows all the available classes and is responsible for resolving the dependency. So it will inject a &quot;class_i_need&quot; instance to the &quot;foo&quot; class and return a correct instance.
<h3>The extension &quot;picocontainer&quot;</h3>
http://typo3.org/extensions/repository/view/picocontainer/current/
It includes the PHP implementation of picocontainer:&nbsp;www.picocontainer.org 
The extension offers basic dependency injection. The usage itself is simple:
<ol><li>you need to register your classes to the &quot;IoC manager&quot;</li><li>then you can ask the manager for instances, and it will resolve the dependencies (if it can).</li></ol>
For usage you need to distinguish between singleton classes (only one instance of a class required) and prototype classes:

<pre>//registering a singleton class<br /> tx_picocontainer_IoC_manager::registerSingleton(CLASSNAME)<br />//getting a singleton instance<br />$object=tx_picocontainer_IoC_manager::getSingleton(CLASSNAME);<br />//registering a prototype class:<br />tx_picocontainer_IoC_manager::registerPrototype(CLASSNAME); <br />//get a new instance:<br />$object=tx_picocontainer_IoC_manager::create(CLASSNAME)</pre>
The registration can be done directly in the head of your class code, or on a central place in your extension.

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=r5KlqI4OGOo:JncG3LEdx0E:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=r5KlqI4OGOo:JncG3LEdx0E:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/r5KlqI4OGOo" height="1" width="1"/>]]></content:encoded>
			<category>news</category>
			<category>pattern</category>
			
			
			<pubDate>Wed, 28 Jan 2009 14:42:00 +0100</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/dependency-injection-for-typo3.html</feedburner:origLink></item>
		
		<item>
			<title>Domain Driven Design - a brief introduction</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/ZUEKa3xs8cI/domain-driven-design-introduction.html</link>
			<description>
Domain Driven Design
Domain Driven Design (DDD) is an approach of how to model the core logic of...</description>
			<content:encoded><![CDATA[
<h2>Domain Driven Design</h2>
<p class="align-left"><img style="float: left;" src="uploads/RTEmagicC_books-ddd.png.png" height="169" width="128" alt="" />Domain Driven Design (DDD) is an approach of how to model the core logic of an application. The term itself was coined by Eric Evans in his <link http://books.google.com/books?id=7dlaMs0SECsC&dq=domain+driven+design _blank>book &quot;Domain Driven Design&quot;</link>. The basic idea is that the design of your software should directly reflect the Domain and the Domain-Logic of the (business-) problem you want to solve with your application.  That helps understanding the problem as well as the implementation and increases maintainability of the software.<br /> </p>
<p class="align-left">The <link http://www.domainlanguage.com/ddd/index.html _blank>Domain Driven Design</link> approach introduces common principles and patterns that should be used when modeling your Domain. There are the &quot;building blocks&quot; that should be used to build your domain model and principles that helps to have a nice &quot;supple design&quot; in your implementation.</p>
This article tries to introduce some of the concepts shortly and  should inspire to read more. But reading this article still requires some minutes - so take your time :-)
<h3>Basics</h3>
The Developer never knows enough about the problem. But the domain experts know their domain and the developer has to understand it. The domain experts know rules of their business process but often they are not aware using them because it is natural for them. Therefore &quot;knowledge crunching&quot; is required to identify a proper domain model (DM).
A common language between users (domain experts) and developers is required that helps to understand the tdomain and the&nbsp; problem.
The domain model offers a simplified, abstract view of the problem. It can have several illustrations: speech / UML / code. Defining the domain model is a cyclic process of refining the domain model. The DM grows and changes because knowledge grows during implementation and analysis!
Of course the domain model must be useable for implementation. In practice there are so many analytic Models which are not implemented ever =&gt; you have to find one which can be implemented in design!
<img src="uploads/RTEmagicC_analysis.jpg.jpg" height="92" width="351" alt="" />

<h3>Ubiquitous Language</h3>
   In order to understand the problem area (domain) of your application a common language should be used to describe the problem. The goal is that this language (and the common vocabulary in it) can be understood by the developers and the domain experts (e.g. the client). 
<ul></ul>
<ul><li>The DM is the backbone and it uses terms of the &quot;ubiquitous language&quot;</li><li>Therefore no translation between developers and domain experts - as well&nbsp; between developers itself are required. </li><li>During the analysis the ubiquitous language should be used to describe and discuss problems and requirements. If there are new requirements it means new words enter the common language...</li></ul>
Speak in ubiquitous language (like a foreign language) 
<ul><li>Try to explain scenarios loud with the use of the model and the ubiquitous language</li><li>Try to explain scenarios more simple/better (find easier ways to say what you need to say). That helps refining the model.</li></ul>
<h3>UML and DDD</h3>
Common is the use of class-diagrams to describe the domain model.
<ul><li>Use of UML class diagrams to  sketch the main classes.&nbsp;</li><li>Do not go to draw every class you going to code =&gt; keep overview of the main stuff!</li><li>Use structure (packages and subpackages). Use freetext to explain constrains and relations. </li><li>Simplify the class diagram when you use it to talk with domain experts (better a diagramm is useful than standard compliant)</li></ul>
“comprehensive UML of entire object model fails to communicate or explain; they overwhelm reader with details”
<b>Therefore use simplified diagrams of conceptual important parts – that are essential to understand. (Present a skeleton of ideas)</b>
<h3>Layered Architecture</h3>
<img style="float: left;" src="uploads/RTEmagicC_layered.jpg.jpg" height="150" width="90" alt="" />The basic principle for software that is build with domain driven design is to use a layered architecture. Where the heart of the software is the domain model. Basic principles of layered architecture is that a layer never knows something about the layers above. That also mean the domain layer -as the heart of the application- is responsible for all the business logic but should never be &quot;dirtied&quot; by view requirements&nbsp; for example. <br />(MVC or MVP Pattern fits perfectly into that principle)


<h2>Main Domain Model elements (building blocks)</h2>
The main elements of a domain model are &quot;<b>entities</b>&quot;, &quot;<b>values</b>&quot; and &quot;<b>services</b>&quot;. They are connected with <b>associations</b> (relations). Common pattern like &quot;<b>repositories</b>&quot; and &quot;<b>factories</b>&quot; helps completing the model.
<h3>Associations between elements</h3>
Avoid many association and use only a minimum of relations because they decrease maintainability!
<ul><li> impose a traversal direction instead of a bidirectional (bidirectional means both objects can only exist together -&gt; ask if this is really the case)</li><li> adding qualifier, effectively reduces multiplicity: If you have&nbsp;much associations and/or multiplicity&nbsp;for both ends of the association, it can be a sign that a class is missing in your model.</li><li>eliminate nonessential associations</li></ul>
In sourcecode a association can be for example: a function that querys / some internal array / a collection object / just a reference ...
<h3>Entitys</h3>
= Object which is primary defined by its identity (not by attributes). For example &quot;Person&quot;, &quot;Car&quot;, &quot;Costumer&quot; or &quot;BankTransaction&quot;.
<ul><li>has continuity through live cycle</li><li>object defined by its own not by attributes</li><li>keep the class definition simple =&gt; focus on live cycle</li><li>be alert to requirements that require a matching through attributes (because of possible problems with the need for identity)</li><li>use of some Identifier (IDs) is often useful</li></ul>
<h3>Values</h3>
=describe the characteristic of a thing and identity is not required. “we care what they are not who or which”. For example &quot;address&quot;, &quot;color&quot; ... 
<ul><li>value objects are allowed to reference an entity</li><li>often passed as parameter in messages between other objects</li><li>they are immutable! Ideally the only have getter methods and their attributes are set during construction (constructor method).</li><li>make them a “whole value”&nbsp; - means a conceptual whole (e.g. address)</li><li>identity gives freedom in design – we don’t need to care of identity: we can simple delete and create new ones if required.</li></ul>
A good example is &quot;color&quot; that can be implemented as value object. That means it is an object that represents a certain color. Since value objects are immutable it is not allowed to change the color object. So if you need to get a color that is lighter than another color: You throw the old color away and build a new color - that is possible because you don't need to take care about identity. (Typically implemented as method&nbsp;in a colorService or colorFactory class for example)
<h3>Service</h3>
“...if a single process or transformation in domain is not a natural responsibility of an entity or value =&gt; make it a standalone service with a nice interface.&quot;<br /><br />  A service decouple entities and values from client (client in this case= the object thatwant to use another object) and therefore. They define an easy interface to use in client objects.
A service should
<ul><li>be stateless</li><li>be defined in the common language</li><li>use entity/value objects as parameters</li></ul>
A service should not be mixed with other layers:
<ul><li>be&nbsp;mixed with responsibility of infrastructure or system layer</li><li>be mixed with the application layer. For example export or import is not part of the domain layer (an export or import fileformat has no meaning in the domainlayer – they belong to application)</li></ul>
<h3>Modules</h3>
“If your model tells a story a modul is a “chapter””
<ul><li>helps understanding of large systems</li><li>low coupling between modules</li><li>independent development possible</li><li>if you group objects in a modul you want others to think of this objects together =&gt; group by meaning in the domain layer</li></ul>
<h3>Aggregates</h3>
It is difficult to guarantee the consistency of changes in a model with many associations. Aggregates helps to limit dependencies.
<img src="uploads/RTEmagicC_aggregate.jpg.jpg" height="152" width="344" alt="" />
An aggregate is a group of objects that belong together (a group of individual objects that represents a unit). Each aggregate has a aggregate root. The client-objects only &quot;talk&quot; to the aggregate root. 
<ul><li>Invariants and rules have to be maintained. The aggregate root normaly takes care of invariants.</li><li>cluster entities/values into aggregates and define boundaries around each.</li><li>One entity is the aggregate root and controls all changes and access to the objects inside</li><li> Delete have to delete complete boundary</li></ul>
<h3>Factory</h3>
“a car do not build itself” - a car is an useful and powerful object because of its associations and behavior, but to overload it with logic for creating it&nbsp; is unlikely!
A factory hides logic for building objects - this is especially relevant for aggregates!<br />A factory can be implemented as a seperate object or also as a embedded factory method.
<h4>Factory Method:</h4>
 Instead of a seperate factory object - a factory method can be located in existing elements: for example in an aggregate root or in a host class where it is natural (e.g. createOrder method in a BookingClass). 
<h4><b>Constructors</b></h4>
Factory functionality should only be located in the constructor if creation is simple and if there are good reasons. A constructor should always be atomic (never call other constructors).<br /><br />
<h4>A good factory:</h4>
<ul><li>is atomic (you need to pass all parameters that are need to build a valid &quot;thing&quot;)</li><li>are predictable</li><li>not allowed to give wrong results (instead throw exception)</li><li> the factory will be coupled to its arguments, therefore carefully choose the parameters:<ul><li> there is the danger of too much dependencies - better use parameters that are allready in the conceptual group or in dependencies allready</li><li>use abstract types as parameter</li></ul></li><li>the factory is responsible for invariants… (maybe delegate it)</li><li>there are also factories for reconstitution </li></ul>
<h4>Entity factory</h4>
Factories for entities takes just essential attributes that are required to make a valid entity or  aggregate. Details can be added later if they are not required by an invariant. The factory knows from where to get the identifier for an entity.
<h4>Value factory</h4>
Since value objects are immutable a factory or factory method for a value object takes the full description as parameters.
<h3>Get references of entities and objects:</h3>
To do anything with an object you need to have a reference to it:
So how to get it? There are several options:
<ol><li>build a new object - e.g. with the help of a&nbsp;factory</li><li>reconstitution of an object (relevant when the id is known - done by the factory)</li><li>traversal between objects, means to ask other objects for objects. For example that have to be used for inner aggregates of course.</li></ol>
But there are some entities that need to be accessible through search based on attributes. One way to deal with this is the &quot;query and build&quot; techniquebut&nbsp;this&nbsp;tends on a too technical focus and views objects as datacontainer (that is not optimal for DDD).&nbsp;That&nbsp;is where&nbsp;repositories&nbsp;enter the scene...
<h3>Repositories</h3>
For each object where you need global access create a repository object that can provide the illusion of an in memory collection of all objects of that type. Setup access through a well knows global interface.
A Repository typically has methods for add, remove and find (=select based on some criteria). Advantages:
<ul></ul>
<ul><li>Decouple client from technical storage</li><li>Performance tuning possible</li><li>Communicate design decisions related to data access</li><li>keep model focus</li><li>dummy implementation for unit testing is possible.</li><li>Repositories can hide the OR mapping.</li></ul>
If the repository is responsible for retrieving a certain entity that is build by a factory, the repository normally calls the &quot;reconstitution&quot; method of the factory.
<h2>Bigger picture</h2>
&nbsp;<img clickenlarge="1" src="uploads/RTEmagicC_ddd.jpg.jpg" height="411" width="366" alt="" />
<sup>This diagram (taken from the book) is an overview showing the parts of domain driven design.</sup>
Beside the building blocks Eric Evans also pointed out principles that should help to have a supple design in the implementation. One of the main goal of a supple design is that you have code where the developers love to work with - because it is understandable, logic, maintainable and extendable. This are some of the the principles:
<ul><li>classes should have an &quot;intention revalving interface&quot;: names of classes and methods  should explain clearly what they do. </li><li> methods shouldn't have side-effects: As much as possible should be query (no change to the state of the model). Commands should be clear and simple.</li><li> If there are unavoidable sideeffects they should be made explicit through assertions. (e.g. state post-conditions and invariants)</li><li>conceptual contours: <i>&quot;Decompose design elements (operations, interfaces, classes, and aggregates) into cohesive units, taking into consideration your intuition of the important divisions in the domain. Observe the axes of change and stability through successive refactorings and look for the underlying conceptual contours that explain these shearing patterns. Align the model with the consistent aspects of the domain that make it a viable area of knowledge in the first place.&quot;</i></li><li>where logic use simple &quot;standalone classes&quot; with a certain functionality, that is easier to understand and better to maintain (e.g. because you have less dependencies)</li><li>closure of operations, simple means a method should answer with the same object/datatype which it takes as parameters. You should use this where possible because no new dependencies are introduced when using this method.</li></ul>
DDD supports the agile paradigm and  ideally goes hand and hand with refactoring, test driven development and an agile project management like scrum.

<h2>More to read</h2>
<link http://www.amazon.de/Domain-Driven-Design-Tackling-Complexity-Software/dp/0321125215/ref=cm_lmf_tit_1 _blank>Buy the book :-)</link>
or download an extract: http://domaindrivendesign.org/books/PatternSummariesUnderCreativeCommons.doc 
<h3>Domain Driven Design in practice</h3>
<ul><li> There is a sample application to show how the implementation with domain driven design can work. It is the example application for cargo (used also in the book from Eric Evans): <link http://dddsample.sourceforge.net>http://dddsample.sourceforge.net/</link></li><li>There is also a good article abould DD in practice with a demo application for download: http://www.infoq.com/articles/ddd-in-practice &nbsp;</li></ul>

<h3>Links</h3>
<ul><li>The homepage of Domain Driven Design is www.domaindrivendesign.org - it is maintained by the leaders in this area like Eric Evans and Jimmy Nilsson.</li><li>Recently a interesting interview was published there: http://domaindrivendesign.org/events/qcon2008SF/eric_evans/index.html</li><li>New book from Martin Fowler: http://martinfowler.com/dslwip/</li><li>http://www.domainlanguage.com/ddd/index.html </li></ul>


<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=ZUEKa3xs8cI:JkXCgw78a8M:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=ZUEKa3xs8cI:JkXCgw78a8M:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/ZUEKa3xs8cI" height="1" width="1"/>]]></content:encoded>
			<category>news</category>
			<category>pattern</category>
			
			
			<pubDate>Wed, 07 Jan 2009 13:36:02 +0100</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/domain-driven-design-introduction.html</feedburner:origLink></item>
		
		<item>
			<title>New Imagemap Extension</title>
			<link>http://feedproxy.google.com/~r/Typo3Blog/~3/859V_DZY5j8/imagemap-plugin-for-typo3.html</link>
			<description>A few months ago one of our customers complained about the Imagemap solution he had. The most...</description>
			<content:encoded><![CDATA[A few months ago one of our customers complained about the Imagemap solution he had. The most annoying fact was that the existing extensions from TER did not work properly with Workspaces. Now this has changed :)<br />&nbsp;<br />It took a while but now we can offer a completely new Imagemap extension which integrates seamlessly into the normal TYPO3 Backend without XCLASSes, with workspace support and with -as we hope- increased usability. Another improvement of the extension is that the created links are also reported to the TYPO3 refindex.<br />&nbsp;<br />The extension provides a new content type &quot;ImageMap&quot; which works on top of the normal image type; the only difference is an additional field wich can be edited with a wizard (compareable to the Colorpicker Wizard). The image in the wizard is rendered as if it was rendered in the Frontend, therefore every effect and option from the normal image element (or extension for this element) can be used in connection with the Imagemap! 
The Implementation of the User-Interface is based on jQuery and is a good example for object-oriented JavaScript solutions.<br />&nbsp;<br /> At the moment there are still some features which are awaiting implementation- If you want to review or test the current solution you can download it from the TER (http://typo3.org/extensions/repository/view/imagemap_wizard/ ) or directly via SVN from Forge (<link http://forge.typo3.org/projects/show/extension-imagemap_wizard/>http://forge.typo3.org/projects/show/extension-imagemap_wizard/</link>).  <br />Sugesstions are always welcome.<br /><br /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=859V_DZY5j8:P7Cj8GBLNeI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/Typo3Blog?a=859V_DZY5j8:P7Cj8GBLNeI:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/Typo3Blog?d=7Q72WNTAKBA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/Typo3Blog/~4/859V_DZY5j8" height="1" width="1"/>]]></content:encoded>
			<category>news</category>
			
			
			<pubDate>Thu, 04 Dec 2008 10:36:00 +0100</pubDate>
			
		<feedburner:origLink>http://www.typo3-media.com/blog/imagemap-plugin-for-typo3.html</feedburner:origLink></item>
		
	</channel>
</rss>
