<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>@ fake&#039;s</title>
	<atom:link href="http://plind.dk/feed/" rel="self" type="application/rss+xml" />
	<link>http://plind.dk</link>
	<description>customized rants from a PHP dev&#039;s viewpoint</description>
	<lastBuildDate>Wed, 11 Aug 2010 12:52:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Dependency injection and Zend Framework</title>
		<link>http://plind.dk/2010/08/11/dependency-injection-and-zend-framework/</link>
		<comments>http://plind.dk/2010/08/11/dependency-injection-and-zend-framework/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 12:52:33 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[learning]]></category>
		<category><![CDATA[Dependency Injection]]></category>
		<category><![CDATA[DI]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://plind.dk/?p=419</guid>
		<description><![CDATA[Lately I&#8217;ve been working on a site based on the Zend Framework. It&#8217;s been a good chance to get more intimate with ZF, learning the inner workings and quirks of the framework. Today I came across the question of how to do dependency injection for your controllers &#8211; I was looking for a way to [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been working on a site based on the Zend Framework. It&#8217;s been a good chance to get more intimate with ZF, learning the inner workings and quirks of the framework. Today I came across the question of how to do dependency injection for your controllers &#8211; I was looking for a way to rid the code of the &#8216;new&#8217; keyword as well as static methods, coupling things more loosely.</p>
<p>Controllers aren&#8217;t meant to override the __construct() method in ZF &#8211; sure you can do it, but there are meant to be better ways. That leads to the question: how? Well, if you do have a look at the __construct() method of Zend_Controller_Action, you&#8217;ll notice that it takes three parameters. The last one is the interesting one here: it&#8217;s an array called invokeArgs. This should immediately set you off testing what gets passed in &#8211; a bunch of goodies, it turns out. Among other things, you&#8217;ll be getting a copy of the Bootstrap object.</p>
<h2>ZF Controller Dependency Injection, #1</h2>
<p>The above leads to the first, not too good way of injecting things. Just stick whatever you want injected into the bootstrap object &#8211; your controller has access to that through the invokeArgs parameter. That&#8217;s not a very good solution though, as you&#8217;ll be breaking <a href="http://en.wikipedia.org/wiki/Law_of_Demeter">the Law of Demeter</a>: your controller needs to know that your injected param sits inside the bootstrap element, so you&#8217;ll be accessing the injected elemented indirectly. Not nice.</p>
<h2>ZF Controller Dependency Injection, #2</h2>
<p>I googled a bit and came across <a href="http://www.ibuildings.co.uk/blog/archives/1181-Dependency-Injection-and-Zend-Framework-Controllers.html">Dependency Injection and Zend Framework Controllers</a>, which has a nice solution to the problem. As the param name suggests, invokeArgs can be modified &#8211; you can add to the args to your heart&#8217;s content. You need to use the setParam() method of Zend_Controller_Front &#8211; so, in the bootstrap object for instance, you can do the following:</p>
<pre>$front = Zend_Controller_Front::getInstance();
$front-&gt;setParam('factory', new MyFactory);</pre>
<p>Your object will then get passed to the controller in the invokeArgs array. You can access this either through $this-&gt;_invokeArgs['factory'] or the getInvokeArg() method of Zend_Controller_Action &#8211; the latter being preferable.</p>
]]></content:encoded>
			<wfw:commentRss>http://plind.dk/2010/08/11/dependency-injection-and-zend-framework/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Book review: Plone 3 Products Development Cookbook</title>
		<link>http://plind.dk/2010/07/26/book-review-plone-3-products-development-cookbook/</link>
		<comments>http://plind.dk/2010/07/26/book-review-plone-3-products-development-cookbook/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 06:40:59 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[book review]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Plone]]></category>
		<category><![CDATA[Plone 3]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://plind.dk/?p=406</guid>
		<description><![CDATA[The book I&#8217;m reviewing this time is Plone 3 Products Development Cookbook by Juan Pablo Giménez and Marcos F. Romero &#8211; published by Packt Publishing. The topic of the book is site development with the opensource CMS Plone 3 &#8211; a python-based CMS available at http://plone.org/ The book is a collection of recipes for how [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.packtpub.com/plone-3-3-products-development-cookbook/book/mid/040510r71kzn?utm_source=plind.dk&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_003285"><img class="alignright size-full wp-image-376" title="6729_MockupCover.jpg" src="http://plind.dk/wp-content/uploads/2010/05/6729_MockupCover.jpg.png" alt="Cover of Plone 3.3 Products Development Cookbook" width="125" height="152" /></a>The book I&#8217;m reviewing this time is <a title="The book at Packt Publishings shop" href="http://www.packtpub.com/plone-3-3-products-development-cookbook/book/mid/040510r71kzn?utm_source=plind.dk&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_003285">Plone 3 Products Development Cookbook</a> by Juan Pablo Giménez and Marcos F. Romero &#8211; published by Packt Publishing. The topic of the book is site development with the opensource CMS Plone 3 &#8211; a python-based CMS available at <a href="http://plone.org/">http://plone.org/</a></p>
<p>The book is a collection of recipes for how to do the various tasks you&#8217;ll need to do to get a site going using Plone 3 &#8211; typical cookbook style. It&#8217;s laid out in project-form: the authors stipulate a project (the design of a digital newspaper website with some particular requirements) and then go through the tasks for the project one by one in the form of recipes. The style is the same as in the previous Packt review I did: each chapter focuses on one particular concept, comprising a number of recipes, with each recipe containing an introduction, How to do it section, How it works, suggestions for further research/reading plus a cross-reference with recipes.</p>
<h2>The book</h2>
<p>The book is done in black and white (that includes all illustrations) and like the Typo3 book it suffers a bit from this, especially because the printing is too rough. You&#8217;ll notice this with the images in the book &#8211; luckily there are only a few, otherwise it would have been more annoying to look at.</p>
<p>Mentioning illustrations, one of the slightly confusing points in the book is how some illustrations don&#8217;t quite show what you want  or need from them. Most of the time they are located in the How to do it section of a recipe and you will expect it to show how to do a specific step, but you&#8217;ll find it shows something less useful, like the page you need to be working on (not in itself bad but you&#8217;ll know that already from the recipe anyway).</p>
<p>One personal gripe I have with the book is a recurring theme of mine: the &#8220;download the code, we won&#8217;t print it&#8221;-approach. I mentioned this in <a title="Read my Typo3 Multimedia Cookbook review" href="http://plind.dk/2010/04/23/review-of-typo3-multimedia-cookbook/">the Typo3 book review</a> as well and it&#8217;s still annoying to me. An example of why: I&#8217;m writing part of this review in an airport and there are certain parts I can&#8217;t test because I cannot download the code (no, I&#8217;m not paying the absurd prices of airport-wifi. It&#8217;s a market and I choose to show the idiots that their product is priced insanely high by not buying it).</p>
<p>Apart from that, the structure of the book makes it nice and easy to get into: the recipes make it easy to learn and the themed structure means reading you proceed quite naturally from topic to topic.</p>
<h2>The recipes</h2>
<p>You&#8217;ll start at the very beginning with this book: installing python and Plone. This actually works quite well given the aim of the book: to build a site with certain characteristics and get it running. One recipe that is quite handy is how to install python 2.4: Plone 3 doesn&#8217;t run on newer versions of python, so without this you&#8217;d be googling for a reliable solution to the problem before being able to dig into the real problem.</p>
<p>The recipes are typically ok explained. You obviously won&#8217;t know everything related to creating Plone 3 sites after using the book but you&#8217;ll have a good starting point and will be able to put a number of things in place. It should be noted, though, that the book focuses on creating Plone 3 packages (i.e. plugins) so you won&#8217;t find recipes on how to design a site in Plone 3.</p>
<p>However, some recipes skip too fast ahead &#8211; for instance, one of the last recipes revolves around creating a production-site buildout so you can easily push the final site live. In this recipe you&#8217;ll find a lot of interesting tools mentioned, such as Varnish &#8211; but there&#8217;s little to no info about these tools or how to best use them with Plone 3. Here, you can likely argue that it would be outside the scope of the book (it focuses on Plone 3 products, not other stuff) but that doesn&#8217;t remove the feeling that the book was either cut a bit short, published too early or that the recipe is simply meant as a teaser. Whatever the reason, it&#8217;s annoying.</p>
<p>One aspect that I find particularly nice is the focus in recipes on testing. A couple of recipes are fully devoted to testing and apart from that most if not all recipes dealing with code also include code for testing. That gives you the chance to start a good habit, as well as a chance for catching errors or typos in the recipes: in case something doesn&#8217;t work quite perfectly, the tests provide further options for debugging.</p>
<p>Another aspect I find positive is that the recipes introduce a lot of tools and options: if you manage to read them all, you&#8217;ll have quite a few tools to work with when constructing a Plone 3 site. For instance, the authors introduce you to Dexterity, a content type framework not yet in stable version when the book was published &#8211; so, you&#8217;ll find just one recipe using it, showing how product development might look in the future without spending too many resources on something that might be radically different tomorrow. This is the sort of teaser I&#8217;m happy to see, as opposed to the inclusion of various tools with half a line used to explain each (read: the recipe including Varnish).</p>
<h2>Conclusion</h2>
<p>The book has a few flaws &#8211; it feels as though too little attention was paid to the final product feel (illustrations, recipes feeling shortened) &#8211; but overall it seems informative. As a Plone beginner myself, this book gives me a good basis to work from. On the other hand, I doubt that experienced Plone 3 developers will get that much out of the book &#8211; however, because it&#8217;s a cookbook, even developers with some Plone 3 experience might gain something from it as a reference-book.</p>
<p>If you&#8217;re interested in getting started with Plone 3 development, this book is not a bad place to start. Personally, I&#8217;m not sure the Plone way is my way: it seems to suffer from the typical problem of &#8220;let&#8217;s make a million tools to make Plone development easier&#8221; &#8211; if you need a tool to make development in the CMS easier, then a) your CMS has problems of it&#8217;s own to start with and b) you had better make sure the tools created to alleviate the problem really work well and don&#8217;t have problematic or annoying shortcomings, as you&#8217;re putting another obstacle in the way of the developer (not only do I have to learn Plone 3, now I also have to learn how to use your tool. If I also have to learn how to fix the problems created by your tool, I&#8217;ve not gained anything, I&#8217;ve just lost time). Having said that, I&#8217;ll also note that this cookbook has actually given me the motivation to try out the CMS: something in the books favor, I&#8217;m sure.</p>
]]></content:encoded>
			<wfw:commentRss>http://plind.dk/2010/07/26/book-review-plone-3-products-development-cookbook/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Updates and CSS3</title>
		<link>http://plind.dk/2010/06/18/updates-and-css3/</link>
		<comments>http://plind.dk/2010/06/18/updates-and-css3/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 20:22:13 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Random]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://plind.dk/?p=401</guid>
		<description><![CDATA[Once more I find myself spending lots of time not posting on the blog, a shame really. Basically I have way too many things going on right now, which naturally takes time away from writing about developing (or any other rant area). While that&#8217;s bad for this blog it&#8217;s great for me though. I do [...]]]></description>
			<content:encoded><![CDATA[<p>Once more I find myself spending lots of time not posting on the blog, a shame really. Basically I have way too many things going on right now, which naturally takes time away from writing about developing (or any other rant area). While that&#8217;s bad for this blog it&#8217;s great for me though.</p>
<p>I do feel like posting a quick thought, though. I&#8217;m currently working on a nice project, fairly big &#8211; building a site from scratch for a specific community. I&#8217;m also doing the design for it (rather, my fiancee and I are doing the design) and as part of this I&#8217;ve been struggling with Ubuntu. So far, for designing, I&#8217;ve been using Gimp. It&#8217;s a great tool but there are some areas in which it really lags far behind other tools of the trade. To name just a couple: layers (no grouping capability) and text (if you want a piece of text to have different formats, you have to break it into several pieces each of which must be formatted separately &#8211; as far as I can make out). So, while making a design is more or less ok, tweaking it on the other hand is massive pain.<br />
I&#8217;ve specifically come up against this in the project I&#8217;m working on now. I&#8217;ve got some content boxes, round corners with some drop shadows. Changing the size of these boxes is the least fun I&#8217;ve tried for a long time. With Gimp you can lock layers with respect to each other so that you can move things around &#8211; but there&#8217;s no way to easily stretch or shrink a box; you have to manually modify every little thing inside it.<br />
Naturally that makes a developer look for solutions that allows for working more clever. What I found makes me rather happy: first, in CSS3 there are possibilities for having rounded corners and drop shadows using just CSS. This is not really news as such as CSS3 has been on it&#8217;s way for a while. Previously, it wouldn&#8217;t even have made more than shrug but when you add the stats from <a href="http://www.w3counter.com/globalstats.php">http://www.w3counter.com/globalstats.php</a> into the mix you get a nice combo: the major shares of the &#8220;good&#8221; browsers support the features in CSS3 that I need. Of course, one should still make sure things look good in IE, but as far as I can tell this is fairly easily done using IE specific styling (filters as it happens) and should work without problems on IE7+ (and likely IE6 too but given the usage stats for that I don&#8217;t even have to care any more). That means tweaking mockups much faster than using apps like Gimp &#8211; just move an element or two around a bit and tweak some CSS properties and done.</p>
<p>Am I a happy camper? Yes!</p>
]]></content:encoded>
			<wfw:commentRss>http://plind.dk/2010/06/18/updates-and-css3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Second Plone 3 review</title>
		<link>http://plind.dk/2010/05/31/second-plone-3-review/</link>
		<comments>http://plind.dk/2010/05/31/second-plone-3-review/#comments</comments>
		<pubDate>Mon, 31 May 2010 12:02:14 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://plind.dk/?p=399</guid>
		<description><![CDATA[Just wanted to post a quick update on the Plone 3 reviews I&#8217;ll be doing: have received the second book now, Plone 3 Multimedia &#8211; mentioned in Another Plone book review &#8211; and aim for getting a review of this book up here soon as well. The book looks interesting from a quick skim of [...]]]></description>
			<content:encoded><![CDATA[<p>Just wanted to post a quick update on the Plone 3 reviews I&#8217;ll be doing: have received the second book now, <a href="http://www.packtpub.com/plone-3-3-multimedia-website/book/mid/040510r71kzn?utm_source=plind.dk&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_003311">Plone 3 Multimedia</a> &#8211; mentioned in <a href="http://plind.dk/2010/05/18/another-plone-book-review/">Another Plone book review</a> &#8211; and aim for getting a review of this book up here soon as well. The book looks interesting from a quick skim of the pages, and it&#8217;s done in a different style than both the Typo3 Multimedia book I reviewed and the other Plone 3 book I&#8217;m reviewing (both were done as cookbooks, this one&#8217;s not). I look forward to reading my way through it :)</p>
]]></content:encoded>
			<wfw:commentRss>http://plind.dk/2010/05/31/second-plone-3-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plone 3 review</title>
		<link>http://plind.dk/2010/05/24/plone-3-review/</link>
		<comments>http://plind.dk/2010/05/24/plone-3-review/#comments</comments>
		<pubDate>Mon, 24 May 2010 15:05:00 +0000</pubDate>
		<dc:creator>Peter</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://plind.dk/?p=397</guid>
		<description><![CDATA[I&#8217;ve received my reviewers copy of the Plone 3 Product Development Cookbook now and hope to have a review ready in a week or two (yeah, I know, shouldn&#8217;t make guesses as to when it&#8217;ll be done as I&#8217;ll just disappoint :P ). On a related point, I was told by the publisher that they&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve received my reviewers copy of the <a href="http://www.packtpub.com/plone-3-3-products-development-cookbook/book/mid/040510r71kzn?utm_source=plind.dk&amp;utm_medium=affiliate&amp;utm_content=blog&amp;utm_campaign=mdb_003285">Plone 3 Product Development Cookbook</a> now and hope to have a review ready in a week or two (yeah, I know, shouldn&#8217;t make guesses as to when it&#8217;ll be done as I&#8217;ll just disappoint :P ).</p>
<p>On a related point, I was told by the publisher that they&#8217;re kicking off the publishing of the book (and the publishing of Plone 3 Multimedia, the other Plone book from Packt that I&#8217;m reviewing) with a campaign offer: if you buy one of the two within the first two weeks of the publishing date, you&#8217;ll join a lucky draw where you&#8217;ve got the chance to win an iTunes voucher or Amazon Gift Card. Nice of them, I should think &#8211; more media is always great.</p>
]]></content:encoded>
			<wfw:commentRss>http://plind.dk/2010/05/24/plone-3-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
