By monolith I mean a full stack MVC (Model-View-Controller) application.
For example, in Ruby on Rails (RoR), the code is organised by (category?, I don't know the right technical term for it) what part it plays under MVC. For example, all models go under one folder, all controllers under one and same for the views. It looks like this...
app/
├── controllers/
| ├── posts_controller.rb
| └── ...
├── models/
| ├── post.rb
| └── ...
└── views/
├── posts/
└── ...
I've been working with this in Rails and I've noticed that as the project gets larger and larger, you have to hop around a lot between folders. For example, if I'm working on the Posts
module, I'll need to make some change in the model, then open the controllers folder, search for the posts_controller
and then go do something in the views folder. It becomes quite cumbersome to deal with.
I think what better suits my workflow, would be to have a folder for the Posts
module and have its model, view and controller inside it. Like, so...
Posts/
├── controller.rb
├── model.rb
└── views/
Which way do you prefer?
Of course the second one. Things which are changing together should be keep together.