Thursday, May 03, 2012

A view’s responsibility — a lesson on JavaScript and the DOM – BEKK Open

A view’s responsibility — a lesson on JavaScript and the DOM – BEKK Open: "Secondly, who is allowed to change what? Can all functions change whatever part of the DOM they want? This wreaks havoc for your tests and creates uncertainty as to where something occurs. And once again, you most likely need to set up the entire application to test the view.

My solution: A view is responsible for one HTML element and everything inside it.

And, of course, a view may contain several sub-views which again are responsible for themselves."