autogen code: factory-method GoF