We are designing a web API to transfer objects obtained from a database to a client application which is a front end GUI. The server side business logic will be implemented (for better or worse) in stored procs.
To minimize the size of transferred objects, integer ids will sent in the case that an object references another object only the id is sent so for example a customer record might consist of customer_id, name, address and company_id and there would be a separate method to send companies which might be represented by company_id, name.
So the client will have a set of minimal DTO objects with just data fields with no object references. My question is whether it is usual to take these objects and then use them to build richer objects which hold references to other objects? Additional business functionality may also be added to these object.
So for example a Customer object would hold a reference to a Company object. This would mean having two versions of each type of object. One which is a DTO and one which is I guess is a business object.
Or, would it make sense to just have one type of object which has everything, with id and reference fields which are populated after all objects are pulled down from the web service?