Tag Archives: Best Practices

De-mystifying & optimizing view state

HTTP is a stateless protocol.  Your Visualforce pages though may need to maintain state across multiple HTTP requests / postbacks.  Visualforce automatically does this for you with view state making your job as a developer easier.  Find out more about what is in view state, the new view state inspector in Summer '10 and best practices for optimizing view state for page performance in this article … Continue reading

Quiz – how can you have 100% test coverage in Sandbox and 0% in production?

Answer – if your test suite is not self contained i.e. it depends on specific data in Sandbox.

I got a call from one of our customers today about not being able to deploy into their production org due to inadequate test coverage even though they were getting 100% coverage in their development sandbox.  Our support tracked it down to hard coded test methods.  If your test methods depend on specific data in an org and you move such a test method to a different org, it will fail.

Here is an example where the record Id is hardcoded…..

A hog in armour is still but a hog

There are two distinct approaches that the industry has taken towards platform as a service (PaaS).  The first approach is offering an integrated and vastly simplified programming model in the cloud.  This provides all the infrastructural benefits of Cloud Computing like multi-tenancy, automatic upgrades & elastic infrastructure PLUS it speeds up application development considerably.  Force.com is representative of this approach. I would also encourage you to checkout Mike Kreaden and Peter Coffee's blogs.  Mike relates Force.com to 4GL environment and Peter refers to three independent studies which quantify the productivity improvements of developing on Force.com – one study found a… Continue reading

Partitioning your data with Divisions for usability & performance

Data partitioning is a database technique commonly used to improve performance and manageability.  Salesforce provides a feature called Divisions that lets you partition your records into logical sections. As an example, you can divide your customer records based on their geographical location by creating divisions called US, EMEA and APAC.  The users in these regions can then be enabled to use these division. One of the benefits of doing so would be that division specific searches and division specific list views will provide them with data that is most relevant to them.  The other potential benefit is performance.  I was… Continue reading

Your project on CruiseControl

Over time the software development community has developed several best practices to make the development process more predictable. Many of these best practices are relevant for Force.com development as well. The tools provided with Force.com make it fairly
easy to integrate these best practices into your development methodology. One such best practice is the idea of continuous integration – integrating the code developed by various developers on a regular basis vs. trying to cram it in before the release.  In this article I describe how you can use CruiseControl, an open source tool to automate continuous integration for your Force.com project. 

Let… Continue reading

Using a version control system with Force.com

The Development as a Service (DaaS) suite of features with Force.com allows integration with existing software tools to facilitate easy development and deployment of applications in the cloud.  In this tutorial , I go through the use of Subversion a free, open source version control system to facilitate team development on Force.com.  Since a version control system can keep track of every change you make to files under its control (who, what and when) it is invaluable when you want to go back to a particular state or just try to figure out how the system evolved.  I strongly recommend… Continue reading