1. A method of providing multi-instantiable state templates to a statechart environment, comprising: providing a graphical definition of an independent state machine object belonging to a statechart, the providing performed using a computer; instantiating a first instance and second instance of the independent state machine object in the statechart, the first instance and the second instance each containing a variable, the instantiating performed using the computer; identifying that a memory location is sharable between the variable of the first instance and the variable of the second instance, the identifying performed using the computer; and generating code automatically for the first instance and the second instance of the independent state machine object based on the identifying, the generating performed using the computer.