MVC?
Recently I’ve come to compare two idioms: MVC and Microsofts’ View-Controller-BLL-DAL. It seems the same, but MVC as coined by ruby is fat-model slim-controller which means, by use of ActiveRecord, we can put more of the business logic that relates to the model INSIDE the model. The controller then serves as a mere coordinator and dispatcher.
With the Microsoft approach, we put only whats essential in the DAL, and have the BLL contain all the ‘active parts’ — the data manipulation and retrieval etc. which are used by the Controller – the codebehind parts of an ASP page, and then rendered into the view – the ASP page itself.
I tend to think the ruby way is more correct.
Scott Bellaware contributed his thoughts on this before and he says correctly that DAL/BLL are dividing responsibility.
Conclusion
I think the fine point here is that having an ORM do the DAL in ruby, changes everything in the argument, since what you type in the ActiveRecord object has nothing to do with the auto-generated DAL code.
So with ruby, the DAL is silently generated below what you are adding to it – to what you think – is the DAL. What you are adding is actually the BLL. Hence we get the layout:
Ruby: View / Controller / DAL(really, its BLL) / DAL(generated)
MS: View / Controller(code-behind) / BLL / DAL
And problem solved, they are conceptually the same.