<?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>Developer&#039;s Kanundrum</title>
	<atom:link href="http://ak33m.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://ak33m.com</link>
	<description>Akeem Philbert&#039;s note to self. You can&#039;t go forward without knowing where you&#039;ve been.</description>
	<lastBuildDate>Thu, 13 May 2010 15:10:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Static methods are evil (full version)</title>
		<link>http://ak33m.com/?p=169</link>
		<comments>http://ak33m.com/?p=169#comments</comments>
		<pubDate>Thu, 13 May 2010 13:04:35 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[OOP]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=169</guid>
		<description><![CDATA[Some months ago I tweeted that static methods are evil to which a colleague of mine who happens to be a flash developer responded &#8220;for silly PHP developers&#8221;. To be clear I&#8217;m not saying that static functions and static variables shouldn&#8217;t be used; quite frankly they&#8217;re in a lot of languages for a reason.
One reason why I call caution [...]]]></description>
			<content:encoded><![CDATA[<p>Some months ago I tweeted that static methods are evil to which a colleague of mine who happens to be a flash developer responded &#8220;for silly PHP developers&#8221;. To be clear I&#8217;m not saying that static functions and static variables shouldn&#8217;t be used; quite frankly they&#8217;re in a lot of languages for a reason.</p>
<p>One reason why I call caution to it&#8217;s use can be found in nomenclature, it&#8217;s called &#8220;static&#8221; for a reason. If your code is littered with static function calls then you are missing the benefits of OOP and you&#8217;re really doing procedural programming (there is a time and place for procedural as well but I like calling a spade a spade).</p>
<p>A favorite use case of static variables for developers is to store data to be accessed globally. While seemingly convenient at implementation time it&#8217;s very annoying when it comes to debugging. Because a variable can be modified globally it becomes harder to reliably replicate bugs others might be experiencing or figure out where in the code the data is manipulated such that it causes an error. There are other ways to handle setting up objects with data e.g. <a href="http://en.wikipedia.org/wiki/Inversion_of_control" target="_blank">inversion of control</a></p>
<p>Excess use of static functions also hinders unit testing for a couple reasons (in PHP at least). Successful unit testing depends on setting the application to a known state and comparing against an expected result. When data is stored statically test cases in a suite that leverage that data inadvertantly affect each other and making the outcome of those tests unreliable. Also it isn&#8217;t currently possible to stub static functions in PHPUnit which gets in the way of the setting application to a known state requirement. When you are developing a large application with regular releases TDD (test driven development) is your best friend.</p>
<p>My biggest gripe against static function and static variable use is that it gets in the way of polymorphism. I had the pleasure of leveraging a PHP library for a service and everything was done via static functions even setting the API keys. To make matters worse the service requires a couple steps to get going and all these steps were static function calls. Because the library was all static it wasn&#8217;t a simple class extention and overriding the functions; I ended up wrapping the class in an object to be able to do what I want and help out the next guy who has to leverage this code. In addition to making it difficult to customize, it was also difficult to use more than one account for the service. What makes OOP great is polymorphism; this concept is why code is reusable, and opensource thrives because while the original author envisioned certain uses, others have the oppurtunity to extend it without writing the whole thing over. It doesn&#8217;t hurt to think about the next guy touching this code, especially when that next guy is you.</p>
<p>So the next time you are about to use static functionality where an object would work just as well, in the words of Peter Griffin - c&#8217;moooon, c&#8217;mooon, c&#8217;mon</p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=169</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2KGames</title>
		<link>http://ak33m.com/?p=171</link>
		<comments>http://ak33m.com/?p=171#comments</comments>
		<pubDate>Sun, 18 Apr 2010 19:04:35 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rokkit]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=171</guid>
		<description><![CDATA[2kgames is the publisher of some of gaming world&#8217;s biggest titles including Bioshock and Borderlands. Their corporate site while flash is powered by a PHP CMS that makes it easy to input new titles and keep their audience in the know of what&#8217;s coming next. The site also features a SEO friendly version that compensates [...]]]></description>
			<content:encoded><![CDATA[<p>2kgames is the publisher of some of gaming world&#8217;s biggest titles including Bioshock and Borderlands. Their corporate site while flash is powered by a PHP CMS that makes it easy to input new titles and keep their audience in the know of what&#8217;s coming next. The site also features a SEO friendly version that compensates for Flash&#8217;s lack of search engine friendliness.</p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=171</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Application Architecture &#8211; Part 1</title>
		<link>http://ak33m.com/?p=167</link>
		<comments>http://ak33m.com/?p=167#comments</comments>
		<pubDate>Thu, 11 Feb 2010 01:39:38 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=167</guid>
		<description><![CDATA[The last post I talked about the service layer and how it was going to help solve some problems that I&#8217;ve been having with the way I architect applications. Since then and may hours (days) of research I&#8217;ve since had a number of revelations that has really changed the way I approach architecture and brought [...]]]></description>
			<content:encoded><![CDATA[<p>The last post I talked about the service layer and how it was going to help solve some problems that I&#8217;ve been having with the way I architect applications. Since then and may hours (days) of research I&#8217;ve since had a number of revelations that has really changed the way I approach architecture and brought me more in tune with discussions that are going on in the community.</p>
<p>The biggest revelation was that my application of MVC was &#8220;wrong&#8221;. I put wrong in quotes because application architecture (similar to beauty) is in the eye of beholder. There are many schools of thought on how you should go about architecting but choosing a path is difficult.  Often these techniques are phrased as making code more scalable and maintainable but without clear examples of why certain things are wrong and why others are right. Patterns of Enterprise Architecture by Martin Fowler does a good job of introducing commonly used patterns but even Martin concedes in the book that he has no idea what you are building; he can only point you in the somewhat correct direction</p>
<p>I&#8217;ve had the opportunity to work on and architect some great application (websites) early in my career and I&#8217;m currently working on one of my own that I hope will stand the test of time. In a series of posts I hope to identify what I did wrong what I think is right by using UML, diagrams, and some code to model a common application &#8211; a blog. We&#8217;ll start with my mangled MVC thoughts, move to a more acceptable MVC technique and then end at what I understand to be domain driven development.</p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=167</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Service Layer in MVC</title>
		<link>http://ak33m.com/?p=164</link>
		<comments>http://ak33m.com/?p=164#comments</comments>
		<pubDate>Mon, 28 Dec 2009 20:37:53 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=164</guid>
		<description><![CDATA[At one of the sessions that I attended at ZendCon I was introduced to the &#8220;Service Layer&#8221; pattern by Matthew Weier O&#8217;Phinney. At the time I didn&#8217;t quite get it but I&#8217;ve been trying out all those stuff that I&#8217;ve been meaning to while on vacation. There are a lot of resources on the web [...]]]></description>
			<content:encoded><![CDATA[<p>At one of the sessions that I attended at ZendCon I was introduced to the &#8220;Service Layer&#8221; pattern by Matthew Weier O&#8217;Phinney. At the time I didn&#8217;t quite get it but I&#8217;ve been trying out all those stuff that I&#8217;ve been meaning to while on vacation. There are a lot of resources on the web that explains the service layer. A good introduction from the PHP perspective can be found on <a href="http://dev.juokaz.com/programming/service-layer-in-web-applications" target="_blank">Juozas&#8217; website</a> but I also like the analogy used <a href="http://www.dougboude.com/blog/1/2007/02/Just-What-IS-a-Service-Layer-Anyway.cfm" target="_blank">here</a>. Between all that I&#8217;ve read I realize that this is something that I&#8217;ve needed for a while and wish I had leveraged it  a bit sooner. Because the service layer for all intent and purposes sits between the controllers and the models there are a great deal of derived benefits:</p>
<ol>
<li>Swapping  out data sources is easier. The controllers no longer need to know any thing about the models just the api needed to access data from the service. That service could go from leveraging models that access a local database or an api used to interact with external data.</li>
<li>Because the models are out of site from the controllers it becomes easier to upgrade or change the model layer with out too much adverse effect on the business logic (e.g. I&#8217;d like to upgrade a bunch of projects to doctrine)</li>
<li>Services are more portable. Currently I leverage a restrictive MVC pattern where &#8220;user&#8221; functionality goes through a UserController which in turn leverages a table gateway patter that is made up of a Users class (the gateway) and User (row class). This works out great for code generation but inconvenient to work with in a large application because the functionality is so siloed.</li>
<li>Exposing an api for 3rd parties to leverage is a bit more straightforward.</li>
</ol>
<p>So I&#8217;m sold on the Service Layer concept now to get it hooked into my Zend Framework setup. We&#8217;ll check that out in the next post</p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=164</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virgin Redesign</title>
		<link>http://ak33m.com/?p=141</link>
		<comments>http://ak33m.com/?p=141#comments</comments>
		<pubDate>Mon, 30 Nov 2009 11:09:20 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rokkit]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=141</guid>
		<description><![CDATA[Virgin Group&#8217;s corporate website was redone as community destination. Features include Facebook integration, Twitter integration and slew of things you probably wouldn&#8217;t expect to find on a corporate website.
Press: Commart Pick Of The Week, Press Release
]]></description>
			<content:encoded><![CDATA[<p>Virgin Group&#8217;s corporate website was redone as community destination. Features include Facebook integration, Twitter integration and slew of things you probably wouldn&#8217;t expect to find on a corporate website.</p>
<p>Press: <a href="http://www.commarts.com/web-sites/virgin-com.html" target="_blank">Commart Pick Of The Week</a>, <a href="http://blog.digitalcontentproducer.com/briefingroom/2009/09/15/rokkans-interactive-redesign-for-virgincom-takes-corporate-by-the-lapels/" target="_blank">Press Release</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=141</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Umbro</title>
		<link>http://ak33m.com/?p=153</link>
		<comments>http://ak33m.com/?p=153#comments</comments>
		<pubDate>Mon, 30 Nov 2009 10:46:50 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rokkit]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=153</guid>
		<description><![CDATA[Added CMS functionality to Flash website to make it easier for Umbro to manage their brand globally while making the content SEO friendly
]]></description>
			<content:encoded><![CDATA[<p>Added CMS functionality to Flash website to make it easier for Umbro to manage their brand globally while making the content SEO friendly</p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=153</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Virgin America Community</title>
		<link>http://ak33m.com/?p=136</link>
		<comments>http://ak33m.com/?p=136#comments</comments>
		<pubDate>Mon, 30 Nov 2009 09:37:20 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rokkit]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=136</guid>
		<description><![CDATA[Community website for Virgin America&#8217;s customers to share their experience
]]></description>
			<content:encoded><![CDATA[<p>Community website for Virgin America&#8217;s customers to share their experience</p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=136</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mamashelter</title>
		<link>http://ak33m.com/?p=129</link>
		<comments>http://ak33m.com/?p=129#comments</comments>
		<pubDate>Mon, 30 Nov 2009 09:27:56 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rokkit]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=129</guid>
		<description><![CDATA[Hotel website for up and coming business hotel in France.
]]></description>
			<content:encoded><![CDATA[<p>Hotel website for up and coming business hotel in France.</p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=129</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Gamecheats.com</title>
		<link>http://ak33m.com/?p=121</link>
		<comments>http://ak33m.com/?p=121#comments</comments>
		<pubDate>Mon, 30 Nov 2009 09:15:46 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=121</guid>
		<description><![CDATA[GameCheat website. Special emphasis was placed on SEO and search performance.
]]></description>
			<content:encoded><![CDATA[<p>GameCheat website. Special emphasis was placed on SEO and search performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=121</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4Kids</title>
		<link>http://ak33m.com/?p=115</link>
		<comments>http://ak33m.com/?p=115#comments</comments>
		<pubDate>Mon, 30 Nov 2009 08:52:47 +0000</pubDate>
		<dc:creator>akeemphilbert</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[code ignitor]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://ak33m.com/?p=115</guid>
		<description><![CDATA[Community website for 4kids.tv.
]]></description>
			<content:encoded><![CDATA[<p>Community website for 4kids.tv.</p>
]]></content:encoded>
			<wfw:commentRss>http://ak33m.com/?feed=rss2&amp;p=115</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
