The Silver Lining

Lessons & Learnings from a salesforce certified technical architect.

Archive for August 2009

Lists of SObjects and Classes – By value or reference?

with 3 comments

I found a quirky bug in my code some time back, and realised that the cause of the bug was quite a useful Apex feature viz. SObjects and Apex classes are passed by reference and not value.

What does this mean you say? Let’s start by defining what passing by value means.

In a nutshell, if you pass a variable to a method and it’s a primitive type(Integer, String etc.) it will be passed by value meaning that the value of the variable and not the variable itself is passed to the method Read the rest of this entry »

Written by Wes

August 3, 2009 at 12:48 pm

%d bloggers like this: