I’ll be presenting two sessions at Dreamforce this year:
Apex Unit Testing in the Real World
(Tuesday 1-1:30 Moscone West 2006)
Do you follow all of the best practices for unit testing described in the Apex language documentation? Probably not. Should you? The answer may surprise you. Unit tests in the real world serve many different purposes, and each purpose calls for different types of tests, and different testing design patterns. In this session you’ll learn about different types of unit tests, and how approaches vary depending on the type of application, and the specific testing goal. You’ll see how testing strategies change dramatically depending on whether you are writing code for a specific organization or for a managed package.
Apex Nirvana – Embracing Governor Limits
(Wednesday 4:30-5:00 Moscone West 2002/2004)
For many Apex developers, especially those coming from other languages, Apex governor limits can sometimes be challenging to understand and code against. But it doesn’t have to be that way. In this session you’ll learn to embrace limits, to factor them into every design you create, and how to trade off one against the other. You’ll find what the experts know – that governor limits help you to write better and more efficient code, that today’s limits already support large and complex operations, and that even when they don’t – there are usually ways to work around the issue to accomplish virtually any task.
Forgive me if you talk about this in later stages of the book, but when you pass trigger processing to a separate class, do you still have access to the trigger properties such as .isBefore()/.isAfter() and .isInsert()/.isUpdate(), or do you have to control that by calling different methods in the receiving class?
You can’t actually pass the “trigger” object directly to the class. But you do have a number of options to pass the information to the class:
For simple applications, I tend to use the first or fourth. When implementing a framework as part of a larger application, I tend to use the third option and allow the framework to decide which methods to call.