I had a quick idea to resort the modules below Coocook::Controller. Please review: Primarily is that an enhancement? Technical review might not be that important because tests pass and I am pretty sure it’s complete. Please see below for open question.
The thing is our controllers which handle project-specific data were spread all over the controller namespace. Some of them would chain from /project/base and others not.
In classic Catalyst logic we have Project.pm and Project/ with submodules next to each other. This is all project-specific.
Then the are the Browse modules like I named them. There are not about 1 project but exploring all Coocook data. That is:
browse all public/visible recipes
show all projects, import them
Current state of this PR
├── Browse
│ ├── Project.pm
│ └── Recipe.pm
├── Project
│ ├── Article.pm
│ ├── ...
├── Project.pm # does this belong to Browse or to Project??
Solution 0: Project::Project controller
That name reads like a mistake.
Solution 1: Root controller
This is also what Catalyst does for the application’s main controller MyApp::Controller::Root.
├── Browse
│ ├── Project.pm
│ └── Recipe.pm
├── Project
│ ├── Root.pm # what has been Controller/Project.pm
│ ├── Article.pm
│ ├── ...
Solution 2: explicit namespace for project-specific controllers
├── Browse
│ ├── Project.pm
│ └── Recipe.pm
├── PerProject # notice new name!
│ ├── Project.pm # what has been Controller/Project.pm
│ ├── Article.pm
│ ├── ...
Optional next step: dissolve Controller::Browse namespace
Did you ever dislike the Browse namespace? It’s pretty generic and POST actions are not like “browsing”.
├── PerProject # or similar, see options above
│ ├── Project.pm
│ ├── Article.pm
│ ├── ...
├── Project.pm # what was Browse::Project
├── Recipe.pm # what was Browse::Recipe
I had a quick idea to resort the modules below Coocook::Controller. Please review: Primarily is that an enhancement? Technical review might not be that important because tests pass and I am pretty sure it’s complete. Please see below for open question.
The thing is our controllers which handle project-specific data were spread all over the controller namespace. Some of them would chain from
/project/base
and others not.Before
Can you spot the project-specific controllers?
After
Open question
In classic Catalyst logic we have
Project.pm
andProject/
with submodules next to each other. This is all project-specific.Then the are the
Browse
modules like I named them. There are not about 1 project but exploring all Coocook data. That is:Current state of this PR
Solution 0:Project::Project
controllerThat name reads like a mistake.
Solution 1:
Root
controllerThis is also what Catalyst does for the application’s main controller
MyApp::Controller::Root
.Solution 2: explicit namespace for project-specific controllers
Optional next step: dissolve
Controller::Browse
namespaceDid you ever dislike the
Browse
namespace? It’s pretty generic andPOST
actions are not like “browsing”.