Comment
Comment by ubertaco
An approach I've seen is to have each class extend from some abstract base class (I know, OO blech) that looks like this:
That gives you the "magic" just by extending the base, while also allowing custom behavior for a given class (by overriding updateFromJSON).