automatically generate code for draw objects
use decorator for drawobject