Is there a standard term for a class that contains only data, not logic?

I am looking for a standard way to communicate with another programmer that the class is essentially just a data container.

Take this simple class User, for example:

class User
{
    public string userName { get; set; }
    public string passPhrase { get; set; }
    public Role role { get; set; }
}

"This component uses the User class, which is just a class (insert here).

I want to say “data model”, but I think it is too broad. Classes described as data models often have logic.

+3
source share
11 answers

Sometimes they are called DTO - data transfer objects.

+9
source

POD - Plain Old Data

+6
source

: struct?

+3

" Value" , " ". value ; - . "Bean" , Java.

+2

POXO - X, X - . , #, POCO: #.

+1

Java / bean POJO ( Java)

+1

, DTO.

+1

, . , "" .

Value , , (, ), , , . Value .

, .

+1

, "Info" , , . User UserInfo.

UserData , " - " .

+1

Haskell

", , , .

0

, , DTO

0

Source: https://habr.com/ru/post/1717976/


All Articles