For that I prefer the ActionScript3.0 solution: methods that imitate attributes.
You replace
public var myAttribute:int;
with
public function get myAttribute():int;
The caller uses both with the same "object.myAttribute", so you can just replace one with the other when the need arrives, without changing any other code.
This allows you to use all sort of syntactic sugar ("object.myAttribute++", "+=" and other assignments), and for dynamic languages you can get and set values just from a reference to the object and the attribute's name. This last part is invaluable for animation engines.
You replace
with The caller uses both with the same "object.myAttribute", so you can just replace one with the other when the need arrives, without changing any other code.This allows you to use all sort of syntactic sugar ("object.myAttribute++", "+=" and other assignments), and for dynamic languages you can get and set values just from a reference to the object and the attribute's name. This last part is invaluable for animation engines.