I have a user
feature. user
feature also has other subfeatures user application details
and user contact information
.
Usually, because application details
and contact information
are part of user
feature, we are dealing with one-to-one relation, I would put application details
and contact information
within user
folder on the system. I see those two as an extension of the user
feature.
So we would have a structure similar to:
- app/Models/User.php
- app/Models/User/ApplicationDetail.php
- app/Models/User/ContactInformation.php
- app/Services/User.php
- app/Services/User/ApplicationDetail.php
- app/Services/User/ContactInformation.php
I had one individual put forward an idea that we should think of user application details
and user contact information
as individual services (features_, due to which both of them can and should be located in the main folder and regarded us features of their own.
So we would have a structure similar to:
- app/Models/User.php
- app/Models/UserApplicationDetail.php
- app/Models/UserContactInformation.php
- app/Services/User.php
- app/Services/UserApplicationDetail.php
- app/Services/UserContactInformation.php
This seems like a very silly thing to ask on here, but I am trying to give this individual a chance and hence I am trying to evaluate the benefit of what was put forward. However, from my experience, we will end up with a folder that has too many files, which may feel very overwhelming even for those who know how the system is structured.
app/users/*, app/users/services/*
. Take a look to the next question