building classes on the schema's inheritance model