Chapter 5. Getting down to business

 

This chapter covers

  • Achieving separation of concerns
  • Domain-driven transformations and message-driven services
  • Interceptors and gateways
  • Chaining endpoints

In the preceding chapters, you were introduced to the big picture of Spring Integration. You learned about the three key components of the framework: message, message channel, and message endpoint. Hopefully, you now have a greater appreciation of how those three components promote loose coupling. Now it’s time to focus on a related concept: separation of concerns. In this chapter we explore how Spring Integration enables a clean separation of integration concerns from the core business logic of an application.

Separation of concerns is a well-established principle of object-oriented programming and underlies many approaches to software design. Programming to interfaces enforces a separation of the contract from the implementation. Building layered architectures enforces a separation based on roles such as presentation and persistence. Aspect-oriented programming (AOP) enforces a separation of the domain-specific code from the cross-cutting requirements. The Spring Framework helps developers achieve a separation from the underlying infrastructure so their applications are portable across different environments without requiring code changes.

5.1. Domain-driven transformation

5.2. Message-driven services

5.3. Message publishing interceptors

5.4. Domain-driven Messaging Gateways

5.5. Chaining endpoints

5.6. Summary