Book Image

Software Architecture with Spring 5.0

By : René Enríquez, Alberto Salazar
Book Image

Software Architecture with Spring 5.0

By: René Enríquez, Alberto Salazar

Overview of this book

Spring 5 and its ecosystem can be used to build robust architectures effectively. Software architecture is the underlying piece that helps us accomplish our business goals whilst supporting the features that a product demands. This book explains in detail how to choose the right architecture and apply best practices during your software development cycle to avoid technical debt and support every business requirement. Choosing the right architecture model to support your business requirements is one of the key decisions you need to take when a new product is being created from scratch or is being refactored to support new business demands. This book gives you insights into the most common architectural models and guides you when and where they can be used. During this journey, you’ll see cutting-edge technologies surrounding the Spring products, and understand how to use agile techniques such as DevOps and continuous delivery to take your software to production effectively. By the end of this book, you’ll not only know the ins and outs of Spring, but also be able to make critical design decisions that surpass your clients’ expectations.
Table of Contents (21 chapters)
Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
Index

Implementing client-server architectures with Spring


Now that you have a better comprehension of client-server architectures, we will code an example that follows this diagram:

Example of client-server architecture

The functionality of our application will be simple. The server will expose an endpoint with the customer's bank statement, and then we will code a few clients to consume that information.

The server

There are a bunch of options to build the server side using the Spring Framework, including the following:

  • SOAP web services
  • RESTful Web Services
  • Common Object Request Broker Architecture (CORBA)
  • Sockets
  • AMQP

 

 

SOAP web services

SOAP web services were widely implemented by developers before the REST style appeared, and they are heavily based on the use of XML. There are also a bunch of libraries available to deal with them, including Apache CXF, and JAX-WS. The following screenshot represents a request payload for a simple addition operation:

Request payload

The following screenshot shows how...