<?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>Conceptric &#187; frameworks</title>
	<atom:link href="http://www.conceptric.co.uk/tag/frameworks/feed" rel="self" type="application/rss+xml" />
	<link>http://www.conceptric.co.uk</link>
	<description>Ideas and Applications</description>
	<lastBuildDate>Sat, 31 Jul 2010 20:30:17 +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>Switching to Rails</title>
		<link>http://www.conceptric.co.uk/switching-to-rails.htm</link>
		<comments>http://www.conceptric.co.uk/switching-to-rails.htm#comments</comments>
		<pubDate>Sun, 30 Aug 2009 18:30:00 +0000</pubDate>
		<dc:creator>James Whinfrey</dc:creator>
				<category><![CDATA[Personal Perspectives]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.conceptric.co.uk/?p=302</guid>
		<description><![CDATA[I know that a good developer should choose the best tool for the job in hand, but their own productivity and inspiration must inform the decision in selecting the best tool.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a personal project based on CodeIgniter and it&#8217;s been uphill work. I finally lost patience with both the framework and language and followed the advice given on <a href="http://www.conceptric.co.uk/codeigniter-test-coverage.htm">my last post about code testing</a>.</p>
<p>I&#8217;ve used Ruby for scripting, and deploying PHP applications with custom Capistrano recipes for years now, but I&#8217;ve never tried any of the available web frameworks. </p>
<p>This week I switched to Ruby on Rails, and I&#8217;ve accomplished more in a couple of days than in a couple of months with CodeIgniter.</p>
<p>I&#8217;m not trying to claim that there&#8217;s anything fundamentally wrong with PHP, so don&#8217;t beat me up over it, but I find working with Ruby and Java much more intuitive, enjoyable and productive: it&#8217;s a personal choice, I feel more inspired.</p>
<p>I&#8217;m particularly loving the default support for <a href="http://guides.rubyonrails.org/testing.html">unit, functional and integration testing</a>; I now feel in control of my code and I&#8217;ve yet to explore the full range of testing frameworks and approaches available for Rails. </p>
<p>I know that <a href="http://cakephp.org/">CakePHP</a> mirrors Rails functionality very closely, but I&#8217;m afraid it&#8217;s the PHP language that I find too ugly to love &#8211; personal choice again, don&#8217;t shoot &#8211; consequently this is one developer who may have written his last line of PHP code&#8230;&#8230; maybe.</p>
<p>I&#8217;m now hoping to have the first release of the nature and wildlife recording application I&#8217;ve been promising Clare for&#8230;&#8230; much too long, up and running in the next couple of weeks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.conceptric.co.uk/switching-to-rails.htm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>When frameworks are too friendly</title>
		<link>http://www.conceptric.co.uk/when-frameworks-are-too-friendly.htm</link>
		<comments>http://www.conceptric.co.uk/when-frameworks-are-too-friendly.htm#comments</comments>
		<pubDate>Thu, 29 Jan 2009 16:50:43 +0000</pubDate>
		<dc:creator>James Whinfrey</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Posts]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[content management system]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[skills]]></category>

		<guid isPermaLink="false">http://www.conceptric.co.uk/?p=141</guid>
		<description><![CDATA[High quality Content Management Systems and development frameworks are everywhere, but are they all trying to be too friendly and flexible?
]]></description>
			<content:encoded><![CDATA[<p><a href="http://drupal.org/project/Modules">Drupal modules</a> and <a href="http://wordpress.org/extend/plugins/">WordPress plugins</a> offer a huge range of functionality that&#8217;s easily integrated. <a href="http://codeigniter.com/">CodeIgniter</a> provides a clear program structure with plenty of utility functions within easy reach. </p>
<h3>Positive experiences.</h3>
<p>The most frequently touted benefit frameworks have to offer is minimising the time taken to code and deploy a software solution. Given my interest in Agility, this is an attraction, reducing the time to market.</p>
<p>Another solid development practice is code reuse in the form of software components, and frameworks have a place amongst them. This approach offers the reliability and security inherent in widely used and tested code. Remember to choose popular software though, or this benefit disappears.</p>
<h3>On the downside.</h3>
<p>Applications developed using frameworks have to carry significant excess baggage in the form of unused features. This raises two main issues: your codebase will be unnecessarily large, and underused blocks of code are a breeding ground for hidden exploits and errors.</p>
<p>Frameworks are designed to function in a specific way, some with more flexibility than others. This much you&#8217;d expect, after all it&#8217;s the essence of a framework, but what if it doesn&#8217;t provide everything you need? For example, I&#8217;ve spent hours trying to integrate <a href="http://www.simpletest.org/">SimpleTest</a>, a <a href="http://en.wikipedia.org/wiki/Unit_testing">unit testing</a> suite, to produce satisfactory results with CodeIgniter. My unit tests run well for my own libraries, but I&#8217;m still unhappy with the test coverage imposed by CodeIgniter&#8217;s <abbr title="Model-View-Controller">MVC</abbr> implementation.</p>
<p>Finally, they say practice makes perfect, but does reliance on any framework reduce developer skill? This isn&#8217;t a problem if everything is pre-packaged in your chosen tool, but what if a client wants something that isn&#8217;t included?</p>
<h3>Too good to ignore.</h3>
<p>That said, I&#8217;ve found all of these software very useful and there are far too many advantages to ignore them. But I often find myself fighting these same tools, frustrated at they&#8217;re eagerness to help me do something in a way I don&#8217;t want it done. I guess the key is to understand which is the right tool for the current job: the ultimate skill for a developer.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.conceptric.co.uk/when-frameworks-are-too-friendly.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Code ignition</title>
		<link>http://www.conceptric.co.uk/code-ignition.htm</link>
		<comments>http://www.conceptric.co.uk/code-ignition.htm#comments</comments>
		<pubDate>Sun, 16 Nov 2008 12:53:11 +0000</pubDate>
		<dc:creator>James Whinfrey</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Everything]]></category>
		<category><![CDATA[Posts]]></category>
		<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[trials]]></category>

		<guid isPermaLink="false">http://www.conceptric.co.uk/?p=111</guid>
		<description><![CDATA[Whilst developing a relatively simple application for managing my budgets, I've decided to experiment with a few different frameworks. With so many to choose from, how do I feel about going for CodeIgniter?]]></description>
			<content:encoded><![CDATA[<p>CodeIgniter is billed as being a lightweight PHP <abbr title="Model - View - Controller">MVC</abbr> framework. Now I&#8217;m not a big fan of PHP, despite using WordPress and Drupal, but I intend to run this application on a Synology <abbr title="Network Attached Storage">NAS</abbr>, so PHP is the only game in town.</p>
<h3>Changing the Architecture.</h3>
<p>I&#8217;m not a keen on the idea of dumping all my code in the web server root directory, so I tested the framework flexibility by rearranged the application structure a little.</p>
<pre class="code">
	-rw-r--r--   1 Capfile
	drwxr-xr-x  14 application
	drwxr-xr-x   3 config
	drwxr-xr-x  13 system
	drwxr-xr-x   5 public
</pre>
<p>Once these locations were updated in the application configuration files it all worked perfectly. The reasons for doing this sort of thing have been <a href="http://capsizedesigns.com/blog/2008/06/getting-started-with-codeigniter-part-5-loose-ends/">documented elsewhere</a>, and I agreed with them from this security standpoint, however this structure also fits better with <a href="http://www.conceptric.co.uk/capistrano-works.htm">Capistrano deployment</a>.</p>
<h3>A positive first impression.</h3>
<p>The Views deal with the presentation logic, and I like the fact that embedding PHP within the HTML is the default, instead of a complex templating system. It&#8217;s not the cleanest approach, but I prefer to have full control over my HTML.</p>
<p>As for the Controllers, the implementation is quite intuitive and you can build a friendly set of URLs with a little help from <a href="http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html">mod_rewrite</a> and the <a href="http://codeigniter.com/user_guide/libraries/uri.html"><code>URI</code> class</a>. </p>
<p>The form validation is a great feature that I found easy to implement within the Controllers and Views. I&#8217;ve centralised my validation rules in the global configuration file <a href="http://codeigniter.com/user_guide/libraries/form_validation.html#savingtoconfig">suggested in the documentation</a>, but haven&#8217;t got the automatic rule group feature to work yet.</p>
<p>The <code>Model</code> class is used to represent a single database table. I&#8217;m used to mapping tables with a Class in this way, but normally each instance would represent a row of data. CodeIgniter <code>Models</code> implement the <a href="http://en.wikipedia.org/wiki/Singleton_pattern">Singleton design pattern</a>, only one instance per class, from which the <code>Database</code> class methods can be called.</p>
<p>The <code>Database</code> class provides the data access layer and a good set of robust methods which return an array of <code>stdClass</code> instances representing the resulting data rows. These arrays are then forwarded to the View, where the instance variables can be directly accessed. This is quick and easy, but not very <abbr title="Object Oriented Programming">OOP</abbr>.</p>
<h3>Implementation reservations.</h3>
<p>I believe that the Model should be capable of running as a stand-alone application, once equipped with any interface, even the command-line. It&#8217;s this level of autonomy that results from the MVC design pattern: substitute a different Controller and View and it&#8217;ll still work the same way on a different platform.</p>
<p>Controllers reacting to events, whilst Views shouldn&#8217;t have direct, mutable access to instance variables. The Model should encapsulate both the data and the business logic, not something that can be effectively achieved with Singletons alone. Indeed CodeIgniter blurs this distinction by making Models optional and allowing data manipulation directly in the Controllers.</p>
<p>I&#8217;ve implemented my preferred approach by providing my own classes to replace the <code>stdClass</code>. They don&#8217;t extend the CodeIgniter <code>Model</code> class, but are instantiated within those that do, encapsulating data and business logic; including Object&#8211;relational data mapping and <acronym title="Create - Read - Update - Delete">CRUD</acronym> functionality.</p>
<p>It works well, but I&#8217;m concerned that by introducing a more rigourous approach I&#8217;m losing some of the advantages of the framework. May be I would be better to take CodeIgniter at face value, as a flexible, if a little dirty, rapid development environment that works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.conceptric.co.uk/code-ignition.htm/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
