2 Writing tightly coupled code

 

In this chapter

  • Writing a tightly coupled application
  • Evaluating the composability of that application
  • Analyzing the lack of composability in that application

As we mentioned in chapter 1, a sauce béarnaise is an emulsified sauce made from egg yolk and butter, but this doesn’t magically instill in you the ability to make one. The best way to learn is to practice, but an example can often bridge the gap between theory and practice. Watching a professional cook making a sauce béarnaise is helpful before you try it out yourself.

When we introduced Dependency Injection (DI) in the last chapter, we presented a high-level tour to help you understand its purpose and general principles. But that simple explanation doesn’t do justice to DI. DI is a way to enable loose coupling, and loose coupling is first and foremost an efficient way to deal with complexity.

Most software is complex in the sense that it must address many issues simultaneously. Besides the business concerns, which may be complex in their own right, software must also address matters related to security, diagnostics, operations, performance, and extensibility. Instead of addressing all of these concerns in one big ball of mud, loose coupling encourages you to address each concern separately. It’s easier to address each in isolation, but ultimately, you must still compose this complex set of issues into a single application.

2.1 Building a tightly coupled application

 
 
 
 

2.1.1 Meet Mary Rowan

 
 
 
 

2.1.2 Creating the data layer

 
 
 

2.1.3 Creating the domain layer

 
 

2.1.4 Creating the UI layer

 

2.2 Evaluating the tightly coupled application

 
 

2.2.1 Evaluating the dependency graph

 
 
 
 

2.2.2 Evaluating composability

 
 

2.3 Analysis of missing composability

 
 
 
 

2.3.1 Dependency graph analysis

 
 
 
 

2.3.2 Data access interface analysis

 
 

2.3.3 Miscellaneous other issues

 
 
 

2.4 Conclusion

 
 

Summary

 
 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest