Is this class a data model?

class Record { int id = 0; String name = ""; String telephone = ""; public String getName() { return this.name; } public void setName(String name) { this.name = name; } public String getTelephone() { return this.telephone; } public void setTelephone(String telephone) { this.telephone = telephone; } public int getID() { return id; } } 

    3 answers 3

    Well, in general, yes, this is a data model in a rather general sense ... To complete the picture, the designer would add, declare all members private.

    Some, however, understand by the data model the display of data in the database - and even by observing the Boyes-Codd theorem on data normality, well, let's not find fault with it. Yes, this is a data model presented using plain JavaBeans.

      It all depends on how you define the term "data model". According to one of the definitions, “the result of displaying the essence of the subject domain in terms of the data of a development tool is called a data model”. If your code reflects the essence of the domain, then this is a data model, if not - no.

        If all the data is a name and phone number, then you can.