Salesforce Developers Blog

From the Wiki: Apex Design Patterns and Other Tips

Avatar for Josh BirkJosh Birk
We’ve had a few new articles hit the wiki recently which highlight very technical aspects of Apex. Apex is a very flexible language that can accomplish quite a bit with only a few lines of code – but that ability means that developers often don’t have a lot of experience that leads up to architecting large applications on the platform. Here are some words of wisdom which can help an Apex developer navigate some of the issues when creating more complex applications.
October 02, 2013
Listen to this article
0:00 / 0:00

We’ve had a few new articles hit the wiki recently which highlight very technical aspects of Apex.  Apex is a very flexible language that can accomplish quite a bit with only a few lines of code – but that ability means that developers often don’t have a lot of experience that leads up to architecting large applications on the platform.  Here are some words of wisdom which can help an Apex developer navigate some of the issues when creating more complex applications.

Apex Enterprise Design Patterns

FinancialForce.com is no stranger to creating large, complex, powerful Force.com applications and in this series of articles, Andrew Fawcett will walk you through some of the design patterns they have used in Apex to keep these applications sane.  It’s an important look into how Apex can go from being a single class that controls a Visualforce page to a language capable of maintaining an entire modern web application.  There are four articles, which walk you through the various parts of a design model called Separation of Concerns, of which these three design patterns were originally defined by the accomplished software consultant and speaker Martin Fowler:

Also check out this wiki article on Apex Design Patterns from a Dreamforce 2012 session.

 Application Performance Profiling in Force.com

Once you’ve got your application designed and are on the way to coding and implementation, you’ll want to keep an eye on performance.  Simple interfaces and application logic usually run as expected, but as you crank the complexity you are also potentially going to open yourself up to bottlenecks and slowdowns.  Right from your browser, via the Developer Console, Force.com has tools to help you debug your code and see where things are speedy and things are not.

Read all about in Daisuke Kawamoto‘s excellent wiki article A Guide to Application Performance Profiling in Force.com – which will walk you through how to use the Developer Console to pinpoint issues in both Apex and Visualforce.

Creating a Spreadsheet with Apex and Visualforce

Here is smaller, simpler concept – how to create spreadsheet like functionality on a Visualforce page … but the design is a good reminder that you can accomplish a relatively complex interface with an equally simple design.  Riezel Ramos develops prototypes here at Salesforce.com and this article walks you through the basics and links to a package you can install to try out the code yourself.

So there you go – lots of reading material for your Apex benefit.  Always keep an eye on developer.force.com for more feature articles, and if you’ve got any ideas or suggestions for new material – feel free to add them to the boxes below, or catch me on twitter.

Get the latest Salesforce Developer blog posts and podcast episodes via Slack or RSS.

Add to Slack Subscribe to RSS

More Blog Posts

A Deep Dive into Winter '24 Apex Enhancements

A Deep Dive into Winter '24 Apex Enhancements

The Winter '24 release of the Salesforce Platform has brought significant improvements for Apex developers.November 14, 2023

Using Prompt Builder, Flows, and Apex to Summarize and Classify Cases Faster

Using Prompt Builder, Flows, and Apex to Summarize and Classify Cases Faster

With the power of large language models and Prompt Builder, you can classify and summarize standard or custom Salesforce objects easily.June 11, 2024

How to Query Data Cloud from Any Salesforce Org with Apex

How to Query Data Cloud from Any Salesforce Org with Apex

By using next-gen credentials in combination with Apex, you can realize the most complex business cases regarding querying data in a highly flexible and secure way.September 10, 2024