Tycodra / API_Playground

0 stars 0 forks source link

Organize Classes into Logical Directories #3

Open brandonwardell20 opened 1 month ago

brandonwardell20 commented 1 month ago

-Create logical directories such as model, service, repository, controller. This could be done by entity, or by structure. Either organize by user, and have the user service, repo, and controller in one directory, or by concept. All controllers in one directory, all services in another directory, ect.

Tycodra commented 2 weeks ago

What makes sense to me is to order by structure because I think in terms of like functionality. This way is only slightly more annoying when you decide to remove an entire entity type as you need to go find all of its pieces as opposed to removing a directory. What have you seen to be the favored method of organization in industry? Do you view any pros or cons between them? If there is going to be some measure of inheritance, as we have discussed as a possibility, it makes me think even more that it is better to organize by structure.

brandonwardell20 commented 2 weeks ago

My experience is this is only developer preference. No best practice besides it needs to be organized!