3 deleted 10 characters in body
source | link

I see a lot of classes that look like:

class Student extends Model {
    public string major;
    public string minor;
}

class Employee extends Model {
    public string department;
    public string building;
}

These kind of classes are mostly used to hold data. My question is, should these aliases for Model class exist just because they have different properties? At most, the differences between them are accessors. Are these kinds of classes good or bad? Why don't I see more of:

student = Model::fromArray(['major' => 'a', 'minor' => 'i']);
employee = Model::fromArray(['department' => 'd', 'building' => 'b']);

edit

This is more about style rather than specific application. I see that when it comes to presentation/view, people don't care much about types, a lot of time data is passed as arrays to template subsystem and don't create Presentation Models.

Data Transfer Objects also don't have behaviours and I get some answer from this article LocalDTO about why DTO shouldn't be used locally (only for type checking?). I'm looking for more general case on when to use (or not) these behaviour less classes.

I see a lot of classes that look like:

class Student extends Model {
    public string major;
    public string minor;
}

class Employee extends Model {
    public string department;
    public string building;
}

These kind of classes are mostly used to hold data. My question is, should these aliases for Model class exist just because they have different properties? At most, the differences between them are accessors. Are these kinds of classes good or bad? Why don't I see more of:

student = Model::fromArray(['major' => 'a', 'minor' => 'i']);
employee = Model::fromArray(['department' => 'd', 'building' => 'b']);

edit

This is more about style rather than specific application. I see that when it comes to presentation/view, people don't care much about types, a lot of time data is passed as arrays to template subsystem and don't create Presentation Models.

Data Transfer Objects also don't have behaviours and I get some answer from this article LocalDTO about why DTO shouldn't be used locally (only for type checking?). I'm looking for more general case on when to use (or not) these behaviour less classes.

I see a lot of classes that look like:

class Student extends Model {
    public string major;
    public string minor;
}

class Employee extends Model {
    public string department;
    public string building;
}

These kind of classes are mostly used to hold data. My question is, should these aliases for Model class exist just because they have different properties? At most, the differences between them are accessors. Are these kinds of classes good or bad? Why don't I see more of:

student = Model::fromArray(['major' => 'a', 'minor' => 'i']);
employee = Model::fromArray(['department' => 'd', 'building' => 'b']);

This is more about style rather than specific application. I see that when it comes to presentation/view, people don't care much about types, a lot of time data is passed as arrays to template subsystem and don't create Presentation Models.

Data Transfer Objects also don't have behaviours and I get some answer from this article LocalDTO about why DTO shouldn't be used locally (only for type checking?). I'm looking for more general case on when to use (or not) these behaviour less classes.

2 clarify what is I'm asking
source | link

I see a lot of classes that look like:

class Student extends Model {
    public string major;
    public string minor;
}

class Employee extends Model {
    public string department;
    public string building;
}

These kind of classes are mostly used to hold data. My question is, should these aliases for Model class exist just because they have different properties? At most, the differences between them are accessors. Are these kinds of classes good or bad? Why don't I see more of:

student = Model::fromArray(['major' => 'a', 'minor' => 'i']);
employee = Model::fromArray(['department' => 'd', 'building' => 'b']);

edit

This is more about style rather than specific application. I see that when it comes to presentation/view, people don't care much about types, a lot of time data is passed as arrays to template subsystem and don't create Presentation Models.

Data Transfer Objects also don't have behaviours and I get some answer from this article LocalDTO about why DTO shouldn't be used locally (only for type checking?). I'm looking for more general case on when to use (or not) these behaviour less classes.

I see a lot of classes that look like:

class Student extends Model {
    public string major;
    public string minor;
}

class Employee extends Model {
    public string department;
    public string building;
}

These kind of classes are mostly used to hold data. My question is, should these aliases for Model class exist just because they have different properties? At most, the differences between them are accessors. Are these kinds of classes good or bad? Why don't I see more of:

student = Model::fromArray(['major' => 'a', 'minor' => 'i']);
employee = Model::fromArray(['department' => 'd', 'building' => 'b']);

I see a lot of classes that look like:

class Student extends Model {
    public string major;
    public string minor;
}

class Employee extends Model {
    public string department;
    public string building;
}

These kind of classes are mostly used to hold data. My question is, should these aliases for Model class exist just because they have different properties? At most, the differences between them are accessors. Are these kinds of classes good or bad? Why don't I see more of:

student = Model::fromArray(['major' => 'a', 'minor' => 'i']);
employee = Model::fromArray(['department' => 'd', 'building' => 'b']);

edit

This is more about style rather than specific application. I see that when it comes to presentation/view, people don't care much about types, a lot of time data is passed as arrays to template subsystem and don't create Presentation Models.

Data Transfer Objects also don't have behaviours and I get some answer from this article LocalDTO about why DTO shouldn't be used locally (only for type checking?). I'm looking for more general case on when to use (or not) these behaviour less classes.

1
source | link

Should objects with different properties (not behaviour) have different types?

I see a lot of classes that look like:

class Student extends Model {
    public string major;
    public string minor;
}

class Employee extends Model {
    public string department;
    public string building;
}

These kind of classes are mostly used to hold data. My question is, should these aliases for Model class exist just because they have different properties? At most, the differences between them are accessors. Are these kinds of classes good or bad? Why don't I see more of:

student = Model::fromArray(['major' => 'a', 'minor' => 'i']);
employee = Model::fromArray(['department' => 'd', 'building' => 'b']);