Ruby Web Dev The Other Way

MVC is not an app architecture. This idea is not so obvious due to reign of MVC-based frameworks, that teaches us to use Routing + Model + View render as the way to build web apps. Unfortunately Business Logic of the app has no place in this list.

“Fat Model, Skinny Controller” approach also does not solve the issue. It just swipes the dust under the carpet, but you will still suffer from Fat Models with numerous contexts. Changing code for one usage context will break another usage context.

As a general rule in OOP code – you should break the code into smaller classes with smaller responsibilities. Ideally this code should follow SOLID principles (
Single Responsibility, Open-Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion”).

Also Sandi Matz in the “Practical Object-Oriented Design in Ruby: An Agile Primer” book proposes that being just SOLID in not enough, it should be TRUE.


Original URL:

Original article

Comments are closed.

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑

%d bloggers like this: