<?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>Torkil Johnsen &#187; Software</title>
	<atom:link href="http://www.torkiljohnsen.com/category/software/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.torkiljohnsen.com</link>
	<description>My personal piece of cyberspace</description>
	<lastBuildDate>Mon, 28 Nov 2011 11:18:55 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Issues after upgrading to OS X Lion</title>
		<link>http://www.torkiljohnsen.com/2011/07/21/issues-after-upgrading-to-os-x-lion/</link>
		<comments>http://www.torkiljohnsen.com/2011/07/21/issues-after-upgrading-to-os-x-lion/#comments</comments>
		<pubDate>Thu, 21 Jul 2011 11:14:21 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/?p=748</guid>
		<description><![CDATA[I ran into a few issues after upgrading to OS X Lion that I thought might be useful to share with others. Table of contents VMware Fusion: Partition table has changed MAMP and OS X Lion NAS (Network Attached Storage) issues with AFP/remote Time Machine Lion install failed — Boot Camp issue More OS X Lion [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a few issues after upgrading to OS X Lion that I thought might be useful to share with others.<br />
<span id="more-748"></span></p>
<h2>Table of contents</h2>
<ol>
<li><a href="#vmware">VMware Fusion: Partition table has changed</a></li>
<li><a href="#mamp">MAMP and OS X Lion</a></li>
<li><a href="#nas">NAS (Network Attached Storage) issues with AFP/remote Time Machine</a></li>
<li><a href="#bootcamp">Lion install failed — Boot Camp issue</a></li>
<li><a href="#more">More OS X Lion tips</a></li>
</ol>
<hr />
<h2><a name="vmware"></a>1. VMware Fusion: Partition table has changed</h2>
<p>I could not start up my Windows 7 boot camp partition after the upgrade. The error message I got was something like this:</p>
<blockquote><p>
Cannot open the disk &#8216;/Users/torkil/Library/Application Support/VMware Fusion/Virtual Machines/Boot Camp/Boot Camp.vmwarevm/Boot Camp.vmdk&#8217; or one of the snapshot disks it depends on.</p>
<p>Reason: The partition table on the physical disk has changed since the disk was created. Remove the physical disk from the virtual machine, then add it again.
</p></blockquote>
<p>I found the solution to that issue on the <a href="http://blogs.vmware.com/teamfusion/2011/07/os-x-lion-spotted-in-the-wild.html?cid=6a00d8341c328153ef0153900c1f90970b#comment-6a00d8341c328153ef0153900c1f90970b">VMware Fusion blog comments</a>:</p>
<p>&#8220;That means to go into the Virtual Machine library and delete the entry. Then, create a new Bootcamp based VM. Your VM wouldnt be damaged as it is running bootcamp and just using that info. If that still doesnt work, boot using bootcamp itself.&#8221;</p>
<h2><a name="mamp"></a>2. MAMP and OS X Lion</h2>
<p>The popular MAMP (Mac Apache MySQL PHP) software needs to be version 2.0 for Lion compatibility. An upgrade is all it takes. See the <a href="http://www.mamp.info/en/downloads/index.html">MAMP download page</a>.</p>
<h2><a name="nas"></a>3. NAS (Network Attached Storage) issues with AFP/remote Time Machine</h2>
<p>I am trying to connect with AFP to a fileserver on our network at work. I am getting this error message after installing Lion:</p>
<blockquote><p>There was a problem with trying to connect to the server. The version of the server you&#8217;re trying to connect to is not supported.</p></blockquote>
<p>This is also a problem for people using TimeMachine to do backups to Synology&#8217;s file servers. The problem is that Synology&#8217;s firmware ships with an older version of Netatalk, not compatible with Lion. Synology already has a <a href="http://forum.synology.com/enu/viewtopic.php?f=180&#038;t=39029&#038;hilit=mac+os+10.7&#038;start=30#p154468">DSM 3.2 beta</a> which fixes the problems for many people it seems. Synology has also said that they are <a href="http://forum.synology.com/enu/viewtopic.php?f=64&#038;t=34294&#038;start=45#p153529">releasing version 3.2 at the end of July 2011</a>, and that this version will fix the problems.</p>
<p>Smallnetbuilder.com has <a href="http://www.smallnetbuilder.com/nas/nas-news/31540-lion-breaks-time-machine-nases">an article</a> on the topic, with a <a href="http://www.alexanderwilde.com/2011/04/os-x-lion-connection-error-with-afp-and-workaround/">link to a workaround</a> that Alexander Wilde has dug up. I have tested his solution now, and I can confirm that it works.</p>
<h2><a name="bootcamp"></a>4. Lion install failed — Boot Camp issue</h2>
<blockquote><p>Max OS X can’t be installed on the disk Macintosh HD, because a recovery system can’t be created. Visit www.apple.com/support/no-recovery to learn more.</p></blockquote>
<p>I ran into this problem on my wife&#8217;s Macbook Pro. The help article on apple.com suggests I format the entire computer and reinstall Snow Leopard and then install Lion again. Seems like too much work, so I&#8217;m going to try another recipe:</p>
<ol>
<li>Download and install <a href="http://download.cnet.com/Winclone/3000-2242_4-11089354.html">Winclone</a></li>
<li>Make a backup of my Boot Camp partition on my OS X harddrive with Winclone</li>
<li>Backup OS X to Time Machine</li>
<li>Use Boot Camp assistant to remove the Windows partition</li>
<li>Backup to Time Machine again (paranoid!)</li>
<li>Install Lion, hopefully without problems</li>
<li>Recreate the Boot Camp partition and use Winclone to recreate it like it used to be</li>
</ol>
<p>Thanks to Macworld tip on <a href="http://www.macworld.com/article/136529/2008/11/backupbootcamp.html">Backup and restore Boot Camp partitions</a>.</p>
<p>I&#8217;ll report back when I&#8217;ve tried this, and hopefully succeeded.</p>
<h2><a name="more"></a>5. More OS X Lion tips</h2>
<p>Here is some further reading:</p>
<ul>
<li><a href="http://techcrunch.com/2011/07/21/os-x-lion-new-features/">Techcrunch: Nine things you should do after installing OS X Lion</a></li>
</ul>
<h2>Have you experienced any problems?</h2>
<p>If you have found issues with other software after upgrading to OS X Lion, feel free to post it in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2011/07/21/issues-after-upgrading-to-os-x-lion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using Gmail? Tried &#8220;dynamic&#8221; aliases?</title>
		<link>http://www.torkiljohnsen.com/2010/12/13/using-gmail-dynamic-aliases/</link>
		<comments>http://www.torkiljohnsen.com/2010/12/13/using-gmail-dynamic-aliases/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 16:33:35 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[gmail]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/?p=735</guid>
		<description><![CDATA[While GMail does not offer traditional aliases to be set up for your_name@gmail.com, but you can get dynamic aliases that you can add on the fly when providing your e-mail address to someone. This comes in handy when registering on websites or subscribing to newsletters. GMail is normally really good at filtering spam, but sometimes [...]]]></description>
			<content:encoded><![CDATA[<p>While GMail does not offer traditional aliases to be set up for your_name@gmail.com, but you can get dynamic aliases that you can add on the fly when providing your e-mail address to someone. This comes in handy when registering on websites or subscribing to newsletters.<br />
<span id="more-735"></span><br />
GMail is normally really good at filtering spam, but sometimes you&#8217;ll still get e-mails with offers for buying this or investing in that. Many of the senders also kindly allow you to unsubscribe to their newsletter, but maybe you didn&#8217;t want it in the first place? Where have they picked up your mail address? Scraped it off the internet? Bought it?</p>
<p>I recently also saw <a href="http://twitter.com/#!/FxNxRL/status/14317854442659840">a tweet</a> concerning DeviantART&#8217;s mailing list having been compromised, and a lot of people&#8217;s e-mail addresses have probably now ended up in the hands of spammers. The person tweeting luckily had an alias set up that he could just kill off to avoid being spammed any further.</p>
<p><strong>GMail has this nice little feature</strong> that allows you use your_name+whatever@gmail.com as your e-mail address. So for each new site you register on you can use a new address. For DeviantART you could use your_name+deviantart@gmail.com for instance. This makes it easier to find out who has lost or sold your e-mail address in the future, and it makes it really easy to block unwanted mail with a quick filter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2010/12/13/using-gmail-dynamic-aliases/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using MySQL Workbench to manage your Joomla component’s db schema</title>
		<link>http://www.torkiljohnsen.com/2010/07/23/using-mysql-workbench-to-manage-your-joomla-components-db-schema/</link>
		<comments>http://www.torkiljohnsen.com/2010/07/23/using-mysql-workbench-to-manage-your-joomla-components-db-schema/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 22:19:05 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[joomla]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[schema]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[workbench]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/?p=298</guid>
		<description><![CDATA[MySQL Workbench is a great tool for developers to map out and visualise databases. What many people know is that it&#8217;s also a great way to make upgrading and writing upgrade scripts for your components really painless too. Let&#8217;s say you created a small component that became popular over night. Tens of thousands of downloads [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL Workbench is a great tool for developers to map out and visualise databases. What many people know is that it&#8217;s also a great way to make upgrading and writing upgrade scripts for your components really painless too.<br />
<span id="more-298"></span><br />
Let&#8217;s say you created a small component that became popular over night. Tens of thousands of downloads from on the Joomla Extensions Directory. So you get inspired and put some more work into improving and bugfixing this component even more, and while doing that you change and add on to the database schema. </p>
<p>Now you need to create and distribute an update script with the next version of your component, and MySQL Workbench makes creating this update script really easy. Here is what you need to do:</p>
<h2>Install MySQL Workbench</h2>
<p>I&#8217;ll not help you with this. Just go to the <a href="http://wb.mysql.com/">MySQL Workbench homepage</a> and follow the instructions from there. Multiple platforms supported! It&#8217;s the same tool I used to create the <a href="http://www.torkiljohnsen.com/2010/07/11/joomla-1-6-database-schema/">Joomla 1.6 database schema.</a></p>
<p>After installation, start MySQL Workbench and we&#8217;re off!</p>
<h2>Create a new model</h2>
<p>From the main menu, click File -> New Model, then double click Add Diagram. Save your diagram right away and give your file a name. It always sucks to lose your work.</p>
<h2>Basic settings</h2>
<p>First some settings that are handy:</p>
<p>To the right, under the tab &#8220;catalog&#8221;, you&#8217;ll find your schema with the default name &#8220;mydb&#8221;. The schema name is the database name by the way. Double click it and change it&#8217;s default collation to utf8 &#8211; utf8_general_ci. UTF8 is what Joomla uses by default.</p>
<p>Open MySQL Workbench Preferences and set the column default names and values for the Model configuration. That way you can make it easier for yourself to follow the standards and conventions you want to be following. For those of you who are using Nooku, make sure to look up the <a href="http://nooku.assembla.com/wiki/show/nooku-framework/KDatabase">Nooku naming conventions</a>.</p>
<p>For my example I&#8217;ll be setting up a small blog database.</p>
<h2>The articles table</h2>
<p><a href="http://www.torkiljohnsen.com/wp-content/uploads/2010/07/MySQL_Workbench_add_blog_table.png"><img src="http://www.torkiljohnsen.com/wp-content/uploads/2010/07/MySQL_Workbench_add_blog_table-e1279833324229-150x150.png" alt="" title="MySQL_Workbench_add_blog_table" width="150" height="150" class="size-thumbnail wp-image-309 alignright" /></a>Click the Place a New Table-button in the left toolbar and click anywhere on the canvas to place a new table. Double click the table to start editing. You&#8217;ll see a line of tabs appearing at the bottom of the screen, one of which being columns, which you can edit to add columns to your table. </p>
<p>I created an example table structure for a <strong>blog articles table</strong> that you can look at on the screenshot to the right. Very basic stuff, just an id, a title, some content and a publish date for every article.</p>
<h2>Comments for my blog articles</h2>
<p>I then added a comments table, so that people can add comments to my blog. Basic stuff here too: Comment id, author name, author email, author homepage and comment contents. Note: I added no relation between the two tables just yet.</p>
<p><a href="http://www.torkiljohnsen.com/wp-content/uploads/2010/07/MySQL_Workbench_add_comments_table.png"><img src="http://www.torkiljohnsen.com/wp-content/uploads/2010/07/MySQL_Workbench_add_comments_table-e1279833747991-150x150.png" alt="" title="MySQL_Workbench_add_comments_table" width="150" height="150" class="alignright size-thumbnail wp-image-311" /></a>Now, I need to set up a <strong>relation between the two tables</strong>, since each comment should belong to a blog article. I click the button for 1:n non-identifying relationship, because each blog post will have potentially many comments attached to it. Non-identifying just means that the relation does not identify the comments, in this case that&#8217;s the job of the comment id. </p>
<p>So after clicking 1:n non identifying, I then click the comments table and proceed to click the articles table to set up the relation. You&#8217;ll see the line representing the relationship popping up immediately. A new column, blog_article_id is also added to the comments table automatically. This is of course the foreign key.</p>
<p>I then click and drag the new column, blog_article_id, up in the comments table, so that it&#8217;s ordered as the second column. Not necessary, but I like to keep my keys close. Note that you can also double click the relation indicator itself to edit the relation and manually change it or indicate if it&#8217;s mandatory or not. A comment needs to belong to a blog post, so in my example the relation is mandatory.</p>
<p>There, all ready to go! </p>
<h2>Create the components install SQL script</h2>
<p>First, I forgot, my tables need to be able to have their names converted to use any db prefix according to the Joomla standards, so I need them to have the db prefix nameholder #__. So blog_articles becomes #__blog_articles and blog_comments becomes #__blog_comments.</p>
<p>Ok, now let&#8217;s create an install script. Go to the main menu and click File -> Export -> Forward engeneer SQL CREATE script. For Output SQL scriptfile, put in a the desired filename for your SQL file, install.sql would fit the bill. Select &#8220;Omit schema qualifier in object names&#8221;, or else the database name (mydb) will be included in all SQL statements in the script. You can also skip creation of foreign keys if you want to since they have no effect in MyISAM, but it will do no harm to leave them in there. In my opinion they just makes the SQL structure easier to read for people interested in checking out it&#8217;s details.</p>
<p>In the next step, choose to export table objects. You can also add default data to your tables if you want to, and would then wish to also export data for the tables. Click continue, then finish, and the SQL file will be created for you. </p>
<h2>Creating version 2 of my component, and the upgrade SQL script</h2>
<p>Then I wanted to add an author name to my blog articles, so I went ahead and did that. Now I have a new version of my database, and I need to update my component. So my components version two will have to include an update script. For this I&#8217;ll need some SQL to modify the table structure, and this is where MySQL Workbench comes in very handy.</p>
<p><a href="http://www.torkiljohnsen.com/wp-content/uploads/2010/07/MySQL_Workbench_create_alter_script.png"><img src="http://www.torkiljohnsen.com/wp-content/uploads/2010/07/MySQL_Workbench_create_alter_script-e1279834186659-150x150.png" alt="" title="MySQL_Workbench_create_alter_script" width="150" height="150" class="size-thumbnail wp-image-312 alignright" /></a>After having modified the schema, from the main menu click File -> Export -> <strong>Forward engineer SQL ALTER script</strong>. In the Input file-field, select the SQL CREATE script you created earlier, and in Output file you name the resulting file. This will take the SQL file you just created (version 1), compare it to the current updated schema (version 2) which includes the author_name, and then produce an SQL ALTER script that creates a bridge between versions 1 and 2. that you can run on existing installations to update their schemas. Pretty neat, huh? Takes five seconds, and it&#8217;s easy to include in your upcoming new product release!</p>
<p>This example might not be much, but imagine having done multiple small and big changes. Having easy version creation and automation of upgrade scripts at hand then really comes in handy.</p>
<h2>Streamlining the process</h2>
<p>All we need now is some creative soul to write some Lua scripts to automate the creation of update scripts for all old versions every time a new version is saved. When you create version 20 and run the plugin, then all update scripts for all previous 19 versions are automatically set up for you.</p>
<p>Automatic insertion of $Id$ tag for SVN keywords would also be nice of course. Validation of Joomla compatibility or Nooku conformity are other ideas. Anything to prevent potential errors and automate tedious tasks really.</p>
<p>There exists a <a href="http://code.google.com/p/mysql-workbench-doctrine-plugin/">plugin for doing Doctrine exports from MWB</a>, so someone might get some inspiration from that.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2010/07/23/using-mysql-workbench-to-manage-your-joomla-components-db-schema/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>What is MVC, and why should I care?</title>
		<link>http://www.torkiljohnsen.com/2010/07/17/mvc-explained-with-benefits-and-examples/</link>
		<comments>http://www.torkiljohnsen.com/2010/07/17/mvc-explained-with-benefits-and-examples/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 09:02:25 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[joomla]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[design patterns]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[Nooku]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/?p=170</guid>
		<description><![CDATA[Those of you following blogs and tweets in the Joomlasphere and reading about Nooku, might have read and learned about MVC and HMVC already. If not, here is a short explanation on MVC, and why you should care about design patterns and MVC in particular, especially if you&#8217;re a Joomla user. Design patterns Design patterns [...]]]></description>
			<content:encoded><![CDATA[<p>Those of you following blogs and tweets in the Joomlasphere and reading about Nooku, might have read and learned about MVC and HMVC already. If not, here is a short explanation on MVC, and why you should care about design patterns and MVC in particular, especially if you&#8217;re a Joomla user.<span id="more-170"></span><br />
<a name="design_patterns"></a><br />
<h2>Design patterns</h2>
<h3>Design patterns are reusable solutions</h3>
<p>First of all, MVC is an <em>architectural design pattern</em>. Yeah, that&#8217;s a mouthful. What is a <em>design pattern</em>? Well think of it like this: Patterns are stuff that repeats itself, right? So a <em>design</em> pattern is a design that repeats itself, or you could say &#8220;is reused&#8221;. A design can in development terms be thought of as a solution, so when you hear the words &#8220;design pattern&#8221;, you can think <em>reusable solution</em>. </p>
<p>Reusable solutions are smart ways of solving similar problems without reinventing the wheel. An architectural design pattern like MVC is in other words a reusable solution to an architectural problem. Many computer softwares aren&#8217;t that different architecturally, so MVC is a solution that can be used in many circumstances.</p>
<p>By giving names to these design patterns, for instance MVC, developers can easily communicate between one another how they are approaching or solving issues in their applications. For instance, if a PHP class in my code is called ArticleController (where &#8220;Controller&#8221; is the C in MVC), another developer that reads this code will immediately understand what the responsibility of this class is and what it should be able to do, because he understands the responsibility of the Controller in the MVC pattern. </p>
<h3>&#8230;like the wheel</h3>
<p>Speaking of not reinventing the wheel; the wheel itself could be seen as a design pattern: </p>
<p>We use the wheel in for instance cars, bicycles, buses and trains. So the wheel has indeed become a reusable solution to one common challenge: Making a vehicle easy to move. The wheels themselves are different on each vehicle because they are adapted to suit special circumstances, but the wheel concept itself is the same: Once the solution has been identified, it&#8217;s just a matter of putting it to good use. </p>
<p>So if you and I are building a vehicle that&#8217;s going to solve the challenge of transporting us from A to B, and I suggest that &#8220;we should put wheels on this thing&#8221;, then you&#8217;ll basically know what I&#8217;m thinking and we&#8217;ll also have a common understanding of how we&#8217;re going to build it. If we were to travel on a snow covered surface though, you could have suggested that we used a pair of skis as our solution, instead of the wheels. I would of course have slapped my forehead and agreed with you, without needing to see complicated blueprints or having long committee meetings.</p>
<p>That&#8217;s the advantage of having design patterns!</p>
<p>Jeff Atwood also has another nice MVC analogy in a blog post of his, see the link in the <a href="#references_and_footnotes">references &#038; footnotes</a> at the bottom.</p>
<p><a name="mvc"></a><br />
<h2>The building blocks of MVC</h2>
<p>The MVC pattern splits your code into three parts, often referred to as a triad: The Model, View and Controller. Here is a brief outline of what job each part does, particularly in the Joomla and Nooku Frameworks. </p>
<p>Note: This will teach you how to talk the talk, but not walk the walk! Oleg Nesterov&#8217;s presentation &#8220;Joomla Extension Kung Fu&#8221; provides some nice PHP code examples you can look at though to see MVC in action. See the link in the <a href="#references_and_footnotes">references &#038; footnotes</a> at the bottom of this article. I&#8217;d also recommend looking into the <a href="http://nooku.assembla.com/code/nooku-framework/subversion/nodes">Nooku Framework sourcecode</a> to see how MVC is implemented in PHP there.</p>
<p>Here are the basics though:</p>
<h3>Controller</h3>
<p>The controller is in charge, as the name would suggest. When you do a request, like for instance in a Joomla site entering example.com/index.php?option=com_content&#038;view=article&#038;id=13 in your browser, the controller in the content component takes care of getting the request data. For this request, we have the variables option, view and id visible in the URL. From that, the controller will set the model state so that the model, which is fetching the data for us later on, will know that it needs to fetch article number 13. The controller will then tell the article view to render itself. </p>
<h3>View</h3>
<p>The view decides what ends up on the screen. It will use the model to fetch the data it needs, load the template and display the content inside that template. In this case, the view requested is &#8220;article&#8221;, singular. In Nooku Framework, the view will automatically deduct from this that it needs to fetch a single item instead of a collection of items, as &#8220;articles&#8221; (plural) would have suggested. This is a small part of the &#8220;magic&#8221; happening underneath the hood in Nooku, which makes it so easy to work with.</p>
<h3>Model</h3>
<p>The model handles the data. If you need something added, edited, deleted or fetched to or from the database, the model is the class that will do the heavy lifting. The controller will set it&#8217;s states (like filtering, ordering etc), and then the model will do whatever it is told to do.</p>
<h2>Benefits and advantages of MVC, for all of us</h2>
<p>Why should you care about MVC and demand that your developers do the same? </p>
<h3>A clear separation of the code</h3>
<p>First of all, MVC splits your code into three distinct parts, each of which have clear responsibilities and limitations. When you&#8217;ve used this pattern for a while, deciding where to put a piece of code or look for a piece of code becomes intuitive and straight forward. This makes many parts of development a lot easier, because the design pattern dictates where the code should be located and what the code should do.<br />
It also makes it easier for other developers who know MVC to read and understand the code you have written, and after that, also extend or contribute to it, or even replace parts of it. </p>
<h3>Visual flexibility</h3>
<p>At the heart of MVC there is the desire to separate the presentation of data from the manipulation of data, partially because we want to reuse as much code as possible, but also because we want to be able to present one set of data in multiple ways. In the Joomla CMS for instance (version 1.5 and up), you have templates, and you can change templates to easily get a list of articles to look completely different without modifying the Joomla core code. Each template has the power to implement it&#8217;s own overrides for any view in any component in Joomla. Consequently, anyone can use their own template to make a component look exactly like they want to, given that the component in question follows the MVC design pattern of course. </p>
<h3>Formatting flexibility</h3>
<p>A new presentation of content need not only mean a new HTML template though: A list of articles can very well be displayed in a completely different format, like CSV, RSS, PDF or JSON. This can allow us to easily be able to reuse it in other parts of your website or even on other websites. So while the presentation or format of the data is different, the functionality used to fetch the data from the database is exactly the same every time. </p>
<h3>Replaceable parts</h3>
<p>On the opposite side: If I suddenly decide I want to store my articles in flat files instead of in a database, I can just modify the part of MVC that stores and fetches data, and leave the presentation part alone. The presentation of the data is in other words decoupled from the part of the application that communicates with the storage of the data.  </p>
<h3>Workflow</h3>
<p>My personal experience is that when working in teams, the separation of responsibilities in MVC makes it easy to divide the workload between team members. If a task on my task list just says &#8220;Article model&#8221;, then these two words also describe pretty well what it is that I need to do.</p>
<h2>Where to go from here?</h2>
<p>So how do I find out if my favourite component X follows the MVC pattern or not? Easy in most systems! In Joomla you can open the component&#8217;s folders, either administrator/components/com_x/ or components/com_x/ in a file browser or FTP client, and look for folders named &#8220;models&#8221; and &#8220;views&#8221;. If you find none, then the component is likely not using MVC the Joomla way. </p>
<p>If so, make sure to send the component&#8217;s developer an e-mail with a link to this article ;)</p>
<h2>Conclusions</h2>
<p>Design patterns are like wheels: They make things roll smoothly!</p>
<p><strong>The benefits of the MVC design pattern:</strong> It provides a logical and predictable architecture to work with and collaborate on, it allows us to reuse larger parts of our code, and it allows us to modify parts of our code while other parts can remain untouched. Less code equals less maintenance, and more decoupling of code gives better flexibility and extensibility.</p>
<p>More importantly: MVC is the Joomla standard, so if you&#8217;re building extensions for Joomla you should use MVC like the rest of us.</p>
<p><a name="references_and_footnotes"></a><br />
<h2>References &#038; further reading</h2>
<ol>
<li><a href="http://www.martinfowler.com/eaaDev/uiArchs.html">GUI Architectures</a>, by Martin Fowler</li>
<li><a href="http://www.slideshare.net/onesterov/joomla-extensions-kung-fu">Joomla Extension Kung Fu</a>, presentation by Oleg Nesterov given at J and Beyond 2010</li>
<li><a href="http://www.slideshare.net/HermanPeeren/design-patterns-illustrated">Design patterns illustrated</a>, presentation by Herman Peeren given at J and Beyond 2010</li>
<li><a href="http://www.codinghorror.com/blog/2008/05/understanding-model-view-controller.html">Understanding Model-View-Controller,</a> by Jeff Atwood</li>
<li><a href="http://blog.astrumfutura.com/archives/373-The_M_in_MVC_Why_Models_are_Misunderstood_and_Unappreciated.html">The M in MVC: Why Models are Misunderstood and Unappreciated</a>, by Pádraic Brady</li>
<li><a href="http://publib.boulder.ibm.com/infocenter/adiehelp/v5r1m1/index.jsp?topic=/com.ibm.etools.struts.doc/topics/cstrdoc020.html">Benefits of the MVC design pattern</a>, by the IBM Corporation</li>
<li><a href="http://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller">Wikipedia article on MVC</a>, which clearly states that MVC was coined by a Norwegian guy, so you&#8217;re obviously in good hands here! :)</li>
<li><a href="http://c2.com/cgi/wiki?PatternsForBeginners">Patterns for beginners</a>, by Falk Bruegmann</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2010/07/17/mvc-explained-with-benefits-and-examples/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Transferring Panic&#8217;s Coda to a new computer</title>
		<link>http://www.torkiljohnsen.com/2009/01/22/transferring-panics-coda-to-a-new-computer/</link>
		<comments>http://www.torkiljohnsen.com/2009/01/22/transferring-panics-coda-to-a-new-computer/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 09:06:21 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/2009/01/22/transferring-panics-coda-to-a-new-computer/</guid>
		<description><![CDATA[I am a huge fan of the lightweight code editor Coda, made by Panic. It is a combined code editor and FTP client that I frequently use during work hours. Probably the application I use the most, if you disregard Firefox. Today, Murphy&#8217;s law kicked in though; Just as we are approaching the deadline on [...]]]></description>
			<content:encoded><![CDATA[<p>I am a huge fan of the lightweight code editor Coda, made by Panic. It is a combined code editor and FTP client that I frequently use during work hours. Probably the application I use the most, if you disregard Firefox. Today, Murphy&#8217;s law kicked in though; Just as we are approaching the deadline on a large project, my laptop screen dies. For no good reason.</p>
<p><span id="more-69"></span> This is no crisis, we have spare computers, but having to set up all my needed Coda sites all over again would just be too much hassle. So I needed to transfer all Coda sites, stored passwords and I would prefer not having to purchase Coda all over again to use it on the old backup computer. </p>
<p>Coda also contains code snippets and plugins that really makes me work more effectively, and those would be alot of hassle for me to add manually. </p>
<p>So I googled a bit on how to do this, and this is what I did:</p>
<ol>
<li>I connected the old desktop computer to the laptop with a Firewire cable, and turned on the laptop. Immediately after pressing the power button, I press and hold &#8220;T&#8221; on the laptop. This will start the laptop in Target Disk Mode, making it function like a regular external harddrive.</li>
<li>I copied the Coda application from the Application folder on the laptop to the Application folder on the desktop computer. When trying to start Coda after this, it was like I had just downloaded the program: I had 15 days left on my trial period, and no sites in sight.</li>
<li>To transfer the Coda settings I copied ~/Library/Preferences/com.panic.Coda.plist from my laptop to the same folder on the desktop computer. ~/ stands for your home-folder, in /Users/yourname. This took care of all my Sites, but not their passwords.</li>
<li>Next I also copied ~/Library/Application Support/Coda from my laptop to the same folder on the desktop computer. This took care of all my plugins and stored code snippets</li>
<li>Last thing I needed was the passwords to all the sites stored in Coda. To do this I first opened the folder ~/Library/Keychains on my laptop. Here I duplicated the file &#8220;login.keychain&#8221; and renamed my copy &#8220;laptop.keychain&#8221;. I then copied this file over to the Desktop of the other computer. On the new computer I opened the application Keychain (from Applications/Utilities) and created a new keychain called laptop, which is stored in ~/Library/Keychains. I then replace this new keychain with the old one from the laptop, and tadaaaaa&#8230;</li>
</ol>
<p>All done! Both Coda, sites, passwords, plugins, code snippets and general happiness transferred from one computer to the other!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2009/01/22/transferring-panics-coda-to-a-new-computer/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Email-standards.org lauches</title>
		<link>http://www.torkiljohnsen.com/2007/11/28/email-standardsorg-lauches/</link>
		<comments>http://www.torkiljohnsen.com/2007/11/28/email-standardsorg-lauches/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 14:15:47 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[Content management]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Standards]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/2007/11/28/email-standardsorg-lauches/</guid>
		<description><![CDATA[&#8220;The Email Standards Project works with email client developers and the design community to improve web standards support and accessibility in email.&#8221; I recommend that anyone currently involved in setting up or sending e-mail newsletters stop by this site to check out what you can do to contribute. This should be highly relevant for anyone [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;The Email Standards Project works with email client developers and the design community to improve web standards support and accessibility in email.&#8221;</p>
<p>I recommend that anyone currently involved in setting up or sending e-mail newsletters stop by this site to check out what you can do to contribute. This should be highly relevant for anyone with a CMS out there&#8230;</p>
<p><a href="http://www.email-standards.org/">Email Standards</a></p>
<p>[tags]email,standards,launch[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2007/11/28/email-standardsorg-lauches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Back with PubMatic after receiving outstanding service</title>
		<link>http://www.torkiljohnsen.com/2007/10/11/back-with-pubmatic-after-receiving-outstanding-service/</link>
		<comments>http://www.torkiljohnsen.com/2007/10/11/back-with-pubmatic-after-receiving-outstanding-service/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 20:12:57 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[Advertising]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web apps]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/2007/10/11/back-with-pubmatic-after-receiving-outstanding-service/</guid>
		<description><![CDATA[This week a really strange and really nice thing happened to Torkil the disgruntled PubMatic user. I now feel convinced that I have to try PubMatic for real for at least another month, and do it a bit more wholeheartedly this time. This week I got an e-mail from Rajeev Goel, co-founder and General Manager [...]]]></description>
			<content:encoded><![CDATA[<p>This week a really strange and really nice thing happened to Torkil the disgruntled PubMatic user. I now feel convinced that I have to try PubMatic for real for at least another month, and do it a bit more wholeheartedly this time. <span id="more-63"></span></p>
<p>This week I got an e-mail from Rajeev Goel, co-founder and General Manager of PubMatic, asking if I would consider talking with him concerning my <a href="http://www.torkiljohnsen.com/2007/10/06/abandoning-pubmatic-%e2%80%94-new-tactic/">recent blog post about abandoning PubMatic</a>. where I decided to stop using it because it would seem as if PubMatic was taking half of my ad income. Well&#8230; I was mistaken on that part, and Rajeev also let me in on a few of the secrets behind the inner workings of PubMatic.</p>
<p><img src='http://www.torkiljohnsen.com/wp-content/uploads/2007/09/bilde-4.png' alt='Pubmatic logo' /><br />
<!--adsense#468artikkelbanner--></p>
<p>Let&#8217;s get the misunderstanding out of the way first: I thought <a href="http://pubmatic.com">PubMatic</a> was taking half of my ad views, and that turned out to be a really stupid mistake on my part. I had set up my ads to display PubMatic ads half of the time, and Google Adsense the other half of the time. To make a long story short: PubMatic would only count the ads it displayed through it&#8217;s own system, this being mostly Adsense blocks with colour variations, while Adsense itself would count all the ads it displayed directly AND all the ads served through PubMatic since they too were in fact Googleads. So the joke is on me, and to the PubMatic team: I am sorry you had to take a long distance call from California to Norway to explain this to myself.</p>
<p><strong>Getting a phonecall from California</strong><br />
Yes, Rajeev actually gave me a call and went through my numbers with me, asking me what I did not like with PubMatic and trying to explain and/or find solutions to my issues. As he pointed out, I at least had a 10% increase in ad income, without lifting a finger I might add. This even without letting PubMatic roam free and give it the opportunity to optimize at it&#8217;s own accord, which I will start doing from now on to see what it might really do. He was also keen to explain a bit around how their ad selection system works and how they plan on making money on this system, but he also asked me kindly not to reveal this on my blog. I got the opportunity to fill him in on my opinion on the PubMatic system as a whole, which I must admit is pretty nifty now that the whole misunderstanding from last week has been cleared up.</p>
<p><strong>Learning to love complaining clients</strong><br />
To sum up: Yes, he actually scheduled a call three days in advance, and took 20 minutes of his time to take a long distance conversation to one, tiny, insignificant and dissattisfied customer in <a href="http://maps.google.com/?ie=UTF8&#038;ll=67.282122,14.414063&#038;spn=0.158311,0.664673&#038;z=11&#038;om=1">BodÃ¸, Norway</a>. In return I naturally answered any question he had, like for instance <a href="http://www.sitepoint.com/blogs/2007/09/19/how-to-boost-your-ad-revenue-70-110-automatically">how I came across PubMatic</a>. All in all, I think there is alot to be learned here that many web application developers might not even consider. Sure the world is large and the number of potential online clients is probably insanely large, but attention to the little man might get you alot of well-earned credits and online attention. Brendon Sinclair wrote a small piece on learning to <a href="http://www.sitepoint.com/article/handling-client-complaints">love complaining clients</a>, and I think he makes a few good points there.</p>
<p>[tags]Marketing,Adsense,PubMatic,Google,Advertising[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2007/10/11/back-with-pubmatic-after-receiving-outstanding-service/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Want to boost your ad revenue automatically?</title>
		<link>http://www.torkiljohnsen.com/2007/09/21/want-to-boost-your-ad-revenue-automatically/</link>
		<comments>http://www.torkiljohnsen.com/2007/09/21/want-to-boost-your-ad-revenue-automatically/#comments</comments>
		<pubDate>Fri, 21 Sep 2007 19:32:11 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/2007/09/21/want-to-boost-your-ad-revenue-automatically/</guid>
		<description><![CDATA[I came across a blog post on Sitepoint.com by Matt Mickiewicz commenting on a new ad program called PubMatic that supposedly will maximize your profits by optimizing your ads for you. I&#8217;ve taken it upon myself to test and review this ad program and post my findings here on my blog. So, reporting in after [...]]]></description>
			<content:encoded><![CDATA[<p>I came across a <a href="http://www.sitepoint.com/blogs/2007/09/19/how-to-boost-your-ad-revenue-70-110-automatically">blog post on Sitepoint.com by Matt Mickiewicz</a> commenting on a new ad program called <a href="http://www.pubmatic.com/">PubMatic</a>  that supposedly will maximize your profits by optimizing your ads for you. I&#8217;ve taken it upon myself to test and review this ad program and post my findings here on my blog.<br />
<span id="more-60"></span></p>
<div style="width:255px; float: left;"><a href='http://www.torkiljohnsen.com/2007/09/21/want-to-boost-your-ad-revenue-automatically/pubmatic-logo/' rel='attachment wp-att-61' title='Pubmatic logo'><img src='http://www.torkiljohnsen.com/wp-content/uploads/2007/09/bilde-4.png' alt='Pubmatic logo' /></a><br /><!--adsense#250kvadrat--></div>
<p><strong>So, reporting in after day one!</strong></p>
<p>Signing up with Pubmatic was easy. I have decided to test this on my Norwegian Martial Arts forum at <a href="http://kampforum.no/forum">kampforum.no</a>. To begin with, I have decided to run a 468 x 60 ad block in the top of the forum with PubMatics little javascript magic. This is an ad spot that recently has run Googleads exclusively, and at a lousy $0.38 <a href="http://en.wikipedia.org/wiki/Cost_Per_Mille">eCPM</a> in August 2007. So it should be easy to improve this.</p>
<p>At this time I still only have a Google Adsense account, so PubMatic is only rotating lots of text ads in really funky colors. I have signed up in the other programs availabe to try to give PubMatic as much of a chance to vary and find an optimal mix of ads and colors as possible. The colors of my ad used to be really low key and non-intrusive on the reader, so I am expecting complaints from the users of the forum, but none have arrived yet.</p>
<p>I don&#8217;t have any numbers yet from pubmatic. I recon I will report back in a week or two when I have some to show off.</p>
<p>[tags]advertising, pubmatic, review, testing, ads, adsense[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2007/09/21/want-to-boost-your-ad-revenue-automatically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google spreadsheets now with charts!</title>
		<link>http://www.torkiljohnsen.com/2007/04/18/google-spreadsheets-now-with-charts/</link>
		<comments>http://www.torkiljohnsen.com/2007/04/18/google-spreadsheets-now-with-charts/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 16:23:05 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Web apps]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/2007/04/18/google-spreadsheets-now-with-charts/</guid>
		<description><![CDATA[Google just released chart support for Spreadsheets. A long-awaited and almost inevitable enhancement to the already excellent features of this online Excel competitor. The interface has been adjusted and a new chart button has been added on the Edit menu. Charts of different types can be created. So far there is support for columns, bars, [...]]]></description>
			<content:encoded><![CDATA[<p>Google just released chart support for Spreadsheets. A long-awaited and almost inevitable enhancement to the already excellent features of this online Excel competitor. The interface has been adjusted and a new chart button has been added on the Edit menu.<br />
<span id="more-56"></span><br />
<!--adsense#250kvadrat--> Charts of different types can be created. So far there is support for columns, bars, lines, pie and scatterm all with 2-5 different subtypes. (see screenshot below). Selecting data for the chart is easy: Just click and drag over a dataset before you click the chart button. When creating a chart you also get a nifty live preview of the chart that you can look at before approving the end result. </p>
<p>The finished chart is placed in a layer above the actual spreadsheet and can be dragged around, resized and edited with ease. It mimics the functionality of MS Excel, but with alot less functionality and alot more simplicity. You&#8217;ll probably like the simplicity, but after a while you&#8217;ll get frustrated over the functionality it lacks compared to what you are used to from Excel.</p>
<p><strong>Here are some screenshots:</strong></p>
<p><!--adsense#468artikkelbanner--></p>
<p><strong>Adding/editing the chart:</strong></p>
<p><img id="image57" src="http://www.torkiljohnsen.com/wp-content/uploads/2007/04/google_spreadsheets_charts.png" alt="Editing a google spreadsheet chart" /></p>
<p><!--adsense#468artikkelbanner--></p>
<p><strong>The finished chart:</strong></p>
<p><img id="image58" src="http://www.torkiljohnsen.com/wp-content/uploads/2007/04/google_finished_chart.png" alt="Google spreadsheet chart finished" /></p>
<p>So what do you think about this new feature? Personally I feel it lacking in some areas, but I guess that is the tradeoff when using an online app like this. Same goes for docs and regular spreadsheet use really&#8230;</p>
<p>More news can be read here: <a href="http://www.google.com/google-d-s/whatsnew.html">http://www.google.com/google-d-s/whatsnew.html</a></p>
<p>[tags]Google, spreadsheets, excel, microsoft, google docs, charts[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2007/04/18/google-spreadsheets-now-with-charts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Firefox 2 beta is out</title>
		<link>http://www.torkiljohnsen.com/2006/09/05/firefox-2-beta-is-out/</link>
		<comments>http://www.torkiljohnsen.com/2006/09/05/firefox-2-beta-is-out/#comments</comments>
		<pubDate>Tue, 05 Sep 2006 05:27:59 +0000</pubDate>
		<dc:creator>tj</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Webdesign]]></category>

		<guid isPermaLink="false">http://www.torkiljohnsen.com/2006/09/05/firefox-2-beta-is-out/</guid>
		<description><![CDATA[New browser versions are always interesting for us web developers. Mozilla says they now have refreshed the visual appearance of the browser, added built-in phishing protection, enhanced the search capabilities, improvement in the tabbed browsing features, better RSS features, spell checking, and more. Read all about it and download it here: http://www.mozilla.org/projects/bonecho/releases/2.0b2.html [tags]Firefox, browsers, release[/tags]]]></description>
			<content:encoded><![CDATA[<p>New browser versions are always interesting for us web developers. Mozilla says they now have refreshed the visual appearance of the browser, added built-in phishing protection, enhanced the search capabilities, improvement in the tabbed browsing features, better RSS features, spell checking, and more.<span id="more-43"></span></p>
<p>Read all about it and download it here: http://www.mozilla.org/projects/bonecho/releases/2.0b2.html</p>
<p>[tags]Firefox, browsers, release[/tags]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.torkiljohnsen.com/2006/09/05/firefox-2-beta-is-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.433 seconds -->

