Adam Purkiss is the Principal Architect at MondayCall Solutions in San Francisco. He spends most of his time designing and developing software in Apex and Visualforce and has been deeply involved in the Force.com community since 2008.
Test Design Patterns Welcome to part two of Force. com Design Patterns. In this first module, we're going to talk about various aspects of testing, monitoring, and debugging in Apex. As you probably know by now, unit tests are required in Apex and nothing less than 75% coverage is needed for your code to be deployed to production. So, writing unit tests gets a lot of attention. Not just because good tests are a good thing in general, but because they're not even optional. So we'll cover the process of writing effective tests in Apex, including the use of some of the latest features on the platform. And finally, we'll take a look at some helpful Apex design patterns that give you added control of your test executions, while also improving your visibility of problems when they arise.
Flow Factory Design Pattern This final module of Force. com Design Patterns Part Two is dedicated to a hyper design pattern I came up with, in part out of necessity and also to produce more elegant code for dealing with flowchart style business logic, but the catalyst for designing this pattern was a response to one of the more challenging areas of Force. com development, namely managing more than one callout in a single execution context as part of a greater aggregate transaction, but regardless of callouts, Flow Factory organizes the business logic of a conceptual flow chart by leveraging both the strategy and the factory method design patterns in Apex, while adding a few twists of its own.