Generating class definitions from data declarations