Why should a web architecture be loosely coupled?

后端 未结 13 1917
盖世英雄少女心
盖世英雄少女心 2020-12-23 14:19

When I look at ASP.NET MVC projects I everytime see loose coupled architecture.

For what do I need a loose coupling in a web architecture (if I do not make unit test

13条回答
  •  自闭症患者
    2020-12-23 15:18

    First off, you should be writing unit tests ;)

    Say you end up needing to change the underlying database. If your data access code is tightly coupled to your business logic, this could prove to be a huge effort. With loosely coupled code, your business logic will remain unaffected.

    What if you decide you want to write some command line utilities that leverage your backend components? Providing multiple entry points to your system is much more easily accomplished with loosely coupled code.

提交回复
热议问题