https://stackoverflow.com/questions/98734/what-is-separation-of-concerns
In computer science, separation of concerns (SoC) is the process of breaking a computer program into distinct features that overlap in functionality as little as possible. A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors. Progress towards SoC is traditionally achieved through modularity and encapsulation, with the help of information hiding.
From Pro Asp.Net MVC 4 book ( page 375 ):
The problem with relying on route names to generate outgoing URLs ( @Html.RouteLink("Click me", "MyOtherRoute","Index", "Customer") is that doing so breaks through the separation of concerns that is so central to the MVC design pattern. When generating a link or a URL in a view or action method, we want to focus on the action and controller that the user will be directed to, not the format of the URL that will be used. By bringing knowledge of the different routes into the views or controllers, we are creating dependencies that we would prefer to avoid.
a) I understand that we create a dependency ( between action method/view and a routing configuration module ) by having Html.RouteLink
( called within action method or view ) specifying the name of the route we want to use.
But is introducing such a dependency already considered a violation of SoC? Namely, even though we created a dependency between the two modules, we haven't actually introduced any additional functionality/concern into either of the modules ( the definition of SoC implies that violation of SoC occurs when new functionality/concern is introduced into a module )
b) Anyhow, I don't understand how will simply generating an URL ( within action method/view ) by specifying a named route bring focus to the format of the URL?
Thank you