Derive class from object