<?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: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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>simon r jones</title>
	
	<link>http://www.simonrjones.net</link>
	<description />
	<lastBuildDate>Sun, 08 Aug 2010 20:52:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/simonrjones" /><feedburner:info uri="simonrjones" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>test</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/xhWbfv76Khc/</link>
		<comments>http://www.simonrjones.net/2010/08/test/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 20:52:59 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=263</guid>
		<description><![CDATA[test
]]></description>
			<content:encoded><![CDATA[<p>test</p>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/xhWbfv76Khc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/08/test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/08/test/</feedburner:origLink></item>
		<item>
		<title>A contents index for Zend Framework manual pages</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/KmKkp9Yxch4/</link>
		<comments>http://www.simonrjones.net/2010/08/contents-index-for-zf-manual-pages/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 22:24:36 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=239</guid>
		<description><![CDATA[The good old Zend Framework manual pages do suffer from being somewhat lengthy. I&#8217;ve thought they could do with an index to make navigation easier on those oh-so-long pages. So I wrote a quick JavaScript bookmarklet to do just that.


Just drag this ZF Manual Index bookmark onto your browser bookmarks bar. Clicking the bookmark will [...]]]></description>
			<content:encoded><![CDATA[<p>The good old <a href="http://framework.zend.com/manual/en/">Zend Framework manual pages</a> do suffer from being somewhat lengthy. I&#8217;ve thought they could do with an index to make navigation easier on those oh-so-long pages. So I wrote a quick JavaScript bookmarklet to do just that.</p>
<p><span id="more-239"></span><br />
<img src="http://www.simonrjones.net/wp-content/uploads/2010/08/Picture-2.png" alt="The content index inserted into a ZF manual page" title="The content index inserted into a ZF manual page" width="653" height="370" class="aligncenter size-full wp-image-243" /></p>
<p>Just drag this <a id="rs-login" href="javascript:ZF();function ZF(){var m=document.getElementById('manual-container');var h=C('h2');h.innerHTML='Index of Contents';var l=C('ul');var d=m.getElementsByTagName('div');var c=d.length;for(var y=0;y<c;y++){if(d[y].className=='section'){var i=C('li');var a=C('a');S(a,'href','#'+d[y].id);a.innerHTML=d[y].getElementsByTagName('h1')[0].innerHTML;A(i,a);A(l,i)}}var p=m.getElementsByTagName('hr')[0];m.insertBefore(C('hr'),p);m.insertBefore(h,p);m.insertBefore(l,p)}function C(n){return document.createElement(n)}function S(e,n,v){e.setAttribute(n,v)}function A(e,c){e.appendChild(c)}" onclick="alert('Drag this button onto your browser bookmarks bar.'); return false;">ZF Manual Index</a> bookmark onto your browser bookmarks bar. Clicking the bookmark will add a contents index to the top of any Zend Framework manual page. Helpful links ahoy!</p>
<p>If you want to <a href="/code/zf-manual-index.js">view the source code take a peek over here</a>.</p>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/KmKkp9Yxch4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/08/contents-index-for-zf-manual-pages/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/08/contents-index-for-zf-manual-pages/</feedburner:origLink></item>
		<item>
		<title>Understanding the stack index for Zend Framework Controller plugins</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/s6yT3YH2Hsk/</link>
		<comments>http://www.simonrjones.net/2010/07/undertstanding-zf-plugins-stack-index/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 10:34:29 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[Quick tips]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=227</guid>
		<description><![CDATA[Zend Framework Controller plugins are a powerful way to inject logic into your controller system at various points, such as before and after an action dispatch. Plugins are run in the order they are added, though it is possible to change the order by defining a custom stack index. ZF internal plugins such as Zend_Controller_Plugin_ErrorHandler, [...]]]></description>
			<content:encoded><![CDATA[<p>Zend Framework Controller plugins are a powerful way to inject logic into your controller system at various points, such as before and after an action dispatch. Plugins are run in the order they are added, though it is possible to change the order by defining a custom stack index. ZF internal plugins such as Zend_Controller_Plugin_ErrorHandler, which displays a nice Error 404 page, has a stack index of 100 to ensure it runs near the end of any plugin cycle. However, it&#8217;s not so obvious from the <a href="http://zendframework.com/manual/en/zend.controller.plugins.html">ZF manual</a> how to set a custom stack index.<br />
<span id="more-227"></span><br />
For example, you may have a common admin system layout that does various things to your admin page layout before the page is displayed. This could be registered in your controller as so:</p>
<pre class="brush: php">
$front = $this->getFrontController();
$adminLayout = new My_Controller_Plugin_AdminLayout($this->_helper->layout());
$front->registerPlugin($adminLayout);
</pre>
<p>If you want to alter the plugin so it runs after any other local plugins you could specify a stack index of 10 as a second argument:</p>
<pre class="brush: php">$front->registerPlugin($adminLayout, 10);</pre>
<p>However, unless you know what the existing plugin stack indexes are it&#8217;s difficult to know what stack index you should be using. You can use this small code snippet to output the plugin name and its associated stack index, again via your controller.</p>
<pre class="brush: php">foreach ($front->getPlugins() as $stackIndex => $plugin) {
    Zend_Debug::dump(get_class($plugin), $stackIndex);
}</pre>
<p>The standard ZF plugin list should be something like:</p>
<pre>99 string(36) "Zend_Layout_Controller_Plugin_Layout"
100 string(35) "Zend_Controller_Plugin_ErrorHandler"
999 string(33) "Zend_Wildfire_Channel_HttpHeaders"</pre>
<p>Hope this helps shed light on a rather useful feature of ZF! You can find out more at this excellent Devzone article on <a href="http://devzone.zend.com/article/3372">Front Controller Plugins in Zend Framework</a>.</p>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/s6yT3YH2Hsk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/07/undertstanding-zf-plugins-stack-index/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/07/undertstanding-zf-plugins-stack-index/</feedburner:origLink></item>
		<item>
		<title>Sub-modules in Zend Framework</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/M9DQU_A6Gao/</link>
		<comments>http://www.simonrjones.net/2010/06/sub-modules-in-zend-framework/#comments</comments>
		<pubDate>Sun, 20 Jun 2010 14:14:03 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=213</guid>
		<description><![CDATA[Following on from my post on Admin sub-modules I&#8217;ve refactored the code into a more generic sub-modules system. And fixed some bugs!
Its main features are:

Organise modules into sub-folders where you need to support a complex collection of controllers, views, models, etc
Supports URLs in the format: /sub-module/module/controller/action
Supports ID route: /sub-module/module/controller/action/id
Registers controller folder to support above URLs
Autoloads [...]]]></description>
			<content:encoded><![CDATA[<p>Following on from my post on <a href="/2010/06/admin-sub-modules-in-zf/">Admin sub-modules</a> I&#8217;ve refactored the code into a more generic sub-modules system. And fixed some bugs!</p>
<p>Its main features are:</p>
<ul>
<li>Organise modules into sub-folders where you need to support a complex collection of controllers, views, models, etc</li>
<li>Supports URLs in the format: /sub-module/module/controller/action</li>
<li>Supports ID route: /sub-module/module/controller/action/id</li>
<li>Registers controller folder to support above URLs</li>
<li>Autoloads module resources (using Zend_Application_Module_Autoloader) in the format: submodulenameModulename_Resource (i.e. AdminUser_Form_Registration)</li>
</ul>
<p>This supports URL routes such as:</p>
<p><em>www.domain.com/admin/user/ -><br />
application/admin-modules/user/controllers/IndexController.php</p>
<p>www.domain.com/cms/news -><br />
application/cms-modules/news/controllers/IndexController.php</em></p>
<p>It&#8217;s a bootstrap resource that can be enabled in your application.ini file as so:</p>
<pre>; 'admin' key is the name of sub-module group = path to sub-modules directory
resources.subModules.admin.directory = APPLICATION_PATH "/admin-modules"</pre>
<ul>
<li><a href="/code/sub-modules/Submodules.zip">Download S24_Application_Resource_Submodules</a></li>
<li><a href="/code/sub-modules/Submodules.phps">View S24_Application_Resource_Submodules source code</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/M9DQU_A6Gao" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/06/sub-modules-in-zend-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/06/sub-modules-in-zend-framework/</feedburner:origLink></item>
		<item>
		<title>Zend Framework Application Patterns at DPC10</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/iuzIAU9dqsw/</link>
		<comments>http://www.simonrjones.net/2010/06/zend-framework-application-patterns-dpc10/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 11:26:20 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=201</guid>
		<description><![CDATA[I&#8217;m currently in the fine city of Amsterdam enjoying what is incredibly my first PHP conference in ten years of developing with the language! Yesterday was tutorial day, with the full conference starting today, and I sat in Zend Framework Application Patterns by the informative and engaging Matthew Weier O&#8217;Phinney and Rob Allen. 
The session [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently in the fine city of Amsterdam enjoying what is incredibly my first PHP conference in ten years of developing with the language! Yesterday was tutorial day, with the full conference starting today, and I sat in Zend Framework Application Patterns by the informative and engaging <a href="http://weierophinney.net/">Matthew Weier O&#8217;Phinney</a> and <a href="http://akrabat.com/">Rob Allen</a>. </p>
<p>The session was excellent, well worth attending, and dipped into many areas of ZF. Some of which I knew already, but there was certainly enough good tips on how to organise applications efficiently in ZF which I&#8217;ll be telling my team all about when I get back to the UK. </p>
<p>My notes from the tutorial day appear below, be warned they are rather long! You can also review the <a href="http://www.slideshare.net/weierophinney/zend-framework-workshop-4480868">Zend Framework Workshop slides</a> over at Slideshare.<br />
<span id="more-201"></span></p>
<h2>Service layers</h2>
<p>Think of the application as an onion layer. From the inside out:</p>
<ul>
<li>Data Access objects (inner layer)</li>
<li>Data Mappers, Repositories, Transaction scripts</li>
<li>Domain Models and Entities (plain old PHP objects)</li>
<li>Service layer (outer layer: how will I interact with all this, the public API)</li>
</ul>
<p>It&#8217;s better to have a rich domain model, validation in domain model.</p>
<ul>
<li>Start with a plain old PHP object</li>
<li>Define schema based on objects you use</li>
<li>Create objects <em>first</em></li>
<li>Create schema once models have been created and tested</li>
</ul>
<p>Use mappers or transaction scripts to translate objects to data and back again.</p>
<p>Use Service Object to manipulate entities. Ie.</p>
<ul>
<li>fetchEntry()</li>
<li>fetchComments()</li>
<li>addComment(), etc</li>
</ul>
<p>What&#8217;s in a Service Layer?</p>
<ul>
<li>Application specific logic</li>
<li>Forms, validation, caching</li>
</ul>
<p>All the bits and pieces of the app I don&#8217;t want to deal with when writing the front-end.</p>
<p>Q: Should we use services for everything? <br />
A: Use for all parts of an app, easy to test</p>
<p>Rob added: </p>
<ul>
<li>he uses the form as the service layer</li>
<li>uses a mapper class based on Zend<em>Db</em>Table</li>
<li>compose the form in the service layer</li>
<li>tend to put search indexing on mapper layer (postSave method)</li>
</ul>
<h2>ACL</h2>
<p>ACL is roles, resources and rights (resource privileges). By default ACL operates as a whitelist (i.e. open up privileges to those you trust).  Blacklisting is less secure, not recommended.</p>
<p>One approach is to extend Zend_Acl and set up roles and resources in constructor. Roles are simply text strings. Resources are much the same but have an array of privileges that can also be passed (i.e. read, write).</p>
<p>Suggested logic:</p>
<ul>
<li>Check ACL</li>
<li>Check the role acting on a resource has a right to perform the action</li>
<li>isAllowed() &#8211; checks role, resource, privilege</li>
</ul>
<p>Matthew added:</p>
<ul>
<li>I like to throw a specific exception for failed ACLs so I can detect it</li>
<li>I can then check for another exception case in the ErrorController to display a Not Authorised page (nice approach)</li>
</ul>
<h2>Paginators</h2>
<ul>
<li>Return paginators from your domain models</li>
<li>Consumers can specify offset and limit</li>
<li>Zend_Paginator implements IteratorAggregate and toJson()</li>
<li>Paginators have efficient, lazy loading</li>
</ul>
<p>I.e. fetchAll() in domain model returns paginator</p>
<h2>Zend_Application</h2>
<ul>
<li>For common configuration &amp; per-environment configuration</li>
<li>Resource injection so you can use bootstrap as resource repository</li>
<li>Resources: in bootstrap class or as a re-usable plugin resource</li>
<li>Reusing for a service endpoint (i.e. set environment = jsonrpc)</li>
<li>Dependency tracking</li>
<li>Accessing resources via controller</li>
<li>Module bootstrapping. Not particularly good at present. Runs all module bootstraps if exists. Order of running module/main app boostraps ambigious. Don&#8217;t mix resource names/application.ini key names in main app + module. Kathryn Reeve wrote a nice <a href="http://binarykitten.me.uk/dev/zend-framework/177-active-module-based-config-with-zend-framework.html">module bootstrapping solution</a>. </li>
</ul>
<h2>Routing clinic</h2>
<p>As an aside throughout the day Matthew and Rob have been using the syntax <code>use Zend_Long_Class_Name as ShortName</code> &#8211; nice way to alias class names in PHP 5.3</p>
<ul>
<li>Basics: Name the route, specify the path, specify default values and optional validation</li>
<li>RegexRoute can support: <code>'blog/(?&lt;id&gt;[^.]*\+)\.(?&lt;format&gt;xml|json)'</code></li>
<li>That regex route stores first param as &#8216;id&#8217;, 2nd as &#8216;format&#8217; (that&#8217;s the handy <code>?&lt;name&gt;</code> format)</li>
<li>Regex routes are very fast, even more so in PHP 5.3</li>
<li>Touched on hostname routing which you then need to chain with a normal route</li>
<li>RESTful routes Zend via <a href="http://www.framework.zend.com/manual/en/zend.controller.router.html#zend.rest.route">Zend_Rest_Route</a></li>
<li>Can specify as default route, or add it for all controllers in a module</li>
<li>Or set REST routes for specific module / controller / actions</li>
<li>Controller then needs to extend Zend<em>Rest</em>Controller (listAction, postAction, etc)</li>
<li>ID is accessed via getParam(&#8217;id&#8217;)</li>
</ul>
<h2>Layout View Helpers</h2>
<ul>
<li>You should always run output via the $this->escape() view helper! In ZF2 it will be default when you echo content</li>
<li>Layout helpers: Set metadata, aggregate content, rendered in layout</li>
<li>If you have CSS/JS related to a particular layout put it in your view script. Really important for maintenance.</li>
<li>doctype() affects rendering of other view helpers, i.e. forms. Ideally needs to be set in bootstrap: <code>resources.view.doctype = XHTML1_STRICT</code></li>
<li>Head view helpers &#8211; can append and prepend content.
<ul>
<li>headMeta(), headTitle(), headScript(), headStyle(), headLink()</li>
<li>inlineStyle() &#8211; usually at top of body</li>
<li>inlineScript() &#8211; usually at bottom of body</li>
</ul>
</li>
<li>Use a layout helper if your functionality is shared across multiple view scripts to set all this common stuff</li>
<li>Append and prepend helps give an order to things like how CSS files are loaded</li>
<li><code>echo $this->baseUrl('path/to/file')</code> will return BASE_URL . &#8216;path/to/file&#8217; which is handy</li>
</ul>
<h2>Zend_Navigation</h2>
<ul>
<li>Helps manage trees of pointers to web pages</li>
<li>Supports HTML header links (i.e. next, previous, alt formats)</li>
<li>Can generate XML Sitemaps (used by Google)</li>
<li>Translate link text</li>
<li>Conditionally display links based on ACL</li>
<li>Two main concepts are pages and containers</li>
<li>Page types: MVC (router based URLs), URI (static URLs)</li>
<li><code>$page = Zend_Navigation_Page::factory(array('uri' =&gt; '/uri'))</code></li>
<li>Containers implements RecursiveInterator (iterate entire tree) &amp; Countable</li>
<li>Pages are also a container, you can have trees of pages</li>
<li>Add pages with $container->addPage()</li>
<li>Can add multiple pages via addPages()</li>
<li>You can remove pages based on index or order number </li>
<li>Visibility and active page properties affect whether a page is rendered to the page</li>
<li>Can find pages via methods like findOneBy(), findAllBy(), findOneByLabel()</li>
<li>You can define your own metadata for pages. For example if you have a &#8216;tag&#8217; property, find method for nav is findAllBy(&#8217;tag&#8217;, &#8216;value&#8217;) or findAllByTag(&#8217;value&#8217;)</li>
<li>
<p>Rendering on the page:</p>
<pre>foreach ($container as $page) {
    echo $page->label;
}</pre>
</li>
</ul>
<p><em>Cache your definitions</em></p>
<ul>
<li>On first request build programmatically and cache via toArray()</li>
<li>On subsequent requests load from cached array</li>
<li>Only use when you need it (i.e. not when doing JSON requests, service calls, etc)</li>
</ul>
<h3>Navigation view helpers</h3>
<ul>
<li><code>$view-&gt;navigation()-&gt;setAcl($acl);</code></li>
<li><code>$view-&gt;navigation()-&gt;setRole($role);</code></li>
<li>Can set default ACL and default roles in your bootstrap. I&#8217;d suggest passing ACL from your controller into your view.</li>
<li>Check for ACLs with hasAcl() &amp; hasRole()</li>
<li>echo <code>$this-&gt;navigation()-&gt;htmlify($page);</code></li>
<li>Renders link, uses label as title attribute</li>
<li>
<p>Conditionally echo link</p>
<pre>if ($this->navigation()->accept($page)) {
    $this->navigation()->htmlify($page);
}</pre>
</li>
<li>
<p>Note that other Nav view helpers are ACL-aware. I.e. <code>echo $this-&gt;navigation()-&gt;sitemap()</code></p>
</li>
<li>Sitemap specific metadata: lastmod, changefreq, priority</li>
<li>Set priority of news list pages lower than news pages themselves, so Google deeplinks to article pages rather than news list pages</li>
<li>Render breadcrumbs via <code>$this-&gt;navigation()-&gt;breadcrumb()</code></li>
<li>Useful configuration is setMaxDepth($depth) to avoid very long breadcrumbs</li>
<li><code>echo $view-&gt;navigation()-&gt;menu()-&gt;renderSubMenu()</code> &#8211; current active tree only</li>
<li>Gotcha with breadcrumbs. If current page is hidden it won&#8217;t render breadcrumb</li>
</ul>
<h2>Caching</h2>
<ul>
<li>Principle: Request from browser, is it cached? If so serve from cache, if not generate and save in cache</li>
<li>Adapter based system. Front-end = what to cache, Back-end = where to cache</li>
<li>Front-end options: set lifetime = null to cache forever (you then control when you empty the cache)</li>
<li>Manually initialise cache in bootstrap. I.e. _initCache()</li>
<li>
<p><strong>Don&#8217;t do it that way!</strong> There is a better way! Use Zend_Cache_Manager (manage multiple caches)</p>
<ul>
<li>Lazy loads on demand</li>
<li>Contains preconfigured caches</li>
<li>Application resource</li>
<li>Can use action helper to access it</li>
</ul>
</li>
</ul>
<pre>resources.cachemanager.default.frontend.options.lifetime = "..."
backend.options.cache<em>dir = APPLICATION</em>PATH ".."</pre>
<p>&#8216;default&#8217; is name of cache. Make sure you use different keys for multiple caches.</p>
<p>Controller:</p>
<pre><code>protected function _getCache()
{
   $bootstrap = $this->getInvokeArg('boostrap');
   return $bootstrap->getResource('cachemanager')-&gt;getCache('default');
}

// Helper
$cache = $this-&gt;_helper-&gt;getHelper('Cache')-&gt;getManager()-&gt;getCache('default');
</code></pre>
<ul>
<li>Zend_Cache_Page = full page caching &#8211; skip entire MVC stack</li>
<li>Implement in index.php before config loading</li>
<li>frontend options: &#8216;regexps&#8217;states which pages to enable page caching for. Not usually what you want for all pages on a site (i.e. dynamic content, forms for error validation, shopping baskets, etc)</li>
<li>You can state cache everything apart from exceptions with regex rules</li>
</ul>
<p><em>Some numbers to think about</em></p>
<ul>
<li>No caching: 12 trans/sec, cache DB: 29 trans/sec, cache page: 359 trans/sec</li>
<li>
<p>With APC enabled: no caching: 19 trans/secs, cache db: 289 trans/sec, cache page: 3251 trans/sec</p>
</li>
<li>
<p><a href="http://framework.zend.com/manual/en/zend.cache.backends.html#zend.cache.backends.static">Static page cache</a> exists to store cache of HTML files to local document root. Amazing performance.</p>
</li>
</ul>
<h2>Context Switching</h2>
<ul>
<li>Context switching is the act of providing different output based on criteria from the request</li>
<li>I.e. XMLHttpRequest, REST, Mobile device</li>
<li><a href="http://wurfl.sourceforge.net/">WRFL</a> &#8211; list of all mobile platforms and browser detection strings &amp; capabilities</li>
<li>Works via a &#8216;format&#8217; parameter request. This can be set via:<br />
&#8211; Query param<br />
&#8211; Special route<br />
&#8211; Chained routes (&#8217;xml&#8217;, chain with a &#8216;.&#8217; &#8211; i.e. controller/action.xml)<br />
&#8211; HTTP headers (Accept header)</li>
<li>ContextSwitch action helper determines whether action has context matching the format</li>
<li>Additional view suffix is added (i.e. viewscript.json.phtml, viewscript.xml.phtml)</li>
<li>Keeps things explicit so you know where your code/views are </li>
</ul>
<p>Add context switching to controller:</p>
<pre><code>$contextSwitch = $this-&gt;_helper-&gt;getHelper('contextSwitch');
$contextSwitch-&gt;addActionContext('action', 'format')
              -&gt;initContext();
</code></pre>
<h2>Sitemaps and robots.txt</h2>
<p>A neat example of context switching from Rob.</p>
<ul>
<li>Two static routes sitemap.xml &amp; robots.txt </li>
<li>Format values of &#8216;xml&#8217; and &#8216;txt&#8217;</li>
<li>Have to manually add context for txt (sets the correct Content-type header)</li>
<li>View = sitemap.xml.phtml &amp; robots.txt.phtml</li>
<li>Can support HTML version of sitemap in sitemap.phtml</li>
<li>So context switching changes Content-type and view script and uses same controller action</li>
<li>Can do other stuff by getting param &#8216;format&#8217;</li>
</ul>
<h2>Header detection</h2>
<ul>
<li>setHeader(&#8217;Vary&#8217;, &#8216;Accept&#8217;) &#8211; tells browser not to cache Accept header. Important!</li>
<li>Set format based on accept header</li>
<li>getHeader(&#8217;Accept&#8217;): application/json or application/xml</li>
<li>To be honest I got lost around here. Will check out slides &amp; Matthew&#8217;s blog later <img src='http://www.simonrjones.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<h2>Form Decorators</h2>
<ul>
<li>Renders elements &amp; forms</li>
<li>Decorators stack from inside to outside</li>
<li>The order of your decorators is the most important thing</li>
</ul>
<p>Standard element decorators:</p>
<ol>
<li>Zend_Form_Decorator_ViewHelper &#8211; renders input field</li>
<li>Zend_Form_Decorator_Errors &#8211; UL list of errors</li>
<li>Zend_Form_Decorator_Description &#8211; P description</li>
<li>Zend_Form_Decorator_HtmlTag &#8211; DL/DL tags</li>
<li>
<p>Zend_Form_Decorator_Label &#8211; field label</p>
</li>
</ol>
<ul>
<li>The above happens in Zend_Form_Element::loadDefaultDecorators()</li>
<li>Decorator itself states whether it wraps other elements or not </li>
<li>Change this with: element->placement->prepend() &#8211; puts in front</li>
</ul>
<p>Standard form decorators:</p>
<ol>
<li>Zend_Form_Decorator_FormElements &#8211; form elements</li>
<li>Zend_Form_Decorator_HtmlTag  &#8211; DL tag</li>
<li>Zend_Form_Decorator_Form &#8211; FORM tag</li>
</ol>
<p>Common use cases to customise decorators:</p>
<ul>
<li>Change form element HTML (i.e. ul instead of dl)
<ul>
<li>Clear decorators and re-add them as you want them</li>
</ul>
</li>
<li>Change HTML outputted, i.e. parse form description using markdown
<ul>
<li>Extend Description decorator and alter output of description HTML</li>
</ul>
</li>
</ul>
<p>If you use your own decorator classes:</p>
<p><code>$form->addPrefixPath()</code> &#8211; for Form class<br />
<code>$form->addElementPrefixPath()</code> &#8211; for Form element &amp; Validate classes</p>
<ul>
<li>Write your own decorators. Implement a render() method to return HTML. Extends Zend_Form_Decorator_Abstract</li>
<li>render($content) accepts previously rendered content. You need to return the content you get in so you can wrap / append / prepend content &#8211; (that bit never made sense to me before!)</li>
<li>Good idea to check the user defined separator &amp; placement and alter output accordingly (otherwise you may break expected functionality)</li>
<li>Sidenote: Rob uses simple <code>App_</code> namespace for client website specific library files. Nice and straightforward</li>
<li>Rob displays errors on form, not element. He removes errors on each element and puts a list at the top. This is achieved via a custom decorator called <code>Form_Errors</code></li>
</ul>
<h2>Testing</h2>
<ul>
<li>What do I test?
<ul>
<li>Domain models  </li>
<li>Service layer objects</li>
<li>Integration testing (does your MVC generate the content you&#8217;re expecting?)</li>
</ul>
</li>
</ul>
<p><em>Testing MVC pages</em></p>
<ul>
<li>Extend Zend_Test_PHPUnit_ControllerTestCase</li>
<li>setup() creates instance of Zend_Application</li>
<li>assertions to match content. Uses CSS selectors aka jQuery (nice)</li>
<li>also supports XPath expressions to match content</li>
<li>redirect assertions</li>
<li>response assertions (response codes, matching header content)</li>
<li>request assertions (matching module, controller, action, route)</li>
</ul>
<p>I.e. Assert a H1 heading exists: <code>$this-&gt;assertQuery('#content h1')</code></p>
<h2>Q&amp;A</h2>
<p>I quizzed Rob in the break on CMS style routing where all page URLs are stored in a database. He expanded on this in the Q&amp;A session.</p>
<ul>
<li>MS_Controller_Router<em>Route</em>PostSlug (a slug = a URL fragment in good old WordPress terminology) </li>
<li>implements Zend_Controller_Router_Route_Interface</li>
<li>$router->addRoute(&#8217;postSlug&#8217;, new MS<em>Controller</em>Router<em>Route</em>PostSlug)</li>
<li>Must implement 3 methods:
<ul>
<li>getInstance() &#8211; not used in Rob&#8217;s example, <code>return new self();</code> neatly disables it</li>
<li>match() &#8211; must return array of module, controller, action. (This is totally undocumented in code or manual! Nice to see an example)</li>
<li>asemble() &#8211; creates a URL via url view helper. Usage may pass menu ID to create URL</li>
</ul>
</li>
</ul>
<p><em>match($path)</em></p>
<ul>
<li>method argument $path = URL path</li>
<li>if return false, router falls through to next route</li>
<li>Get slugs/URL fragments from DB in bootstrap &amp; cache it for speed</li>
<li>$slugs = array(URL => array(&#8217;module&#8217;, &#8216;controller&#8217;, &#8216;action&#8217;, &#8216;navigaton object&#8217;, &#8216;menu_id&#8217;) )</li>
<li>custom keys accessed via $request->getParam(&#8217;menu_id&#8217;)</li>
</ul>
<p><em>assemble($data = array(), etc)</em></p>
<ul>
<li>For normal routes you pass the module, controller, action, etc in via the $data array</li>
<li>In this example you can put the following into the $data array: full url, page, menuId</li>
<li>Returns URL string: output URL string . $this->_assembleRemainingParameters($data)</li>
<li>That last bit is important if any custom params have been passed to assemble by the user</li>
</ul>
<p>We all finished off with a stirring debate on how awful WSYIWYG editors are when someone asked how Rob convinces clients to use markdown.</p>
<ul>
<li>Rob just doesn&#8217;t give them a choice, doesn&#8217;t get many problems most clients OK (he is tech director so he can also decide within his company)</li>
<li>Rob uses <a href="http://daringfireball.net/projects/markdown/">Markdown</a> for clients (exactly what I used to markup all these notes!)</li>
<li>If you allow HTML input from the user then don&#8217;t try to sanitize with Zend<em>Filter</em>Striptags. Use <a href="http://htmlpurifier.org/">HTML Purifier</a> instead which can be used to create whitelists. Pádraic Brady has <a href="http://blog.astrumfutura.com/index.php?/plugin/tag/htmlpurifier">blogged a lot about HTML Purifier</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/iuzIAU9dqsw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/06/zend-framework-application-patterns-dpc10/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/06/zend-framework-application-patterns-dpc10/</feedburner:origLink></item>
		<item>
		<title>Admin sub-modules in Zend Framework</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/xIywv8oVOWk/</link>
		<comments>http://www.simonrjones.net/2010/06/admin-sub-modules-in-zf/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 20:19:50 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=92</guid>
		<description><![CDATA[Modules in Zend Framework essentially allow us to organise a collection of controllers into sub-folders, giving URL to filesystem mapping such as:
domain.com/user/register -> app/modules/user/RegisterController.php
While useful when we need to expand our URLs (and organisation of code) beyond one set of controllers, there are a few things they don&#8217;t currently solve which I think would make [...]]]></description>
			<content:encoded><![CDATA[<p>Modules in Zend Framework essentially allow us to organise a collection of controllers into sub-folders, giving URL to filesystem mapping such as:</p>
<p><em>domain.com/user/register -> app/modules/user/RegisterController.php</em></p>
<p>While useful when we need to expand our URLs (and organisation of code) beyond one set of controllers, there are a few things they don&#8217;t currently solve which I think would make them first-class citizens within ZF.<br />
<span id="more-92"></span><br />
I quite frequently find myself wanting some form of sub-modules, usually in admin systems where one &#8220;admin&#8221; module just doesn&#8217;t cut it for larger sites. Without modules we&#8217;re stuck with an <code>AdminController.php</code> which obviously gets very messy, very quickly. With modules, we can have an &#8220;admin&#8221; module with as many controllers as we wish. This is fine, until a site needs to manage lots of discrete elements.</p>
<p>For example, imagine a site with a CMS, user management system and a custom system to search for wines. While you could have a CmsController, UserController and WinesController in your &#8220;admin&#8221; module, it&#8217;s likely Cms and User would benefit from splitting out into multiple controllers of their own.</p>
<p>There&#8217;s also the issue of modularity. If I design a user management app which I want to re-use, it&#8217;s easier if I can install this into a folder (or SVN external it). If reusable components are mixed in the same folder they become harder to maintain and keep up to date. </p>
<p>In one attempt to solve this I created an Admin Modules bootstrap resource, which hijacks the domain.com/admin route and enables you to add admin modules to this URL. </p>
<p>To enable an admin module simply create a folder in your application folder called admin-modules. Within here simply place each module. Mapping works as follows:</p>
<p><em>domain.com/admin/  <br />
-> application/admin-modules/default/controllers/IndexController.php</em></p>
<p><em>domain.com/admin/user/  <br />
-> application/admin-modules/user/controllers/IndexController.php</em></p>
<p>Within each admin module the normal ZF rules for URL routing applies. For convenience my bootstrap resource also sets up an ID route: </p>
<p><em>domain.com/admin/user/groups/view/4  <br />
-> application/admin-modules/user/controllers/GroupsController.php / viewAction</em><br /> passing a param called &#8220;id&#8221; with a value of 4.</p>
<p>The filesystem structure works as so:</p>
<pre>
application/
            admin-modules/
                          default/
                                  controllers/
                                  etc..
                          user/
                               controllers/
                               etc..
</pre>
<p>So <code>admin-modules</code> basically works like a copy of the main modules folder. Just for admin-only modules.</p>
<p>To enable this simply add the following line to your Zend_Application application.ini config file:</p>
<pre>; Register a custom Bootstrap resource path (needs to be in your include path)
pluginPaths.S24_Application_Resource = "S24/Application/Resource"

; Enable admin modules
resources.adminModules.enable = []</pre>
<p><strong>Note: </strong> Please now see the <a href="http://www.simonrjones.net/2010/06/sub-modules-in-zend-framework/">sub-modules system</a> for an improved way to implement this. </p>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/xIywv8oVOWk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/06/admin-sub-modules-in-zf/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/06/admin-sub-modules-in-zf/</feedburner:origLink></item>
		<item>
		<title>Falling foul of special characters</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/EtTGEntxiYY/</link>
		<comments>http://www.simonrjones.net/2010/06/falling-foul-special-characters/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 20:49:48 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[Web development]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=112</guid>
		<description><![CDATA[These days its pretty standard to require support for multiple languages and special characters on your website. But it&#8217;s still terribly easy to trip up and make mistakes, usually indicated by weird characters popping up across your web content. Here&#8217;s a few tips on how to sort out your character encoding.

When things go wrong
You might [...]]]></description>
			<content:encoded><![CDATA[<p>These days its pretty standard to require support for multiple languages and special characters on your website. But it&#8217;s still terribly easy to trip up and make mistakes, usually indicated by weird characters popping up across your web content. Here&#8217;s a few tips on how to sort out your character encoding.<br />
<span id="more-112"></span></p>
<h2>When things go wrong</h2>
<p>You might see characters like Â or ¿½ popping up over your text. This indicates the web browser is having problems interpreting the characters. The usual cause is a mismatch of the character encoding between how it is stored (by the filesystem or database) and how it is displayed (by the browser).</p>
<p>One common issue is to store a UK price with the pound sign in UTF-8 and display it as Latin-1. If you do that, you&#8217;ll get the rather catchy: Â£5.99</p>
<p>You might also spot the pretty black diamond question mark character: �</p>
<p>This is the Unicode replacement character and is displayed if the browser can&#8217;t output the correct symbol. Again, this is usually a mismatch of encodings, for example storing the content in Latin-1 and displaying as UTF-8.</p>
<h2>UTF-what?</h2>
<p>UTF-8 is a popular character encoding for Unicode, the current standard for storing text on computer systems. Unicode has over 107,000 characters and is intended to support all languages. Compare this with the catchy ISO-8859-1, also known as Latin-1, which contains only 192 characters. And doesn&#8217;t fully support French.</p>
<h2>How to make your website Unicode friendly</h2>
<p>Basically you need to store, transfer and display content as UTF-8 to ensure reliable Unicode character support. Some tips on a few common areas where character encoding affects the web appear below.</p>
<h3>Files</h3>
<p>The most obvious place to start is your files, i.e. HTML, CSS, JavaScript and any scripting languages such as PHP. If you have any special characters in a file (i.e. content in a web page or in a template) then you need to ensure you save those files as UTF-8. </p>
<p>The simplest thing is to just ensure all your files are saved as UTF-8. This is usually possible in a modern text editor. See below for tips on some common editors:</p>
<ul>
<li>In TextMate just go to <em>Preferences > Advanced</em> to set the default character encoding</li>
<li>In Coda it&#8217;s <em>Preferences > Editor</em></li>
<li>In Eclipse, or Zend Studio, it&#8217;s in <em>Preferences > General > Workspace</em></li>
</ul>
<p>You can usually tell if you have a decent text editor or IDE if when you select <em>Save As</em> you get an option to change character encoding.</p>
<h3>MySQL</h3>
<p>Ensure all your database tables use UTF-8 encoding: <code>utf8_general_ci</code>. This can easily be achieved by simply choosing this encoding when creating tables. </p>
<p>Whenever you connect to MySQL make sure you run the following SQL. This ensures MySQL selects and inserts data as UTF-8. </p>
<pre class="brush: sql">SET NAMES utf-8</pre>
<p>Bear in mind before MySQL 4.1 UTF-8 wasn&#8217;t fully supported and the default character encoding was <code>latin1_swedish_ci</code>. If you want to convert your data to UTF-8 take a look at this O&#8217;Reilly article on <a href="http://www.oreillynet.com/onlamp/blog/2006/01/turning_mysql_data_in_latin1_t.html">converting data from Latin-1 to UTF-8</a> or a Drupal guide <a href="http://drupal.org/node/198184">on migrating from MySQL 4.0 to 4.1</a>.</p>
<h3>Apache</h3>
<p>You can check the default encoding of your webserver by publishing a blank HTML page and using the <a href="https://addons.mozilla.org/en-US/firefox/addon/60">Firefox Web Developer toolbar</a> plugin to view the page response headers (Information > View Response Headers). You should see a line like:</p>
<pre>Content-Type: text/html; charset=ISO-8859-1</pre>
<p>A lot of webservers serve Latin-1 by default (just like the above example). If you don&#8217;t see a charset entry in there most web browsers also default to Latin-1. If this is the case ideally you need to change the character encoding HTML files are served as. </p>
<p>If you can change your Apache settings then open up your <code>httpd.conf</code> file, look for a line starting  <em>AddDefaultCharset</em> and ensure it reads as so:</p>
<pre class="brush: plain">AddDefaultCharset UTF-8</pre>
<p>Make sure you remove any comment character (#) from the start of the line to enable this declaration. You&#8217;ll need to configtest Apache and gracefully restart it to make the changes appear. If you don&#8217;t know how to do that you really shouldn&#8217;t be editing the server&#8217;s <code>httpd.conf</code> file ;-&#41;</p>
<p>If you&#8217;re on a shared server, or you don&#8217;t want to set a default for all websites on Apache, you can set UTF-8 encoding for just one website via the <code>VirtualHost</code> declaration.</p>
<pre class="brush: plain">
&lt;Directory /path/to/document-root&gt;
  AddCharset UTF-8 .html .php .js .css
&lt;/Directory&gt;</pre>
<p>Just add all the file extensions you want outputted at UTF-8.</p>
<p>This can also be done via an <code>.htaccess</code> file in the document root of your website (while flexible it will be slightly slower):</p>
<pre class="brush: plain">AddCharset UTF-8 .html .php .js .css</pre>
<p>If all else fails and you&#8217;re using PHP to output your web pages, you can force it in PHP with:</p>
<pre class="brush: php">header('Content-Type: text/html; charset=utf-8');</pre>
<h3>HTML</h3>
<p>You should always state the character encoding in your HTML document. </p>
<p>In HTML 4 use:</p>
<pre class="brush: html">&lt;meta http-equiv="Content-Type"  content="text/html; charset=utf-8"&gt;</pre>
<p>For XHTML (served as HTML) add the closing slash:</p>
<pre class="brush: html">&lt;meta http-equiv="Content-Type" content="text/html;charset=utf-8" /&gt;</pre>
<p>And HTML5 the far more elegant:</p>
<pre class="brush: html">&lt;meta charset="utf-8" /&gt;</pre>
<p>Keep this tag at the top of your <code><head></code> element (i.e. before the title tag or any other element). According to the HTML5 spec it&#8217;s supposed to be within the first 512 bytes of your document, which for most of us means you have about 250 spare characters if you are serving an XHTML page with a valid doctype. If you&#8217;re using the more spartan HTML5 you&#8217;ll have more like 400 characters to play with. </p>
<h3>Email</h3>
<p>Finally, when sending out emails make sure you specify the encoding in the email header:</p>
<pre class="brush: plain">Content-Type: text/plain; charset="UTF-8"</pre>
<p>This can be done in PHP as so:</p>
<pre class="brush: php">// $to, $subject and $messageBody omitted for brevity
$headers = 'From: name@domain.com' . "\r\n" .
    'Reply-To: name@domain.com' . "\r\n" .
    'Content-Type: text/plain; charset="UTF-8"';
mail($to, $subject, $messageBody, $headers);</pre>
<p>Though I&#8217;d recommend you use an email library such as Zend Framework&#8217;s excellent <a href="http://framework.zend.com/manual/en/zend.mail.html">Zend_Mail</a> to avoid things like nasty email header injection! </p>
<h2>And if all else fails</h2>
<p>If you&#8217;re managing an old site with data stuck with Latin-1 content all over the place, perhaps it&#8217;s easier to just serve that site as Latin-1. So if you have a webserver-wide default encoding of UTF-8 consider switching that for Latin-1 just for that website. You can always upgrade next time the client wants a site redesign!</p>
<h2>Find out more</h2>
<ul>
<li><a href="http://www.joelonsoftware.com/articles/Unicode.html">Joel Spolsky on Unicode</a></li>
<li><a href="http://www.w3.org/International/tutorials/tutorial-char-enc/">Character encodings in HTML and CSS</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/EtTGEntxiYY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/06/falling-foul-special-characters/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/06/falling-foul-special-characters/</feedburner:origLink></item>
		<item>
		<title>Designers vs Developers</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/34xSHkpK45E/</link>
		<comments>http://www.simonrjones.net/2010/05/designers-vs-developers/#comments</comments>
		<pubDate>Sun, 02 May 2010 20:55:19 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=161</guid>
		<description><![CDATA[Last Thursday I  participated in the latest CamCreative meetup, an evening of debate entitled &#8220;Designers vs Developers&#8221;. The evening was run by Nick Welsh who had prepared a number of problems that designers have with devs and vice versa. The idea was these questions would be discussed by the audience in roughly two halves [...]]]></description>
			<content:encoded><![CDATA[<p>Last Thursday I  participated in the latest <a href="http://camcreative.net/">CamCreative</a> meetup, an evening of debate entitled &#8220;Designers vs Developers&#8221;. The evening was run by Nick Welsh who had prepared a number of problems that designers have with devs and vice versa. The idea was these questions would be discussed by the audience in roughly two halves of designers and devs and then Steve O&#8217;Connor (designer camp) and I (developer camp) would air our collected views to varied heckling.<br />
<span id="more-161"></span><br />
It was a fun eve with a really impressive turnout (around 50 or so in the Arts Picturehouse bar). The six questions were rather generalised so I was conscious afterwards we probably repeated ourselves a bit and rambled around the subject. I know the apparently simple six questions ended up taking far too long to discuss which meant the bar was somewhat thinned out by the end!</p>
<p>The questions themselves were things like &#8220;Print designers cannot automatically design for the web&#8221;  and &#8220;Developers think they are web designers&#8221; which we both broadly agreed on. &#8220;Developers take too long to finish projects&#8221; was a little more contentious. My argument was that websites are complex and quite reasonably take time. Though there is often a misguided impression from clients once a design&#8217;s done the rest of it is easy. </p>
<p>There was one question that dealt with &#8220;Designers who don&#8217;t understand technology can&#8217;t design for the web&#8221;. To us devs that&#8217;s the one question of the evening that rings most true. Traditional print design is controlled and static, the web is flexible and interactive. </p>
<p>In the various points raised from people I clean forgot to point out the whole <a href="http://24ways.org/2009/make-your-mockup-in-markup">design in the browser</a> thing. At <a href="http://www.studio24.net/">Studio 24</a> we don&#8217;t expect our designers to craft each individual page lovingly in Photoshop. Instead we may start in Photoshop and once we&#8217;ve got an agreed look and feel we move into HTML/CSS and the designer continues there, designing straight in the browser. Design in the browser from scratch may not be for everyone, but the designer can only gain from being able to polish and realise their design directly in the browser where a web page acts like a web page and links are links. Personally I don&#8217;t see how a professional web designer can avoid using HTML and CSS in this day and age. The old &#8220;waterfall&#8221; technique of a designer handing over a PSD file to a developer for building is fast disappearing.</p>
<p>There were also various opinions from the floor. The copywriters quite rightly dug in highlighting the lack of attention they get in web projects. <a href="http://idrinkleadpaint.com/">Dominick</a> also pointed out the important role usablity and prototyping plays at <a href="http://www.red-gate.com/">Red Gate</a> before a designer starts to put mouse to screen.</p>
<p>There are obviously a lot of topics that basically cover the gamut of the professional web design process. Something which CamCreative organiser Paul Smith touched on at the end saying he may try to run a longer day of talks on this topic if there&#8217;s interest.</p>
<p>I guess in summary it wasn&#8217;t really a debate as such, more a discussion on a set of topics. The evening highlighted good communication as key between the two camps, and for me I think both sides could learn a bit to understand the other. For developers its things like negative space and the grid. Go read <a href="http://designingfortheweb.co.uk/">Designing for the Web</a> by Mark Boulton for more. </p>
<p>For designers unaccustomed to HTML and CSS go buy Zeldman&#8217;s <a href="http://www.zeldman.com/dwws/">Designing with Web Standards</a> and start your journey into really designing for the web there. It&#8217;ll save you time and money, I promise <img src='http://www.simonrjones.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/34xSHkpK45E" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/05/designers-vs-developers/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/05/designers-vs-developers/</feedburner:origLink></item>
		<item>
		<title>Barcamb 3</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/cJNt_i5xffQ/</link>
		<comments>http://www.simonrjones.net/2010/04/barcamb3/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 21:20:44 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[Community]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=141</guid>
		<description><![CDATA[I attended my first barcamp this weekend, Barcamb 3 at the superb offices of Red Gate in Cambridge. As a barcamp newbie I was a little unsure of what to expect but the whole weekend was great fun, full of an interesting, open and welcome bunch of folk, well organised and a thoroughly enjoyable experience.
My [...]]]></description>
			<content:encoded><![CDATA[<p>I attended my first barcamp this weekend, <a href="http://www.barcamb.org/">Barcamb 3</a> at the superb offices of Red Gate in Cambridge. As a barcamp newbie I was a little unsure of what to expect but the whole weekend was great fun, full of an interesting, open and welcome bunch of folk, well organised and a thoroughly enjoyable experience.<span id="more-141"></span></p>
<p>My talk was in one of the first slots on Brain Games, BBC and Facebook Fun. The theory being to jump in at the deep end and just get stuck in! The talk seemed to go well and was well attended by a probably very tired bunch of people early in the morning. The slides are now up on <a href="http://www.slideshare.net/simonrjones/brain-games-bbc-and-facebook-fun" title="Brain Games, BBC and Facebook Fun">Slideshare</a>, you can also check out the <a href="http://www.cambridgebrainsciences.com/">Cambridge Brain Sciences website</a> and try out the most entertaining brain games!</p>
<p>It was good to meet new people and chat away to those I hadn&#8217;t seen for a while. The general atmosphere was fun, especially Saturday evening when Doctor Who took over a couple of the rooms along with beer and pizza. And the games. I watched, and partially understood, Settlers of Catan. Played a few rounds of Family Business, lost of course! Couldn&#8217;t stay until the early hours, but popped my head into a Werewolf game just as they took their first casualty.</p>
<p>The talks were of high quality. A mix of planned talks and impromptu stuff by people who obviously knew their stuff covering a diverse range of subjects from tech, science, japanese, photography and sleeping. Half the problem was working out which one to listen to!</p>
<p>Highlights included <a href="http://twitter.com/matclayton">Mat Clayton&#8217;s</a> talk on increasing users via Twitter and Facebook, by fair means and <del>foul</del> cunning. A real eye opener to what techniques really work. <a href="http://www.brunton-spall.co.uk/">Michael Brunton-Spall</a> had a good couple of talks, the first on Twitter @Anywhere, the second a joint one with Triest on Test Driven Design which expanded into a discussion on the merits of pair programming. </p>
<p><a href="http://morethanseven.net/">Gareth Rushgrove&#8217;s</a> talk on Dev/Ops was also interesting on bridging the gap between developers and sysadmins. Other good stuff included open street data for <a href="http://www.cyclestreets.net/">CycleStreets</a>, an agile technique from Toyota called Kanban, how to make a good screencast, an intro to Git, a detailed look at message queues and a nice diversion from tech with tips on how to take <a href="http://www.cazphoto.co.uk/">good macro photography</a>.</p>
<p>My web agency <a href="http://studio24.net">Studio 24</a> were also very happy to sponsor the event, looking forward to Barcamb 4.</p>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/cJNt_i5xffQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/04/barcamb3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/04/barcamb3/</feedburner:origLink></item>
		<item>
		<title>Standards marching on</title>
		<link>http://feedproxy.google.com/~r/simonrjones/~3/ene3n2YekuQ/</link>
		<comments>http://www.simonrjones.net/2010/04/standards-marching-on/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 22:31:53 +0000</pubDate>
		<dc:creator>Simon R Jones</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web standards]]></category>

		<guid isPermaLink="false">http://www.simonrjones.net/?p=97</guid>
		<description><![CDATA[With the launch of the iPad one of the striking things to me is its reliance on web standards. Apple&#8217;s own Technical Note on preparing websites for the iPad specifically states web developers should be using web standards for audio and video, specifically the HTML5 video and audio tags. If a large corporation like Apple [...]]]></description>
			<content:encoded><![CDATA[<p>With the launch of the iPad one of the striking things to me is its reliance on web standards. Apple&#8217;s own Technical Note on <a href="http://developer.apple.com/safari/library/technotes/tn2010/tn2262.html">preparing websites for the iPad</a> specifically states web developers should be using web standards for audio and video, specifically the HTML5 video and audio tags. If a large corporation like Apple is basically forcing web developers to use standards-based techniques to deliver content like video, chances are people will listen. </p>
<p>In this day and age you&#8217;d think standards was the assumed approach for all web agencies. From my experience, hardly so. Only last week I encountered two appalling coded sites via potential clients. One using tables for layout with no meaningful ALT text for images, the other a single image in a page with no text behind it (a 100% wide image too, which technically would work on an iPhone or iPad but be pretty much unreadable to everyone!). Both of which were from companies who claim to build websites as part of their professional services.</p>
<p>After following tweets from what sounded like an excellent <a href="http://aneventapart.com/">An Event Apart</a>, I heard about <a href="http://meyerweb.com/">Eric Meyer&#8217;s</a> talk on using media queries to deliver specific CSS depending on the device width or orientation. This means it&#8217;s possible to create flexible layouts for desktop and mobile simply with CSS (i.e. switching between a three column layout for desktop and a one column for mobile). Another great reason for using standards when developing for mobile or the iPad. </p>
<p>You can find out more about <a href="http://www.quirksmode.org/blog/archives/2010/04/the_orientation.html">device orientation</a> on Peter-Paul Koch&#8217;s site. There&#8217;s a <a href="http://www.lukew.com/ff/entry.asp?1053">summary of Eric&#8217;s talk</a> over at Luke Wroblewski&#8217;s blog.</p>
<img src="http://feeds.feedburner.com/~r/simonrjones/~4/ene3n2YekuQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.simonrjones.net/2010/04/standards-marching-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.simonrjones.net/2010/04/standards-marching-on/</feedburner:origLink></item>
	</channel>
</rss>
