From the course: Practical Application Architecture with Entity Framework Core

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Decoupling

Decoupling

- [Instructor] Decouple your code. You may have have heard it often, but not really understood what it means. Let's start with what coupling means in the context of software architecture. When components depend directly on other components those components have to be in place to test that code. Coupling is when a component depends on a component it depends on a component. They have to come together as a package. Given some web request, it depends on authentication, a database, maybe another web service, some business logic. All of these pieces are required to return the result of the call. Tightly coupled code means that all of these things have to be in place to see if the action works. This means, big complicated integration tests with a lot of different outcomes. The first step to writing unit tests is to isolate dependencies from one another so they can be tested and mocked out independently. This is decoupling. Code with significant dependencies or more than one responsibility is…

Contents