2
votes

The definition of DTO from Wikipedia is the following:

Data transfer object (DTO) is an object that carries data between processes. The difference between data transfer objects and business objects or data access objects is that a DTO does not have any behavior except for storage and retrieval of its own data (accessors and mutators). DTOs are simple objects that should not contain any business logic that would require testing.

If, instead, the class containing the Data is not used for data transfer and has also the methods for CRUD operation which should be the acronym of that kind of class?

1
"Bad design". It validates the SOLID principle. I would call the term of Wikipedia broken in this regard. DTO's are transfer objects and should not have storage and retrieval behavior. THat is what a repository is for. - TomTom
TightlyCoupled or DoNotDoThis class ? - user2711965
@TomTom: But there isn't a name for this kind of Design? I've also edited the question. Now it's more clear - Revious
@Revious "YouArefiredDtoPattern". Good enough? DTO's are transfer objects, they should not contain any access logic. - TomTom
"which should be the acronym of that kind of class" SMH? OMG? DTM (DoingTooMuch)? - D Stanley

1 Answers

2
votes

It's called Active Records.

And it's indeed a very bad idea using it, as explained about everywhere.