Website review: URLs do not belong in the Views

vidarh vidarh discovered this in Programming 1 reviews since Mar 26, 2008
icon tagsprogramming hokstad.com/urls-do-not-belong-in-the-views.h...

Thumbs up People who like this website

vidarh
England

StumbleUpon is the best way to discover great web sites, videos, photos, blogs and more - based on your interests. Everything is submitted and rated by the community. Discover, share and review the best of the web!

Thumbs up Reviews of this website

vidarh discovered 4 months ago
From the page: "It's bothered me for some time to hardcode URLs in my views. It means that if I want to revise the linking structure, I may need to modify the views in a huge number of places. At the same time I don't like the thought of putting it in the model either. In the entry Enforcing Strict Model-View Separation in Template Engines I point to an interview with, and a paper by, Terence Parr that articulated this issue much better than I had fleshed it out in my mind. He also proposed a solution: Introduce an extra layer - Renderers - that turn model objects or attributes into a displayable format. An example might be formatting a date string the appropriate way."
This page is not affiliated with hokstad.com.