Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Software Architecture with Java

You're reading from   Hands-On Software Architecture with Java Learn key architectural techniques and strategies to design efficient and elegant Java applications

Arrow left icon
Product type Paperback
Published in Mar 2022
Publisher Packt
ISBN-13 9781800207301
Length 510 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Giuseppe Bonocore Giuseppe Bonocore
Author Profile Icon Giuseppe Bonocore
Giuseppe Bonocore
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface 1. Section 1: Fundamentals of Software Architectures
2. Chapter 1: Designing Software Architectures in Java – Methods and Styles FREE CHAPTER 3. Chapter 2: Software Requirements – Collecting, Documenting, Managing 4. Chapter 3: Common Architecture Design Techniques 5. Chapter 4: Best Practices for Design and Development 6. Chapter 5: Exploring the Most Common Development Models 7. Section 2: Software Architecture Patterns
8. Chapter 6: Exploring Essential Java Architectural Patterns 9. Chapter 7: Exploring Middleware and Frameworks 10. Chapter 8: Designing Application Integration and Business Automation 11. Chapter 9: Designing Cloud-Native Architectures 12. Chapter 10: Implementing User Interaction 13. Chapter 11: Dealing with Data 14. Section 3: Architectural Context
15. Chapter 12: Cross-Cutting Concerns 16. Chapter 13: Exploring the Software Life Cycle 17. Chapter 14: Monitoring and Tracing Techniques 18. Chapter 15: What's New in Java? 19. Other Books You May Enjoy

Case studies and examples

Following up on the handbook approach, each time we face a complex concept, I will try to clarify it by providing case studies. Of course, while the cases are not real (for reasons you can imagine), the challenges closely resemble several first-hand experiences I’ve incurred in my professional history.

In this section, we will start from scratch by designing a piece of software architecture. Then, we will add details to portray a more precise view. This will help you to better understand the first steps in the design of a complex piece of architecture.

Case study – mobile payments

In this case study, we will simulate the architecture design of a mobile payment solution. As contextual background, let’s suppose that a huge bank, in order to increase the service offering toward their customers and following some market research, wants to implement a mobile payment application. By definition, a mobile payment is a pretty broad term, and it includes many different use cases involving financial transactions completed using smartphones.

In this particular implementation, we will consider the use case of paying with your smartphone by charging you via your mobile phone bill.

Essentially, this means implementing a client-server architecture (with the clients implemented as a mobile application), interacting both with existing enterprise applications and external systems exposed by telecommunication operators. Now, let’s now try to analyze some use cases related to this scenario and model it by using the different schemas we’ve discussed so far.

Whiteboarding the overall architecture

Beginning on white space, let’s start whiteboarding the overall architecture. As we’ve learned, the first step is usually to sketch, at a high level, the relevant modules and the relationships between them. It’s not important to be super detailed, nor to use a particular style. We are just brainstorming the first shapes on paper:

Figure 1.7 – Architecture whiteboarding

Figure 1.7 – Architecture whiteboarding

Here, we have drafted a birds-eye view of the use case. We now know where the transaction starts, where the data is saved, and how the user interacts with the system.

Additionally, we have identified the main components of the application:

  • The mobile application (represented together with the user)
  • The (CDN) to serve static resources to the application
  • The (CMS) to configure content to be delivered to the app
  • The backend (mobile Backend as a Service or mBaaS) to proxy requests and responses
  • The business logic of the application
  • Session and Cache, to store non-persistent data of the users
  • Database, to store persistent data
  • Other parts of the application: reporting and data warehousing, authentication, Transactional Backend, and Customer Relationship Management (CRM)

As expected, this kind of design has some intrinsic issues:

  • You can observe mixed-use cases (both of the mobile user and the CMS administrator), which can be foreseen by the arrows between different components, but it’s barely designed.
  • There is a view in the project timeline regarding the implementation of components (reporting and data warehousing appear to be optional in the first phase of the project).

Some protocols in the interactions are named (for example, SOAP and REST), but it’s not an API specification, nor a network schema. Anyway, even if it’s not super detailed, this schema is a good starting point. It helps us to define the main application boundaries, it gives a high-level overview of the integration points, and overall, it’s a good way to kick off a more detailed analysis. We will improve on this in the next section.

You have been reading a chapter from
Hands-On Software Architecture with Java
Published in: Mar 2022
Publisher: Packt
ISBN-13: 9781800207301
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image