Ruby on Rails books teach wrong OO

Posted:   |  More posts about software uml

I was reading a lot of Ruby on Rails books in order to start my own project. I found the thing, which really disturbes me: though Ruby is a proper OO language, none of OO desugn features are presented in Rails books.

Proper Object Oriented Design should simplify software development by introducing abstraction from unneccessary logic constraints.

Take, for example, books dealing with making simple online store. They all say that there is no way to add products into shopping cart because products can be in many shopping carts. Because of that you have to add LineItems, which will point to a product description.

This is true when we speak about database design, but completely untrue when we speak about software design. From OO point of view there is no such thing as LiteItem. It has no value to a business logic and it must be dropped from model.

This model look much cleaner and causes no confusion. Additional work must be done on model layer, but this is just to avoid database limitations.

Contents © 2013 Aleksey Maksimov - Powered by Nikola