Ready to extend your journey into software architecture? In this chapter, you’re the software architect. You’ll be determining architectural characteristics, building a logical architecture, making architectural decisions, and deciding whether to use a layered, modular, or microkernel architecture. The exercises in this chapter will give you an end-to-end view of what a software architect does and show you how much you’ve learned. Get ready to create an architecture for a startup company building a travel integration convenience site. Bon voyage —we hope you have a good trip building your architecture.
Making travel easier
You’ve just been hired as a software architect by an exciting new startup called TripEZ (pronounced like “trapeze”) that wants to make travel easier, especially for “road warriors” who travel frequently. The TripEZ app will be an online trip management dashboard that allows travelers to see all of their existing reservations organized by trip, through either a web browser or their mobile devices.
TripEZ requirements document
-
□ The system should continually poll the user’s email account for travel-related emails.
-
□ The system must interface with the systems of travel partners (like travel agencies, booking apps, airlines, hotels, and car rental companies) to update travel details. These include delays, cancellations, updates, and gate changes. To beat the competition, updates must appear in the app within five minutes.
-
□ Users should be able to add, update, or delete existing reservations manually.
-
□ Users should be able to group items in the dashboard by trip. Once the trip is complete, the items should automatically be removed from the dashboard.
-
□ Users should be able to share their trip information by interfacing with standard social media sites and by sharing it with specific people.
-
□ The system should have the richest user interface possible, across all deployment platforms.
-
□ The system should provide end-of-year summary reports with a wide range of metrics about users’ travel that year.
-
□ TripEZ should gather analytical data—such as travel trends, locations, airline and hotel vendor preferences, and cancellation and update frequency—from users’ trips for various purposes.
-
□ The company would like to ship TripEZ in six months, to coincide with an important trade show.
Pay attention, because these things are important.
Note
Meet Travis, former pilot and consultant to TripEZ. He has a few more important requirements for the system.
“TripEZ must integrate seamlessly with the existing standard interface systems used across the travel industry, including internationally.
It must integrate with the user’s preferred travel agency (if any) to resolve problems quickly.
Finally, users must be able to access the system at all times. Unplanned downtime should be limited to a maximum of five minutes per month.”
TripEZ’s user workflow
Now that we have the requirements, let’s get a better understanding of them by looking at the primary workflow for travelers using TripEZ.
Sharpen your pencil
Given the requirements for TripEZ, list some challenges that you will need to address when creating an architectural solution.
Solution in “Sharpen your pencil Solution”
Planning the architecture
We have to create an architecture first.
As you’ve learned, architecture is a critical and necessary part of any software system. Without it, the system will likely fail to achieve any of its goals.
Before we start developing code, we have to create an architecture. This means going back to Chapter 1 , where you learned about the four dimensions of software architecture.
Don’t worry—we’ll get the system done. But first, it’s important to know what we’re building.
The architects’ roadmap
Let’s get the TripEZ architecture started. You’ll use the steps you’ve learned in previous chapters to translate the requirements into an architecture.
This diagram will serve as your roadmap as you make your way through each of the exercises, so get used to seeing it. The next few pages will walk you through each of these steps.
Good luck on your journey—TripEZ is counting on you.
Step 1: Identify architectural characteristics
“TripEZ must integrate seamlessly with the existing standard interface systems used across the travel industry, including internationally.
It must integrate with the user’s preferred travel agency (if any) to resolve problems quickly.
Finally, users must be able to access the system at all times. Unplanned downtime should be limited to a maximum of five minutes per month.”
Note
We copied the requirements here to make it easier for you to use them to identify the driving architectural characteristics.
TripEZ requirements document
-
□ The system should continually poll the user’s email account for travel-related emails.
-
□ The system must interface with the interface systems of travel partners (like travel agencies, booking apps, airlines, hotels, and car rental companies) to update travel details. These include delays, cancellations, updates, and gate changes. To beat the competition, updates must appear in the app within five minutes.
-
□ Users should be able to add, update, or delete existing reservations manually.
-
□ Users should be able to group items in the dashboard by trip. Once the trip is complete, the items should automatically be removed from the dashboard.
-
□ Users should be able to share their trip information by interfacing with standard social media sites and by sharing it with specific people.
-
□ The system should have the richest user interface possible, across all deployment platforms.
-
□ The system should provide end-of-year summary reports with a wide range of metrics about users’ travel that year.
-
□ TripEZ should gather analytical data—such as travel trends, locations, airline and hotel vendor preferences, and cancellation and update frequency—from users’ trips for various purposes.
-
□ The company would like to ship TripEZ in six months, to coincide with an important trade show.
Exercise
In Chapter 2 , we showed you how to use this template to limit the number of architectural characteristics. Flip back to “Limiting architectural characteristics” if you need a refresher on how to use it.
Solution in “Exercise Solution”
Step 2: Identify logical components
Good job! Now that you’ve identified the critical architectural characteristics for TripEZ, it’s time to apply what you’ve learned to create logical components.
Referring to the requirements and primary workflow on the previous pages, use the actor/action approach described in Chapter 4 to identify actors and their actions. Then identify as many logical components as you can on the next page.
Here’s some additional information you might find useful for this exercise:
-
• When users sign up for TripEZ, they provide credentials to allow the different travel services to provide up-to-date status reports on delays, cancellations, and so on.
-
• If a travel partner’s integration point won’t supply updates within the required five-minute window, the system should query the vendor.
Note
This allows the system to work with travel partners that can’t meet its agreed-upon thresholds.
-
• Updates, especially to the mobile application, should use as little data as possible to accommodate potentially spotty cell signals in remote places.
-
• TripEZ can’t be held responsible for integration point availability; if the call fails, the system must return an error rather than failing silently (which would mislead the user into thinking no update was sent).
Sharpen your pencil
Using the actor/action approach, identify actions for each of the actors below.
Solution in “Sharpen your pencil Solution”
Exercise
Using the space below, draw your logical components and their interactions.
Solution in “Exercise Solution”
Step 3: Choose an architectural style
Leveraging what you’ve learned about the layered, modular monolith, and microkernel architectural styles, use the next page to analyze their pros and cons with respect to the TripEZ system. You’ll also need to refer to the requirements, your logical architecture, and the star rating charts for each architectural style (we’ve added those below for you). Choose an architectural style based on your analysis.
Here are some considerations that might help you decide which architectural style would be better suited for TripEZ:
-
• Go back to your logical architecture diagram and see if you can identify distinct technical or business concerns. If so, a layered or modular monolith architecture might be a good choice.
-
• Think about different points of integration. If there are many, each with specific logic, then a microkernel architecture might be a good fit.
Exercise
Outline the pros and cons of each architectural style to help you make a choice about which one might be most appropriate for TripEZ.
List your winning choice here: _____________________
Solution in “Exercise Solution”
Step 4: Document your decision
Congratulations on choosing which architectural style to use for TripEZ. Now’s your chance to explain why you made the choice you did and document your architectural decision.
As you learned in Chapter 3 , an architectural decision record , or ADR, is an effective way to document your architectural decisions. Use the ADR on the next page to document your architectural style decision. Assume this is your 11th architectural decision.
Note
Revisit Chapter 3 if you need a refresher on architectural decision records.
Every architectural decision has consequences.
Maybe it’s about cost, or maybe it’s sacrificing a little bit of performance to have better security. Regardless, every architectural decision has consequences.
Think about the trade-off analysis you just did. Each one of those trade-offs implies a consequence—something you were willing to give up (or accept) to get something better. The Consequences section of an ADR is a great place to document your trade-off analysis and the corresponding consequences of your decision.
If you can’t find any consequences in your architectural decision, keep looking, because they’re there.
Exercise
Architectural Decision Record
Solution in “Exercise Solution”
Step 5: Diagram your architecture
Now it’s time to combine all four dimensions of software architecture and show us your vision of the TripEZ architecture. In this last exercise, you’ll diagram your architecture on the following page using the key on this page.
We didn’t give you a lot of room to diagram your architecture, and that’s on purpose. While many architecture diagrams are very detailed, what we’re asking you to do here is to sketch out a high-level physical view of the user interfaces, databases, and components that make up your architecture and how they all connect to each other.
Physical Architecture Key
Exercise
Use this space and refer to the key on the previous page to sketch your physical architecture for TripEZ.
Solution in “Exercise Solution”
There are no right (or wrong) answers
Congratulations—you’ve just created an architecture!
What we’re about to show you are the exercise “solutions.” We’ve used quotes there because the solutions we present here are just some of many possible solutions. You see, there are no right or wrong answers in software architecture: it’s all about analyzing trade-offs and being able to justify your decisions.
Compare your answers with the ones we’re about to show you to see how your solutions differ. You can think about what you might have done differently, or confirm that you made what seems to you to be the most appropriate choice. We’ll show you our TripEZ architectures for layered, modular monolith, and microkernel architectures, since all of these styles are viable options.
Software architecture is always a learning process. Each new problem brings a whole new set of conditions, constraints, and business and technical concerns. There is no one-size-fits-all architecture—it’s up to you, the architect, to come up with the most appropriate architecture for your situation.
Bullet Points
-
When analyzing requirements for a business problem, always gather additional information from the business stakeholders or project sponsor.
-
While there’s no “checklist” for creating an architecture, the four dimensions of software architecture (introduced in Chapter 1 ) provide a good roadmap.
-
Identifying driving architectural characteristics requires you to analyze the business requirements and technical constraints.
-
Implicit architectural characteristics become driving characteristics if they are critical or important to the success of the system.
-
Make sure you can tie each driving characteristic back to some sort of requirement or business need.
-
When identifying logical components and creating a corresponding logical architecture, try to avoid adding physical details such as services, databases, queues, and user interfaces—those artifacts go into the physical architecture .
-
When choosing an architectural style, make sure you consider the characteristics of the architectural style, the problem domain, and the driving architectural characteristics you identified.
-
Hybrid architectures (those combining two or more different architectural styles) are very common. If you use one, be sure to verify that it addresses your critical architectural characteristics.
-
Architectural decision records (ADRs) are a great way to document your choices. They communicate the reasons for your architectural decisions as well as your trade-off analyses.
-
When diagramming your physical architecture, be sure to include all the components you identified in your logical architecture.
-
Remember, there are no right or wrong answers in software architecture. As long as you can provide a reasonable justification for your architectural decisions, you’re on the right track.
From “Exercise”
Exercise Solution
In Chapter 2 , we showed you how to use this template to limit the number of architectural characteristics. Flip back to “Limiting architectural characteristics” if you need a refresher on how to use it.
From “Sharpen your pencil”
Sharpen your pencil Solution
Given the requirements for TripEZ, list some challenges that you will need to address when creating an architectural solution.
-
• Making sure that we can deliver alerts in time
-
• Supporting a sufficient number of users
-
• Finding a way to manage all the different integration points
-
• Integrating with social media accounts
From “Sharpen your pencil”
Sharpen your pencil Solution
Using the actor/action approach, identify actions for each of the actors below.
From “Exercise”
Exercise Solution
Using the space below, draw your logical components and their interactions.
From “Exercise”
Exercise Solution
Outline the pros and cons of each architectural style to help you make a choice about which one might be most appropriate for TripEZ.
From “Exercise”
Exercise Solution
From “Exercise”
Exercise Solution
From “Exercise”
Exercise Solution
From “Exercise”
Exercise Solution
Use this space and refer to the key in “Exercise” to sketch your physical architecture for TripEZ.
From “Exercise”
Exercise Solution
Use this space and refer to the key on the “Exercise” to sketch your physical architecture for TripEZ.
From “Exercise”
Exercise Solution
Use this space and refer to the key on the prior page to sketch your physical architecture for TripEZ.