2

Sometimes I saw some people use "dumb data" or "dumb data object" to describe something, but I am not clear about the definition of "dumb data".

Is dumb data mean some member in object that does not used by the object itself, but for others that use the object?

eg:

class Process{
public:
    int parentProcessId;
    //other property
};

int main(){
    Process p1;
    int p1Id=p1.getParentProcessId();
    Process p2=Process.getProcessPyId(p1Id);
    return 0;
};

and is "dumb data object" means all properties in objects are used to store values only (for example: object that map columns from sql)?

ggrr
  • 7,737
  • 5
  • 31
  • 53
  • 1
    "all properties in objects are used to store values only" - Yes. It is a collection of data, with no attached behaviour, except for simple accessors. Might as well be a `struct`. – Amadan Oct 05 '15 at 09:12
  • See also: [What are POD types in C++?](https://stackoverflow.com/questions/146452/what-are-pod-types-in-c) Dumb data objects are POD objects, although the terms are not quite synonyms, as there are also other PODs than objects. – Boann Oct 06 '15 at 05:41

1 Answers1

1

As mentioned in the comments, a 'dumb data object' is an object which contains no behaviour, only data. Often also referred to as Data transfer objects (DTO)

They have no methods or constructors.

These objects can be serialized and then deserialized between different languages and retain the same information. If they contained behaviour this behaviour would need to be created in both language representations of the object as behaviour cannot be serialised, only the data.

Sam Holder
  • 32,535
  • 13
  • 101
  • 181