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

Choosing the right technology for you


Earlier in this chapter, we defined what software architecture is and what the relevant elements surrounding it are. We also mentioned that frameworks, programming languages, paradigms, and so on are not the underlying elements that should guide your software architecture. Many people defend the idea of deferring as much of your technical decisions as possible in order to have your design open to new options, and that's worth doing. However, you can't postpone these choices forever.

There are a lot of frameworks available on the market. Many of them are new, but old frameworks are also still available. Even at the beginning of the process, when all this stuff is just a detail, you need to carefully choose the framework that you will use to build your software architecture, since this detail will make your life easier (or more difficult) depending on the features that you implement in order to solve the business requirements. I'll show you some considerations that you need to bear in mind when you're deciding which framework to use:

  • How much documentation is available?

This is an important factor to consider. Here, you must think about how much documentation has been written for the vendor, and how many courses are available online (not only by the vendor but by other developers, as well). If you can find books, articles, and showcases, it's always worth exploring these as they will allow you to learn about the tool that you have decided to use.

 

  • How big is the community around your choice?

Having a lot of people working on improving a product is something that you should appreciate. Your choice should be supported not only by the vendor but also by other developers and companies using the product to solve their needs.

  • Is it difficult to write tests using a defined technology that you have in mind?

No matter what your programming style is, you will always benefit from including tests as part of your SDLC. You will also benefit from including tests for another aspect of your software (or at least unit tests, integration tests, functional tests, and load tests). If your framework makes this task difficult, it is better to choose another one. If you are using a framework, ABC, for dependency injection, this should be tested, but if these tests are difficult to write, you won't want to waste your time with them. With this idea in mind, Spring has excellent support for testing, and we'll cover this in subsequent chapters by using a hands-on approach.

  • Can I plug components to add more features?

You are probably thinking "if I want to add a new component, I can simply include a JAR". In some cases, this is true, and in other cases, you'll need to discover a whole set of dependencies for making it work. This is a painful procedure because sometimes you need specific versions of specific libraries, which is more challenging to figure out by ourselves, and this is not something you should spend too much time on. Spring includes Spring Boot, which has an excellent method for adding dependencies to your project in a straightforward way. You should only indicate to Spring that you want to work with JPA (for example) during the application creation process, and Spring itself will be able to figure out all the required dependencies to make it work by itself.

It is common to struggle with Maven a bit when you're looking for the right artifact to bootstrap your application for the first time. The good news with Spring is that you have Spring Initializer, which is a friendly website for bootstrapping your application in a few clicks. You can refer to https://start.spring.io for more details.

 

 

  • What are companies using the product for?

Even when the market is crowded with new tools that look promising, you will not want to gamble when it comes to choosing technologies and frameworks. Before choosing a framework or technology, I encourage you to watch some videos of conferences on YouTube. It would be even better if you can go and attend one of them if you have the chance. You'll also benefit from reading papers, showcases, and case studies about a specific technology, as well as which companies are working with these. You can even start creating analogies based on this information in order to figure out how well a particular technology will fit for you.

However, for many years, I have seen how people have been working with Spring to accomplish their business requirements in different industries.

This framework is mature and is constantly evolving to embrace new programming styles and emerging techniques in the software industry. For example, the latest release of Spring includes support for the most recent features introduced within the Java world and the industry in general, such as reactive programming, the latest Java version, and even support for other programming languages that are becoming popular, such as Kotlin and Groovy.