MENUREADME | How to run locally | REST API doc | Web app screenshots
Eighteen versions (gradually implemented) of a Web and REST API app made with Ruby on Rails that aims to get the most out of the MVC/Rails Way.
| Branch | 070-orthogonal-models |
| Lines of Code | 1613 |
| Rubycritic Score | 95.81 |
Orthogonality is the ability to change one thing without any unseen effect on other thing.
What this branch does is to decouple the User from the Account context to make the codebase even more orthogonal.
See how the two contexts are now separated:
| Account | User |
|---|---|
app/models ├── account │ ├── member │ │ ├── authorization.rb │ │ └── entity.rb │ ├── member.rb │ ├── membership.rb │ ├── owner │ │ ├── creation.rb │ │ └── deletion.rb │ ├── task │ │ ├── item.rb │ │ └── list.rb │ └── task.rb └── account.rb | app/models ├── user │ ├── account_deletion.rb │ ├── password_resetting.rb │ ├── registration.rb │ ├── token │ │ └── entity.rb │ └── token.rb └── user.rb |
The User model is now more focused on the user's behavior, while the Account model is more focused on the account's behavior.
This separation reduces the changes of undesired side effects when changing one of the models. This also happened when the Web and REST API resources were separated.
Another thing to notice is Rubycritic score which increased from 95.77 to 95.81, reflecting the high cohesion and low coupling of the codebase.
That's all folks! There is no other branch. 😉
After all these iterations, I hope you can see the enormous difference that focusing on cohesion and coupling can make in a codebase and how a framework like Rails (which has influenced so many others) is flexible enough to accommodate all these different approaches.
Ruby and Rails rocks! 🤘😎
To understand the project's context, I'd like you to please read the main branch's README.
Check out the:
- disclaimer to understand the project's purpose.
- summary of all branches.