Answer the question
In order to leave comments, you need to log in
Do I need to separate add and output classes?
Hello!
Once I was told that each entity should have its own class (as far as I understood one) ...
It turns out that one class should be used to add and remove a user from the database, or should they be split somehow?
Say, when getting a user, as far as I understand, I need to make sure that the user model always returns the same object (User) to me.
But if we create a user, then the properties of the class may not match those that were at the output ...
Please explain ... I can not understand the structure ....
Answer the question
In order to leave comments, you need to log in
You have a class "User".
As a rule, 1 class is 1 database table, task, etc.
A class has properties and methods. For example: add, remove, get a list.
But if we create a user, then the properties of the class may not match those that were at the output ...
Please explain ... I can not understand the structure ....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question