<?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>paulbattisson.com</title>
	<atom:link href="http://paulbattisson.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://paulbattisson.com</link>
	<description>A blog built on coffee, math, programming and curiosity.</description>
	<lastBuildDate>Mon, 27 Aug 2012 08:04:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.1</generator>
		<item>
		<title>Review of &#8220;Advanced Apex Programming&#8221; by Dan Appleman</title>
		<link>http://paulbattisson.com/?p=145</link>
		<comments>http://paulbattisson.com/?p=145#comments</comments>
		<pubDate>Mon, 27 Aug 2012 08:04:16 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=145</guid>
		<description><![CDATA[On Twitter the other day I saw a status from Dave Carroll giving a great review for Dan Appleman&#8217;s new book &#8220;Advanced Apex Programming&#8220;. Dave is someone who&#8217;s opinion I trust so I went a bought a copy, read it, had a think, wrote some annotations and thought I would write a review to share. [...]]]></description>
			<content:encoded><![CDATA[<p>On Twitter the other day I saw a <a href="https://twitter.com/dcarroll/status/233589953664278528">status from Dave Carroll</a> giving a great review for <a href="https://twitter.com/danappleman">Dan Appleman&#8217;s</a> new book &#8220;<a href="http://advancedapex.com/">Advanced Apex Programming</a>&#8220;. Dave is someone who&#8217;s opinion I trust so I went a bought a copy, read it, had a think, wrote some annotations and thought I would write a review to share.</p>
<p>A full review is posted below with lots of details on some of the things I did (and didn&#8217;t) like. The short version is:</p>
<blockquote><p>if you are an intermediate level or above apex developer (1-2 years experience) then go and buy yourself a copy. Read it carefully, think about what is being said and make some notes. You will  learn a few things and it will make you think about how you are coding. 8/10 or 4 stars.</p></blockquote>
<p>Okay, so you want to read the gory details?</p>
<p>To start with, Dan&#8217;s writing style is extremely approachable and easy to follow. You get what he is saying. the book is well structured and seems to go in a logical order. Code samples are easy enough to understand and have a good level of explanation. One small issue (not really Dan&#8217;s fault) is that due to the physical size and layout of the book, you occasionally get squashing and code over multiple pages. It is not a big problem and almost every programming books has a page of two that suffers from this, and as someone who prefers paper over pdf, I will accept it no worries. For those who might want another option, you can download the sample code and could read that on your screen alongside the book.</p>
<p>I am going to be honest and say there were certain things I didn&#8217;t agree with in terms of what Dan says are best practices. I won&#8217;t go into too many specifics here as I want people to make up their own minds, but I just always feel it is important to highlight that this book should not be read as a definitive patterns guide. Dan is quite open about this in the book and I would imagine most experienced developers and architects will disagree with some things.</p>
<p>For me this is however the books biggest positive as well. The currently available Force.com books are largely aimed at the newbie and beginner level developers with some covering of intermediate level stuff. This is the first book out there for more experienced developers and it is a welcome addition to the collection. Outside of conferences like Dreamforce/Cloudstock and local developer groups it is difficult to find somewhere to get this information in a centralised nicely presented format. I really liked Dan&#8217;s section on errors and debugging, and have adapted some of the ideas to place into my work in the future. It is a brilliant book and I hope more follow.</p>
<p>In summary, I really would highly recommend this book to intermediate and experienced apex developers. You may not agree with all of the book but it will make you think about why you code as you do and why you agree/disagree with what is written. And you will learn something new about the apex language. Worth every penny!</p>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=145</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OAuth Error in Salesforce</title>
		<link>http://paulbattisson.com/?p=142</link>
		<comments>http://paulbattisson.com/?p=142#comments</comments>
		<pubDate>Tue, 12 Jun 2012 20:48:10 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[X-Frame-Options]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=142</guid>
		<description><![CDATA[I wrote an integration for Salesforce a while back that read some information from a RESTful web service and displayed it in a VisualForce Page embedded in a standard page layout on an SObject. The system let you authorise with OAuth by clicking a link which would redirect you to the specified authorisation page and [...]]]></description>
			<content:encoded><![CDATA[<p>I wrote an integration for Salesforce a while back that read some information from a RESTful web service and displayed it in a VisualForce Page embedded in a standard page layout on an SObject. The system let you authorise with OAuth by clicking a link which would redirect you to the specified authorisation page and after authorising correctly you would be redirected back to the correct record.</p>
<p>The system used to work perfectly but then suddenly stopped working. The only error was regarding null input to JSON but digging deeper showed that the authorisation was never completing. Further digging and logging on the console from the link showed an error:</p>
<blockquote><p>Refused to display document because display forbidden by X-Frame-Options.</p></blockquote>
<p>Some digging lead me to <a href="http://stackoverflow.com/questions/9100916/blank-canvas-refused-to-display-document-because-display-forbidden-by-x-fram">this StackOverflow post</a> which lead me to update the link to have a target=&#8221;_top&#8221; attribute, and now it all works again! Basically the OAuth provider had updated their service to properly implement the protocol which leads to this error being thrown if we are about to perform some sort of XSS style action.</p>
<p>Hope anyone who stumbles across this finds it helpful! It caused me a few headaches so I thought I would share.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=142</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cloudstock 2012 &#8211; My Two Pence Worth</title>
		<link>http://paulbattisson.com/?p=138</link>
		<comments>http://paulbattisson.com/?p=138#comments</comments>
		<pubDate>Sat, 09 Jun 2012 15:40:20 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Cloudstock 2012]]></category>
		<category><![CDATA[Community]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=138</guid>
		<description><![CDATA[It’s been a buys few weeks for me since Cloudstock 2012 so I have only just managed to find a few spare minutes to jot down my thoughts and views on the day. I have attended a few Cloudforce events before and always found them to be a fantastic opportunity to meetup with some people [...]]]></description>
			<content:encoded><![CDATA[<p align="justify">It’s been a buys few weeks for me since Cloudstock 2012 so I have only just managed to find a few spare minutes to jot down my thoughts and views on the day.</p>
<p align="justify">I have attended a few Cloudforce events before and always found them to be a fantastic opportunity to meetup with some people in the community (The North UK group was conceived at this year’s Cloudforce Leeds!) and see what new things were coming out from Salesforce themselves. I thought it was a really good indication of how much growth there ahs been in the world of Force.com development that London was able to hold it’s own Cloudstock event this year, mirroring the success of the San Fransisco event.</p>
<p align="justify">There were some fantastic talks given throughout the day on a range of subjects and it was a brilliant chance to meet up with some old community friends as well as make some new ones. For anyone who hasn’t seen yet, most of the talks given by the developers are up online in some form or another. Just tweet to the relevant person and they will happily show you where to find the information. It was great to get to chat to some of the developer groups there (Heroku, Amazon, Database.com) whom, I haven’t dealt with as much.</p>
<p align="justify">I myself gave a talk on Advanced Force.com Testing which was a fantastic experience. I really enjoyed getting to share some ideas with people and have received a lot of great support and interest from people since. The biggest learning lesson I had was not to eat anything for half an hour before your talk though, in case you get a small piece lodged in your throat and break down in a coughing fit as you start talking. My thanks to all those in the audience who showed concern for my well being, the lesson has been well learned!</p>
<p align="justify">I am looking forward to the next North UK meetup which I am organising for the end of the month when hopefully we can get to share some of the experiences and ideas that came out of Cloudstock/Cloudforce. I think next year’s event is going to be bigger and better as well which is fantastic to see. I will be posting more stuff over the next few weeks to follow on from my talk, but until then, enjoy a few pics of the event from my talk.</p>
<p align="justify"><a href="http://paulbattisson.com/wp-content/uploads/2012/06/IMG_0676.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="IMG_0676" border="0" alt="IMG_0676" src="http://paulbattisson.com/wp-content/uploads/2012/06/IMG_0676_thumb.jpg" width="561" height="419" /></a></p>
<p align="justify"><a href="http://paulbattisson.com/wp-content/uploads/2012/06/IMG_0679.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto; padding-top: 0px" title="IMG_0679" border="0" alt="IMG_0679" src="http://paulbattisson.com/wp-content/uploads/2012/06/IMG_0679_thumb.jpg" width="563" height="419" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=138</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Force.com Developer Meeting 1 Report</title>
		<link>http://paulbattisson.com/?p=129</link>
		<comments>http://paulbattisson.com/?p=129#comments</comments>
		<pubDate>Sun, 12 Feb 2012 21:07:55 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Developer]]></category>
		<category><![CDATA[Force.com]]></category>
		<category><![CDATA[Meetup]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=129</guid>
		<description><![CDATA[This past Tuesday was the inaugural meeting of the North UK Force.com Developer Group and I wanted to take a few minutes to jot down some thoughts and follow up on it. Firstly I wanted to say a massive thanks to all those who came along. We had around 23 people turn up in the [...]]]></description>
			<content:encoded><![CDATA[<p>This past Tuesday was the inaugural meeting of the North UK Force.com Developer Group and I wanted to take a few minutes to jot down some thoughts and follow up on it.</p>
<p>Firstly I wanted to say a massive thanks to all those who came along. We had around 23 people turn up in the end which was a fantastic turn out for the first meeting and gave a wide variety of viewpoints for discussions. I am looking forward to getting to learn from all these people and get to know them a bit better.</p>
<p>The main focus of the evening was around a group based discussion on “The Top 10 (ish) Things Every Force.com Developer Should Know”. For this, I started out giving some blurb and saying about experiences I had training people before we split into 3 groups and came up with our own lists of things that should be known and attempted to compile a top 10. These were then presented by each group to the rest of the group and discussed. We found that they had 5 items in common which (those with + next to in the pictures). I presented my top 10 I had thought of in preparing the evening and Carolina from FinancialForce.com gave us some interesting input on how she has found it best to structure triggers for data validation.</p>
<p>After some administrative discussion on when to meet and where to take the group a few of us decamped to the pub to continue getting to know each other.</p>
<p>Below are the images taken on the night, I am looking forward to the next meeting already!</p>
<p><a href="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02216.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="DSC02216" src="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02216_thumb.jpg" alt="DSC02216" width="603" height="452" border="0" /></a></p>
<p><a href="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02217.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="DSC02217" src="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02217_thumb.jpg" alt="DSC02217" width="601" height="450" border="0" /></a></p>
<p><a href="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02218.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="DSC02218" src="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02218_thumb.jpg" alt="DSC02218" width="606" height="454" border="0" /></a></p>
<p><a href="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02219.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="DSC02219" src="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02219_thumb.jpg" alt="DSC02219" width="605" height="454" border="0" /></a></p>
<p><a href="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02220.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="DSC02220" src="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02220_thumb.jpg" alt="DSC02220" width="604" height="453" border="0" /></a></p>
<p><a href="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02221.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="DSC02221" src="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02221_thumb.jpg" alt="DSC02221" width="299" height="399" border="0" /></a><a href="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02222.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="DSC02222" src="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02222_thumb.jpg" alt="DSC02222" width="300" height="400" border="0" /></a></p>
<p align="center"><a href="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02223.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="DSC02223" src="http://paulbattisson.com/wp-content/uploads/2012/02/DSC02223_thumb.jpg" alt="DSC02223" width="348" height="464" border="0" /></a></p>
<p style="text-align: left;" align="center">Photos also available <a href="https://plus.google.com/u/0/photos/105864912411621828052/albums/5708359114592552257">here</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=129</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Git + GitHub + Force.com = Like!</title>
		<link>http://paulbattisson.com/?p=112</link>
		<comments>http://paulbattisson.com/?p=112#comments</comments>
		<pubDate>Sat, 10 Dec 2011 14:24:31 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=112</guid>
		<description><![CDATA[I remember the first time I tried git, just over 2 years ago and just couldn&#8217;t get my head round it. So I gave it up and started using subversion which I really enjoyed. Since then I have move onto pastures new and earlier this year started looking into git and GitHub again after seeing [...]]]></description>
			<content:encoded><![CDATA[<p>I remember the first time I tried git, just over 2 years ago and just couldn&#8217;t get my head round it. So I gave it up and started using subversion which I really enjoyed. Since then I have move onto pastures new and earlier this year started looking into git and GitHub again after seeing the masses of great open source work going on there. So I endeavoured to try again. I found I enjoyed it. Then I introduced it to my workplace and they started to use it and enjoy it to. This post is a collection of best practices, tips and tricks I have found from my use and are a personal opinion only. If you have specific questions following on from this, please comment below or ask me on twitter <a href="https://twitter.com/#!/pbattisson" target="_blank">@pbattisson</a>.    </p>
<ol>
<li>Forget what you know about source control and start learning again. Git is distributed and as such is quite wildly different. It will take some getting you head around the idea of everybody having a repository that is a full system instead of checking in and out, but stick with it.</li>
<li>Use GitHub, they are cheap, they have a fantastic help section, they make coding social and they also help make using git a bit easier.</li>
<li>Use the command line. It will help you understand more accurately what is going on, it is the fastest way to use git and it gives you the most control. And if you are a developer and are not comfortable with a command line then you should be!</li>
<li>Learn how to branch and merge properly &#8211; this will help you to really start cooking on gas and make your development effort simple as well as highlighting git&#8217;s flexibility.</li>
<li>With Force.com development in a team, use branching and work in your own org. Sharing an org and trying to manage the source control process becomes more difficult. You can easily merge across other peoples changes.</li>
<li>In a Force.com project, make sure you create you repository in the eclipse project folder. Ignore the .settings folder and you should be good to go.</li>
<li>If you do the above, to start working on a project you just clone/fork it into your Eclipse workspace, create a new project with the name of the repo, select none for the initial metadata download and then save all the information upto the server. Easy!</li>
<li>Commit regularly! Push often!</li>
<li>You should per user story or feature you are working on. If multiple people are on a feature, either share an org (for a couple of people) or split the feature into smaller chunks. This will help your code. Remember that a branch is not a separate directory or folder.</li>
<li>All the items you can see in Eclipse are stored in text based metadata files. When merging and fixing conflicts, it is easiest to open the offending file in Notepad++ on Windows or TextMate on Mac. You can see the errors in the merge tags and resolve them from there.</li>
</ol>
<p>There are a few things I think could be improved though. GitHub recognition for Apex and VisualForce in their code highlighting (I know <a href="https://github.com/github/linguist" target="_blank">linguist</a> is open sourced but I can’t say I know where to begin with it) would be a nice start. The Eclipse git plugin needs work (as does the Force.com IDE itself…)&#160; in order to make it easier to work with. </p>
<p>On a side note, I am looking into testing out <a href="http://www.youtube.com/watch?v=tTdyiie8W_g&amp;feature=channel_video_title" target="_blank">Jenkins</a> and <a href="http://stratosource.github.com/" target="_blank">Stratosource</a> as continuous integration and build systems with GitHub. Anybody got any tricks or tips? I will post something up when I do get one of them running.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=112</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enabling Email Templates in the Winter &#8217;12 Force.com IDE</title>
		<link>http://paulbattisson.com/?p=80</link>
		<comments>http://paulbattisson.com/?p=80#comments</comments>
		<pubDate>Mon, 05 Dec 2011 18:18:15 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=80</guid>
		<description><![CDATA[Update: Thanks to Jon Wu for noticing that the original code wouldn&#8217;t compile &#8211; wordpress removed the tags for me in a &#8220;helpful&#8221; way. I have updated the code below to fix this, you can also get it from his gist (which is where I should have put it &#8211; will do next time!) I [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: Thanks to <a href="https://twitter.com/#!/jon_wu">Jon Wu</a> for noticing that the original code wouldn&#8217;t compile &#8211; wordpress removed the tags for me in a &#8220;helpful&#8221; way. I have updated the code below to fix this, you can also get it from <a href="https://gist.github.com/1445287">his gist</a> (which is where I should have put it &#8211; will do next time!)</strong></p>
<p><em>I would like to start this with a big thanks to <a href="https://twitter.com/#!/andymahood__c">Andy Mahood</a>, <a href="https://twitter.com/#!/gbreavin">Gary Breavington</a> and <a href="https://twitter.com/#!/BotosCloud">Michael Botos</a> for their guidance on this matter which I have expanded upon.</em></p>
<p>With the release of the Winter &#8217;12 Force.com IDE update, there have been a few <a href="http://boards.developerforce.com/t5/Announcements/PRODUCT-LAUNCH-The-Winter-12-Force-com-IDE-was-released/m-p/366131#M483">teething issues</a> which have caused a number of problems. ONe of these is that it seems when connected to an org you cannot bring down the email templates folder as part of the metadata by default. I tweeted and posted to see if anyone else was having the same issues and thanks to Gary, Andy and Michael I was directed to the following <a href="https://gist.github.com/1423684">github gis</a>t that give an outline of how to change the package file to include the templates.</p>
<p>So the problem with this method is that it can be very time consuming if you have a large number of folders with email templates you have created. Run the code snippet below in the execute anonymous window and it will output some nice XML text for you to copy across into the package.xml file. Easy!</p>
<p><code><br />
String output = '\n<types>\n';<br />
List<EmailTemplate> templates = [Select e.FolderId, e.DeveloperName<br />
    From EmailTemplate e];<br />
Map<Id, Folder> folders = new Map<Id, Folder>([Select f.Id, f.DeveloperName<br />
    From Folder f where f.DeveloperName != null]);<br />
Set<Id> folderIds = new Set<Id>();<br />
folderIds.addAll(folders.keySet());</p>
<p>for (EmailTemplate template: templates) {<br />
  if (folders.keySet().contains(template.FolderId)) {<br />
    if (folderIds.contains(template.FolderId)) {<br />
      output += '\t<members>' + folders.get(template.FolderId).DeveloperName<br />
                   + '</members>\n';<br />
      folderIds.remove(template.FolderId);<br />
    }<br />
    output += '\t<members>' + folders.get(template.FolderId).DeveloperName<br />
                  + '/' + template.DeveloperName + '</members>\n';<br />
  }<br />
}<br />
output += '</types>\n';<br />
System.debug(output);<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=80</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trigger Testing and The Tony Scott Trigger Pattern</title>
		<link>http://paulbattisson.com/?p=74</link>
		<comments>http://paulbattisson.com/?p=74#comments</comments>
		<pubDate>Mon, 05 Sep 2011 11:58:15 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=74</guid>
		<description><![CDATA[Recently, a friend and former colleague of mine posted up a new Force.com cookbook pattern on triggers to help them become more bulkified and streamlined. That pattern can be found here. I can verify that this pattern works really well and makes your code work in a far more efficient manner helping you to avoid [...]]]></description>
			<content:encoded><![CDATA[<div>Recently, a friend and former colleague of mine posted up a new Force.com cookbook pattern on triggers to help them become more bulkified and streamlined. That pattern can be found <a title="Trigger Pattern" href="http://developer.force.com/cookbook/recipe/trigger-pattern-for-tidy-streamlined-bulkified-triggers">here</a>. I can verify that this pattern works really well and makes your code work in a far more efficient manner helping you to avoid the ill fated query errors that can occur.</p>
<p>What I also like about Tony’s pattern is how easy it makes unit testing your triggers. You can test triggers in one of two ways; by using DML operations in your test method that will execute the trigger and exercise the code or if implementing the referenced pattern, by preparing an SObject and executing the methods in the trigger handler upon this and asserting upon the manipulated SObject. This will mean that the trigger methods are run in technical terms without context (you cannot get the Trigger.isBefore method to return true outside of a before trigger running) but it is debatable as to whether you need to test this as Salesforce will have previously ensured this is working. You will have achieved more than a sufficient level of code coverage and ensured your code works by unit testing the methods, before doing a full run through of the trigger in systems integration testing.</p>
<p>Myself, Alex Berg and Andy Ogenoff recently were debating with regards to testing practices and how to handle the situation where you have some code that is written about a particular SObject that then changes (a new mandatory field is added for example). This trigger pattern helps your tests to deal effectively with this, allowing you to test correctly factored methods which are not at the mercy of the SObject changing. Someone could change the SObject in this situation, adding a new mandatory field which will cause integration tests to fail. However, your code, which does not rely upon this new field, will still be tested properly and should not fail.</p>
<p>I know that I will be continuing to use this pattern in all of my work.</p>
<p>Tony is currently looking for UK based Force.com contract work. You can find him here on <a title="Tony Scott Linkedin" href="http://www.linkedin.com/pub/tony-scott/1a/490/6a7" target="_blank">Linkedin</a>. I can highly recommend him.</div>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=74</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Discussion on Apex Testing</title>
		<link>http://paulbattisson.com/?p=73</link>
		<comments>http://paulbattisson.com/?p=73#comments</comments>
		<pubDate>Fri, 12 Aug 2011 13:25:37 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Agile Practices]]></category>
		<category><![CDATA[Salesforce]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=73</guid>
		<description><![CDATA[A week ago I read a brilliant post by Alex Berg on patterns for apex testing (you can find it here). We then had a good discussion (along with Andy Ognenoff) on Google+ about the different viewpoints we had around how testing should be done. I then disappeared for a week on holiday formulating a [...]]]></description>
			<content:encoded><![CDATA[<p>A week ago I read a brilliant post by <a href="http://twitter.com/alex_berg" target="_blank">Alex Berg</a> on patterns for apex testing (<a href="http://www.sundog.net/sunblog/posts/a-pattern-for-portable-apex-unit-tests" target="_blank">you can find it here</a>). We then had a good discussion (along with <a href="http://twitter.com/#!/aognenoff" target="_blank">Andy Ognenoff</a>) on Google+ about the different viewpoints we had around how testing should be done. I then disappeared for a week on holiday formulating a rough blog post on the topic in my head. I also want to make it clear that this is a technical discussion not a commentary on anybody&#8217;s work. So here goes.</p>
<p>I am going to start of by generalising the way in which we can go about setting up our tests with data:</p>
<ol>
<li>Creating the data in the test method inline</li>
<li>Extracting the data creation to methods in the test class</li>
<li>Creating an external class which is a factory for creating data (I will differentiate between variations on this method later)</li>
</ol>
<p>We will discuss all of these in an attempt to decide “which is best”. Before we start however, I would like to clarify, I am looking at this from the viewpoint of a developer performing unit testing. In his brilliant book the “<a href="http://www.amazon.co.uk/Art-Unit-Testing-Examples-NET/dp/1933988274/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1313151157&amp;sr=1-1" target="_blank">Art of Unit Testing</a>” Roy Osherove starts clearly by explaining the difference between integration testing and unit testing. It is a difference that I can say I think is often not understood;</p>
<blockquote><p>Unit testing the is testing of a single unit of code where a unit is defined as a function or method. Integration testing is the testing of two or more dependent units together.</p>
</blockquote>
<p>When we are discussing most tests in Salesforce we mean unit tests, testing a single method in a class. When we pull many methods together to move an SObject or piece of data through its lifecycle then we are performing integration testing. Unit testing is there so that when another developer goes and makes a change to the functionality of the system’s code or object behaviour the tests will fail (which is good news) so the system can be refactored properly to allow the existing functionality (if required to occur as well as the new behaviour). These points are key to the discussions.</p>
<h2>Creating Data Inline</h2>
<p>This is the situation as shown below</p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="kwrd">static</span> testMethod <span class="kwrd">void</span> testSomeSituation()</pre>
<pre><span class="lnum">   2:  </span>{</pre>
<pre><span class="lnum">   3:  </span>    <span class="rem">//Create some object for our test and assign a value</span></pre>
<pre><span class="lnum">   4:  </span>    MyObject testObject = <span class="kwrd">new</span> MyObject();</pre>
<pre><span class="lnum">   5:  </span>    testObject.someField1 = <span class="str">&quot;some value&quot;</span>;</pre>
<pre><span class="lnum">   6:  </span>    </pre>
<pre><span class="lnum">   7:  </span>    <span class="rem">//Not always necessary but for general case</span></pre>
<pre><span class="lnum">   8:  </span>    insert testObject;</pre>
<pre><span class="lnum">   9:  </span>&#160;</pre>
<pre><span class="lnum">  10:  </span>    <span class="rem">//Perform some assertions on the object</span></pre>
<pre><span class="lnum">  11:  </span>}</pre>
</div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
<p>The method creates its test data in lines 4 and 5 before inserting it into the database on line 8 where a trigger or validation rule will perform an action we wish to assert upon. The benefit of this way of performing test data creation is that it is quick and easy, we know any data created by code called during a test method gets automatically destroyed so it is safe to create data like this. However, as soon as we have another test method on this object or in this class using that object, we are likely to have duplicate code. This is evidently bad for when we update methods or objects in the future. This will be exacerbated in the situation where we have to create multiple objects (either related objects or for use in lists etc.) and become unwieldy.</p>
<h2>Extracting to a Method</h2>
<p>In this situation we extract the code on lines 3-8 to a method for reuse in the test class multiple times (see below):</p>
<div class="csharpcode">
<pre><span class="lnum">   1:  </span><span class="kwrd">private</span> <span class="kwrd">static</span> MyObject createTestObject()</pre>
<pre><span class="lnum">   2:  </span>{</pre>
<pre><span class="lnum">   3:  </span>    <span class="rem">//Create some object for our test and assign a value</span></pre>
<pre><span class="lnum">   4:  </span>    MyObject testObject = <span class="kwrd">new</span> MyObject();</pre>
<pre><span class="lnum">   5:  </span>    testObject.someField1 = <span class="str">&quot;some value&quot;</span>;</pre>
<pre><span class="lnum">   6:  </span>&#160;</pre>
<pre><span class="lnum">   7:  </span>    <span class="rem">//Not always necessary but for general case</span></pre>
<pre><span class="lnum">   8:  </span>    insert testObject;</pre>
<pre><span class="lnum">   9:  </span>&#160;</pre>
<pre><span class="lnum">  10:  </span>    <span class="kwrd">return</span> testObject;</pre>
<pre><span class="lnum">  11:  </span>}</pre>
<pre><span class="lnum">  12:  </span>&#160;</pre>
<pre><span class="lnum">  13:  </span><span class="kwrd">static</span> testMethod <span class="kwrd">void</span> testSomeSituation() </pre>
<pre><span class="lnum">  14:  </span>{</pre>
<pre><span class="lnum">  15:  </span>    <span class="rem">//Create an object for use</span></pre>
<pre><span class="lnum">  16:  </span>    MyObject testObject = createTestObject();</pre>
<pre><span class="lnum">  17:  </span>    </pre>
<pre><span class="lnum">  18:  </span>    <span class="rem">//Update the SObject for this test</span></pre>
<pre><span class="lnum">  19:  </span>    doSomething(testObject);</pre>
<pre><span class="lnum">  20:  </span>&#160;</pre>
<pre><span class="lnum">  21:  </span>    <span class="rem">//Perform some assertions on the SObject</span></pre>
<pre><span class="lnum">  22:  </span>    System.assertEquals(aValue,testObject.Field1);</pre>
<pre><span class="lnum">  23:  </span>}</pre>
<pre><span class="lnum">  24:  </span>&#160;</pre>
<pre><span class="lnum">  25:  </span><span class="kwrd">static</span> testMethod <span class="kwrd">void</span> testAnotherSituation() </pre>
<pre><span class="lnum">  26:  </span>{</pre>
<pre><span class="lnum">  27:  </span>    <span class="rem">//Create an object for use</span></pre>
<pre><span class="lnum">  28:  </span>    MyObject testObject = createTestObject();</pre>
<pre><span class="lnum">  29:  </span>    </pre>
<pre><span class="lnum">  30:  </span>    <span class="rem">//Update the SObject for this test</span></pre>
<pre><span class="lnum">  31:  </span>    doSomethingElse(testObject);</pre>
<pre><span class="lnum">  32:  </span>&#160;</pre>
<pre><span class="lnum">  33:  </span>    <span class="rem">//Perform some assertions on the SObject</span></pre>
<pre><span class="lnum">  34:  </span>    System.assertEquals(anotherValue,testObject.Field2);</pre>
<pre><span class="lnum">  35:  </span>}</pre>
</p></div>
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
</p>
<p>Here we have extracted the creation of the object for testing out to a separate method that is still within our test class. If we wish, we can create many other similar methods for other objects needing to be setup in this test class which will again give us more controlled and useful code. </p>
<p>I believe this to be the ideal situation for unit testing. The data required for any units of code under test is visible near to the code. It is clear as to what the actual test is doing and if the system is edited to alter the behaviour such that the tests fail, then the data is in a central place for updating this area of the codebase to get it working. It also allows any developers that are adding or updating code to the class under test to add new tests quickly and easily with the object needed. You are also adding the minimum amount of required data at all times which is important for speed. </p>
<p>Many will argue that having a centralised set of classes that handles all data creation is better (for integration testing I agree). Let’s discuss this.</p>
<h2></h2>
<h2>Test Data Factory</h2>
<p>In this situation we will have a test data factory class that we can call to create SObject instances for use in the tests. This system is the one described by Alex on his blog post.</p>
<p>On its positive side, this means that we have a single class (or set of classes) that we call in order to create some test data. If the system changes then we merely change the data once and this should update every test method where the data is used. It means that the same data is being used consistently across the entire test system as well which is helpful, and if written in a correct way, the data creation methods can be called to provide demo data for salespeople by calling the methods in the system.</p>
<p>The problems arise when we consider the following. Firstly, what happens when someone has two test cases where they needs the data slightly differently in each situation? We could setup the classes so the factory methods take in a series of parameters to create a personalised object, but this removes the power of having consistent data and also leaves us with hard to read code. This data must now also be closely regulated by the development team as any changes to it could have repercussions throughout the system’s unit tests. As the system grows in size and complexity, the factory can get very entangled and difficult to maintain for a series of small tests and can also lead to an increase in the time it takes to run tests. For example, we are writing a unit test that asserts whether a particular field value has been set properly. We do not need any related objects or other data created to perform this test, but it is more than likely that our test data creation methods will create surrounding data by default as it is being used throughout the system. For anyone wanting to go into the system and quickly create a test or update/add some functionality, they must then check the test factory is updated correctly and that this does not impact upon other areas of unit tests – developer flexibility is hampered as the data creation class becomes locked down and protected. In such large systems as well, and breaking of the test data class can cause all the unit tests to fail whether they are related or not as background data that is not needed fails to get created.</p>
<p>Having used this method of doing testing as well, you can find it leads to people writing tests without really understanding what they are doing and why they need it. It is good for a developer to write a unit test where they must set their data up for the test. That way they can know for definite what they have tested and be sure they are happy it works.</p>
<p>I personally employ this method, but use it for integration testing. If a change to the data can cause more that just the unit tests associated to that object to fail, you are not doing unit testing. Unit testing is about creating small piece of data to test small pieces of functionality so that if a change is made to a method, we can check it still works and acts as we expect it to. Having the test data being created in the test class (albeit in neatly extracted methods) allows us to know exactly what we are testing (and why). Having a full data creation factory is much more useful for integration testing as it can create a single set of data for use in testing the system or for use in demonstrations, but without interlinking the system to tightly. </p>
<hr />
<p>I would love to hear what people think. As I have said, these are personal preferences based upon many hours of writing and fixing tests and also having done testing in more mature languages such as C#.</p>
<p>An aside:</p>
<p>I had a friend who told me the biggest risk Salesforce had was that it is so accessible that non-developers often start writing code and it reminded him of the MS Access boom when many poorly written systems started to fall over as they had been written by people that were not thinking far enough ahead. I am not suggesting that anybody reading this post is like that or that Salesforce should become less accessible. I do however wonder whether we would have a Billion Lines of Apex still if had all been written by people who were pure developers. For another post however.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=73</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coming up on paulbattisson.com&#8230;.</title>
		<link>http://paulbattisson.com/?p=64</link>
		<comments>http://paulbattisson.com/?p=64#comments</comments>
		<pubDate>Sun, 17 Jul 2011 14:21:14 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Agile Practices]]></category>
		<category><![CDATA[Maths]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=64</guid>
		<description><![CDATA[So it has been a while since I have written anything on here. I feel terrible about this and really want to be writing more regularly and sharing some of the cool things that are going on with people. So what have I been doing all this time? My last post was in February and revolved around [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">So it has been a while since I have written anything on here. I feel terrible about this and really want to be writing more regularly and sharing some of the cool things that are going on with people.</p>
<p>So what have I been doing all this time? My last post was in February and revolved around some of the Force.com features that I had found most useful in team based development. I made a short presentation to the Agile Yorkshire user group based upon this post that was fairly well received.  In one of those interesting moments of hindsight I am getting now, I honestly don&#8217;t feel the presentation was really that good and if I were to do it again I would completely rewrite it, but the presentation did encourage a few people to look into Salesforce and that is good enough for me.</p>
<p>At work I have moved onto doing some iPad and mobile development which has been exciting, culminating in the recent release of DATASHELTER Mobile for Salesforce. I am now working on other exciting pieces and look forward to releases and launches of these for you guys to see.</p>
<p>There has been some slow emergence of some open source projects I am founding and co-founding for Salesforce developers and users. One of these will be based around the premise of improving the ease of learning Salesforce development for both non-developers and migrating developers. We saw recently<br />
with the hiring of Matsumoto-san that Salesforce is very keen to drive developers to its platforms and is aware that the strength of any platform offering comes in no small part from the way it interacts with and aids developers on it. A large reason that Microsoft were so dominant in the past 20 years is the way in which they looked after the developer community they had. We all remember Ballmer&#8217;s developer chant. It is evident that Apple and Android are destroying RIM and Nokia because their development platforms are easy to use. I think Salesforce realise this (and if they don&#8217;t they should soon) and as such want to try and help developers utilise the technologies they have in the best way possible. The hope is my little project can help this aim on its way.</p>
<p>Again, revolving around the world of work, we have started using the fantastic GitHub system and I have been given the enviable job of leading the roll out of this. I can honestly say I have never used a more consistently brilliant and quick system. [On an aside, I did try out the GitHub for Mac offering and its nice. It just din't do everything I wanted exactly as I wanted it to though and I did find myself grumbling at its speed and feedback occasionally. It will remain installed and updated, but only get used sporadically. The command line is much more fun anyway.] I have been coming up with a branching pattern and testing it to ensure it fits in with our development systems in the smoothest way possible and hope to start linking Git and Chatter together for our own internal reporting needs.</p>
<p>So I do plan on keeping this more up to date. I haven&#8217;t even mentioned the fact I have been playing with Ruby, looking into UX and Human Interface, getting back into some graphic design work and reading a lot into Agile development and complexity theory, Core Animation and re-reading the brilliant Pragmatic Programmer, Refactoring, Design Patterns and slowly working through The Art of Computer Programming. I have started looking at obtaining my DEV 501 status as well and whether I should renew my CSM, obtain a CSP or quit the Scrum Alliance all together.</p>
<p>So expect some hopefully exciting writings soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=64</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agile Development on the force.com platform&#8211;Some features</title>
		<link>http://paulbattisson.com/?p=60</link>
		<comments>http://paulbattisson.com/?p=60#comments</comments>
		<pubDate>Mon, 21 Feb 2011 14:17:02 +0000</pubDate>
		<dc:creator>paul</dc:creator>
				<category><![CDATA[Agile Practices]]></category>
		<category><![CDATA[Salesforce]]></category>

		<guid isPermaLink="false">http://paulbattisson.com/?p=60</guid>
		<description><![CDATA[For the past year I have been working on the Salesforce.com Force.com platform as a service (paas) and thought I would give an overview as to how it has held up in my experience as a platform for agile development methodologies (most notably Scrum). This will be mostly from a developer and scrum master’s perspective, [...]]]></description>
			<content:encoded><![CDATA[<p>For the past year I have been working on the Salesforce.com Force.com platform as a service (paas) and thought I would give an overview as to how it has held up in my experience as a platform for agile development methodologies (most notably Scrum). This will be mostly from a developer and scrum master’s perspective, but I will try to include views from other roles where possible.</p>
<h1>rapid application development</h1>
<p>To start developing on the Force.com platform, you simply signup for a free development org (which is an instance of their software in the cloud) and you are good to go. I generally attach Eclipse to my org using the plugin that Salesforce provide (you can download this bundled and redistributed as a standalone IDE but I play with other languages so like to be able to use one tool for the many tasks) but through the web interface there is a built in code editor.</p>
<p>Firstly, as you can imagine, this is an extremely quick and easy system to get setup and started on; I can have this all setup and be creating my first objects (analogous to tables in an RDBMS) for use in under 10 minutes – something that I think you will find hard to better elsewhere. This is the first plus point for Salesforce in terms of agile – it is extremely quick and easy so you can get started right away. Often teams tend to have a series of other admin tasks that they have to perform in order to get working, but with Salesforce, your effective “admin” time is zero. If you fancy seeing something amusing for 4 minutes look <a href="http://www.youtube.com/watch?v=VoP-sHJbvHE" target="_blank">here</a>. It sums the speed of Salesforce better than I ever could.</p>
<h1>Testing, testing, 1, 2…</h1>
<p>As a developer who likes to use agile practices, I try to work in a test (or sometimes behaviour) driven way to ensure that I am testing my code as I go. Another benefit of the platform is that in order to publish/package or use some code in production, it must have at least 1% test coverage and the entire code base must average at least 75% coverage! I have worked with a lot of developers before that seem to think (incorrectly) that testing is not an integral part of development, but on the Force.com platform you must do some unit testing. I have sadly seen cases where people have merely “exercised” their code by ensuring it is called in a test method, but as a general principal it serves to try and enforce the correct practices. (At the end of the day my 2 pence is that if you are going to have to write some test methods to cover the code, why not get it to do something useful and add an assert or two? Go on, you will thank me for it later. If you haven’t got proper unit tests you can never do any refactoring, only go changing code blindly.)</p>
<h1>Continuous integration</h1>
<p>In a previous life doing .Net development I had the pleasure of setting up a continuous integration system. Now I am actually not being sarcastic when I call it a “pleasure” because it was both a great learning exercise and also a magical tool. We could work on a copy of some work in .Net, ensure all our tests and code worked properly locally, then push them to our source control system where it would compile the entire system, run all the unit tests and other tests we had built around it (selenium etc.) and tell us either that everything was all good or that we had messed up somewhere and needed to fix it. This was all done really quickly and speedily and gave great instant feedback on what your code was doing to your overall code base and whether or not your product was always ready for deploying out to a customer (from a purely “it compiles and the code in there works” point of view, some functionality may not have been fully linked together just yet).</p>
<p>When working with the Force.com platform, if you are working on your own the “local copy” you are working on is actually just a copy of the files that are on and running on the cloud somewhere. If developing solo, this is fine as you can have your own source control system where you can deploy your changes from to a fresh org if you want to tests it is all okay. When working in a team it starts to become a little more tricky. Firstly you can’t always work in a single development org (I have worked in groups of 5 or so in a single org and you can nearly guarantee that you will either blow the request limit for a 24 hour period or that someone will be waiting relying upon changes from someone else etc.). The maximum number of developers that can sensibly work in an org is about 3 or 4 if they are working on mutually exclusive tasks, otherwise it becomes a bit more complicated. Often it is easier to work in separate development environments, then merge your changes into a single source control system together. My preferred method is to have the developers agree to deploy the package with the latest code after having committed code to the system. They just simply take a build token to signify nobody should make changes and the job is easy. It is also work setting up a nightly build where the latest code is deployed and tested (through both unit testing and selenium testing). Salesforce provide a great metadata tool to do the deployment and some simple ant scripting gets it all going nicely.</p>
<h1>release early, release often</h1>
<p>One of the basic principals of any agile development setup is that at the end of an iteration a release with as few a number of bugs as possible (see testing above!) should be available. Again Salesforce have got this covered by allowing you to create packages and now change sets that allow you to make releases available after each iteration. The ideal situation for a team developing a project on the Force.com platform would be to create a beta managed package at the end of each iteration which can be used for user testing, demos and also as a snapshot of where the system is. I have worked with teams and seen situations where development is still on-going on the last day of an iteration, and there is no visible release made internally (or even made at all) in the code base. By having the pressure (for want of a better word) or creating a managed package (75% code coverage and all) you focus on finishing stories/tasks/work and make sure that it is properly done. If you fail to make the cut you have failed to do the work properly. It is a very hard lesson to have to enforce (“but we were so close, honestly it is only an hour or so away from being finished…..”) but if enforced properly you will find your team getting more done of higher quality because the right system is in place. Continuous integration (as discussed above) helps to make this happen. This way you can also ensure that when you tell someone that a release is going to be on a certain date, you can make sure it is.</p>
<h1>Logical separation</h1>
<p>Salesforce enforces an MVC architecture when using Visualforce (its page mark-up language) and Apex in a controller. There are also triggers which handle work done on or with an object before and after update/insert/delete (validation, creation of related objects etc.) There are also components that can be created by a developer in order to reuse pieces of work. More recently as the Salesforce governor limits have started to be relaxed further and further, more traditional design patterns (such as those by the GOF or Martin Fowler) can be implemented alongside the newer patterns that have been developed for working on the platform. These combine to make it very easy and logical to separate out your code into correctly structured layers and provide yourself with patterns for use in the future. There is even dynamic apex to help further this extensibility in providing correct layer structure for your code. Add onto this you don’t have to do anything with a database (as it is already there and provides you with a large portion of your object structures) then correct layering and code practices are hard not to do.</p>
<h1>Summary</h1>
<p>Hopefully this somewhat brief and not fully comprehensive post has helped you to see some of the awesome features that Salesforce have setup in order to help you become a better developer and help you develop in an agile manner. Please feel free to post comments or suggestions for additions and I may either add them or create an entire new post to entail all those things I forgot.</p>
]]></content:encoded>
			<wfw:commentRss>http://paulbattisson.com/?feed=rss2&#038;p=60</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
