Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is "dumb data" and "dumb data object" mean?

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)?

like image 268
ggrr Avatar asked Jan 28 '26 14:01

ggrr


1 Answers

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.

like image 143
Sam Holder Avatar answered Jan 30 '26 05:01

Sam Holder