The arrival of Winter ’12 brings with it the long awaited feature, by me at least, native JSON support.  This is a massive plus for the platform and it’s ability to support further integration with external systems – something which is key to the survival of any cloud based platform in this day and age.

Whilst being fantastic news for the platform, it does sound the death knell for my sobject-serialization project over on GitHub.  The project started out life as a way to pass sobjects to @future methods by serializing them into a string and then rehydrating them within the @future method.  I started by using solely the string.valueOf method to serialize the sobject then added primitive JSON like capabilities.  Most recently I was expanding it to also allow you to pass primitive types and lists using the same methods.  However, the in built JSON support will allow you to do this without having to make use of my classes and hence your script statements and associated governor limits!

The best thing is it’s all really easy to do, just look at this overly simple self contained example:

public class PassToFuture{
    public void PassAnAccount(){
        Account a = new Account(name = 'Simon');
        String s = JSON.serialize(a);
        MyFutureMethod(s);
    }
    @future(callout=false)
    public static void MyFutureMethod(string accountString){
        Account a = (Account)JSON.deserialize(accountString, Account.class);
    }
}

Given that this is so easy, I really can’t see the point in continuing to develop my project. It will reamin on GitHub for anyone to do with as they please; I however will probably not be putting too much effort into pushing it forward.

And that is that – I have some more Winter ’12 thoughts to come especially around public test classes but I’ll save those for another day.