Imagine you wake up and get up to brush your teeth. You go to the "brooms and brushes" room to get your toothbrush. Then, you go to the "cleaning p...
For further actions, you may consider blocking this person and/or reporting abuse
Fantastic! However, this should be paired with a well-tempered inheritance structure, so you're not repeating yourself unnecessarily. You may have seventeen types of lamp in your house, but they all implement the same common wiring and structure.
There are also some things that should be shared among rooms, such as
electricity
,plumbing
, and so forth. No point recreating the entire electrical system for each individual room...that would just make it hard to maintain the system! Implement the common system instead.prefer composition over inheritance - extracting non-legit abstractions is coupling your modules without bringing much benefit.
A very important yet undervalued principle π.
Are There Any Frameworks That Take Advantage Of This Or A Similar Structure?
The Masonite python framework is very similar to this structure.
Angular 1 has "folders-by-feature" in its guidelines. github.com/johnpapa/angular-styleg...
Also newer Angular versions have the same recommendations. angular.io/guide/styleguide#folder...
I have a basic crud application plus SPA with export functionalities in flask and it's almost stupid how many files you have to modify to add a single field editable by the user: the migration that modifies the db (auto-generated by the changes in the model but still...), the model itself, the server side validation forms, the server side tests, the REST API sending data to the frontend so that the user can store info in the new field, the frontend code receiving the data, the UI, the frontend tests and the export API needs to know about the new field.
The app has so little logic that I feel it's not worth refactoring to abstract a lot of this stuff but everytime the client wants a new field I have to go through the same scattered modifications.
Yes, yes, and yes.
Just to pursue the topic, here is an article about that domain-oriented code folders with React: marmelab.com/blog/2015/12/17/react...
It works very well for us.
Awesome post. You definitely had me hooked from the opening metaphor.
Nice article, thanks for sharing :)
Here's another advocate :)
K. Scott Allen on feature folders
8thlight.com/blog/uncle-bob/2011/0...
Very good, congratulations! My dad was an architect so your metaphor makes even more sense. :)
Amazing opening paragraph. This kind of question always comes to my head when structuring an app or a project and I never know what makes more sense. Thank you!
It is an absolute blessing when I don't have to ctrl + shift + f to find all implementations of a given function.
Great post Frederik! Keep up the great work.
Reminds me a bit about Conway's law :
en.wikipedia.org/wiki/Conway%27s_law
I guess you just read chapter about bounded context in ddd book.
I didn't, although DDD is definitely something I'd like to learn more about.