Monday, February 3, 2014

Why isolate “lower” application layers from “higher” layers?

In a typical (well-designed) MVC Web app, the database is not aware of the model code, the model code is not aware of the controller code, and the controller code is not aware of the view code. (I imagine you could even start as far down as the hardware, or perhaps even further, and the pattern might be the same.)

Going the other direction, you can go just one layer down. The view can be aware of the controller but not the model; the controller can be aware of the model but not the database; the model can be aware of the database but not the OS. (Anything deeper is probably irrelevant.)

I can intuitively grasp why this is a good idea but I can't articulate it. So why is this unidirectional style of layering a good idea?

Read more here

Leave a Reply

All Tech News IN © 2011 & Main Blogger .