ASP.NET MVC reminds me of old Classic ASP spaghetti code

后端 未结 14 809
借酒劲吻你
借酒劲吻你 2020-12-24 07:50

I just went through some MVC tutorials after checking this site out for a while. Is it just me, or does MVC View pages bring back HORRIBLE flashbacks of Classic ASP spaghet

14条回答
  •  春和景丽
    2020-12-24 08:42

    In classic ASP, you didn't have a choice to move business logic out of the UI layer. In ASP.Net MVC, the "spaghetti" code is isolated the UI layer, the View; 90% of your logic will be in the "M" and "C" layers, which are regular, non-spaghetti C# classes.

    The View is meant to be "dumb". Nothing critical in there from a business logic perspective. It's meant to be nearly disposable.

    You can paint a room messily without doing any damage to the structure. If you decide to clean it up and re-paint, you don't need to call the architect. Same with the View.

提交回复
热议问题