PHP MVC Object Orientation

0

I have 4 tables in the database:
Admin - Teacher - Class - Student
and my question is:

I would have to create:

AdminModel.class.php
ProfessorModel.class.php
TurmaModel.class.php
StudentModel.class.php

AdminView.class.php
ProfessorView.class.php
TurmaView.class.php
AlunoView.class.php

AdminController.class.php
ProfessorController.class.php
TurmaController.class.php
AlunoController.class.php

    
asked by anonymous 08.09.2015 / 04:27

1 answer

3

Yes , as I replied here .

In your case, all of these are independent, there is no relationship between them.

Teacher is a trait, as well as student, and admin. Class is a context.

  • The teacher can be a student, as well as an admin, so it should have these attributes.
  • The student alone can only be admin (it may occur, it will depend on your case).
  • The class has teacher, and students, so it should have these attributes.
  • Admin does not add anything beyond control, so there is no relationship.

Completing

None of these classes are extends , unless you create Pessoa , then yes Teacher and student will inherit Person.

    
08.09.2015 / 05:18