Hands-On Software Architecture with Java

Book description

Build robust and scalable Java applications by learning how to implement every aspect of software architecture

Key Features

  • Understand the fundamentals of software architecture and build production-grade applications in Java
  • Make smart architectural decisions with comprehensive coverage of various architectural approaches from SOA to microservices
  • Gain an in-depth understanding of deployment considerations with cloud and CI/CD pipelines

Book Description

Well-written software architecture is the core of an efficient and scalable enterprise application. Java, the most widespread technology in current enterprises, provides complete toolkits to support the implementation of a well-designed architecture.

This book starts with the fundamentals of architecture and takes you through the basic components of application architecture. You'll cover the different types of software architectural patterns and application integration patterns and learn about their most widespread implementation in Java. You'll then explore cloud-native architectures and best practices for enhancing existing applications to better suit a cloud-enabled world. Later, the book highlights some cross-cutting concerns and the importance of monitoring and tracing for planning the evolution of the software, foreseeing predictable maintenance, and troubleshooting. The book concludes with an analysis of the current status of software architectures in Java programming and offers insights into transforming your architecture to reduce technical debt.

By the end of this software architecture book, you'll have acquired some of the most valuable and in-demand software architect skills to progress in your career.

What you will learn

  • Understand the importance of requirements engineering, including functional versus non-functional requirements
  • Explore design techniques such as domain-driven design, test-driven development (TDD), and behavior-driven development
  • Discover the mantras of selecting the right architectural patterns for modern applications
  • Explore different integration patterns
  • Enhance existing applications with essential cloud-native patterns and recommended practices
  • Address cross-cutting considerations in enterprise applications regardless of architectural choices and application type

Who this book is for

This book is for Java software engineers who want to become software architects and learn everything a modern software architect needs to know. The book is also for software architects, technical leaders, vice presidents of software engineering, and CTOs looking to extend their knowledge and stay up to date with the latest developments in the field of software architecture.

Table of contents

  1. Hands-On Software Architecture with Java
  2. Contributors
  3. About the author
  4. About the reviewer
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share your thoughts
  6. Section 1: Fundamentals of Software Architectures
  7. Chapter 1: Designing Software Architectures in Java – Methods and Styles
    1. The importance of software architecture
      1. The objectives of architecture design in the software life cycle
      2. The software architect – role and skills
      3. Is architecture design still relevant in modern development?
    2. Different types of architecture design – from doodling on paper to more accurate modeling
      1. Sketching the main architectural components
    3. Other kinds of architectural diagrams
      1. Common types of architectural diagrams
    4. The changing role of Java in cloud-native applications
      1. Why Java technology is still relevant today
      2. Java usage in enterprise environments
      3. JEE evolution and criticism
      4. Introducing cloud-native Java
      5. The Java microservices ecosystem
    5. Case studies and examples
      1. Case study – mobile payments
      2. Whiteboarding the overall architecture
    6. Software components diagram
    7. Summary
    8. Further reading
  8. Chapter 2: Software Requirements – Collecting, Documenting, Managing
    1. Introducing requirements engineering
      1. Feature, Advantage, and Benefit
      2. Features and technical requirements
      3. Types and characteristics of requirements
      4. The life cycle of a requirement
    2. Discovering and collecting requirements
      1. The lean canvas
      2. Event Storming
      3. More discovery practices
    3. Analyzing requirements
      1. Checking for coherence and feasibility
      2. Checking for explicitness and testability
      3. Checking non-functional requirements and constraints
    4. Specifying requirements according to the IEEE standard
      1. The 830-1998 standard
      2. The 29148 standard
    5. Collecting requirements – formats and tools
      1. Software requirements data to collect
      2. Collecting software requirements in spreadsheets
      3. Specialized tools for software requirements management
      4. Spreadsheets versus tools
    6. Validating requirements
    7. Case studies and examples
      1. The mobile payment application example
    8. Event Storming for peer-to-peer payments
      1. Requirements spreadsheet
    9. Summary
    10. Further reading
  9. Chapter 3: Common Architecture Design Techniques
    1. Introducing marchitectures – impactful and purely demonstrative schemas
    2. Familiarizing ourselves with UML notation
      1. Understanding the background to UML
      2. Class diagrams
      3. Sequence diagram
      4. Wrapping up on UML
    3. Exploring ArchiMate
      1. The ArchiMate Core and Full Frameworks
      2. Navigating the ArchiMate language tree
      3. Comparing ArchiMate to UML
      4. Comparing ArchiMate to TOGAF
    4. Introducing the C4 model
      1. Exploring the C4 model
      2. Filling in the different levels
    5. Other modeling techniques
      1. BPMN
      2. DMN
      3. arc42
    6. Case studies and examples
      1. UML class diagrams for mobile payments
      2. C4 diagrams for mobile payments
    7. Summary
    8. Further reading
  10. Chapter 4: Best Practices for Design and Development
    1. Understanding Domain Driven Design
      1. The anemic domain model
      2. Understanding ubiquitous language
      3. Getting familiar with layered architecture
      4. Learning about the domain model
      5. Glancing at DDD patterns
      6. Bounded Context
    2. Introducing Test Driven Development
    3. Exploring Behavior Driven Development
      1. Comparing DDD, TDD, and BDD
    4. Learning about user story mapping
      1. The MVP
    5. Case studies and examples
      1. The mobile payments domain model
      2. The layered architecture of mobile payments
      3. BDD of mobile payments
      4. User story mapping of mobile payments
    6. Summary
    7. Further reading
  11. Chapter 5: Exploring the Most Common Development Models
    1. Learning about Code and Fix
    2. Glancing at the Waterfall model
      1. Advantages and disadvantages of the Waterfall model
    3. Understanding the Agile methodology
      1. The Agile principles
    4. Introducing Lean software development
      1. Eliminating waste
      2. Deciding as late as possible
      3. Delivering as fast as possible
      4. Optimizing the whole product
      5. Pros and cons of Lean development
    5. Exploring Scrum
      1. Understanding the Scrum teams
      2. Learning about Scrum Events
      3. Understanding Scrum artifacts
      4. Advantages and disadvantages of Scrum
    6. Learning about other Agile practices
      1. Kaizen
      2. Planning Poker
      3. Kanban board
      4. Burndown chart
    7. Understanding DevOps and its siblings
      1. DevOps team size
      2. Roles and responsibilities in a DevOps team
      3. Devs, Ops, and more
      4. DevOps and the bigger organization
      5. Pros and cons of DevOps
    8. Case studies and examples
    9. Summary
    10. Further reading
  12. Section 2: Software Architecture Patterns
  13. Chapter 6: Exploring Essential Java Architectural Patterns
    1. Encapsulation and hexagonal architectures
      1. Hexagonal architectures and Domain Driven Design
      2. Encapsulation and microservices
    2. Learning about multi-tier architectures
    3. Exploring Model View Controller
      1. Server-side MVC
      2. Client-side MVC
    4. Diving into event-driven and reactive approaches
      1. Defining events, commands, and messages
      2. Introducing the event-driven pattern and event-driven architecture
    5. Designing for large-scale adoption
      1. Defining performance goals
      2. Stateless
      3. Data
      4. Scaling
    6. Case studies and examples
      1. Encapsulating with a hexagonal architecture
      2. Componentizing with multi-tier architecture
      3. Planning for performance and scalability
    7. Summary
    8. Further reading
  14. Chapter 7: Exploring Middleware and Frameworks
    1. Technical requirements
    2. Introducing the JEE standard
      1. Diving into JEE implementations
    3. Introducing the WildFly application server
      1. Exploring the WildFly architecture
      2. Running the WildFly server
    4. Understanding the most common JEE APIs
      1. Dependency injection
      2. Jakarta RESTful Web Services
      3. WebSocket
      4. Messaging
      5. Persistence
      6. What's missing in Java EE
      7. What's great about Java EE
    5. Going beyond Java Enterprise Edition
      1. Packaging microservices applications
      2. Introducing MicroProfile
      3. MicroProfile specifications
    6. Exploring Quarkus
      1. Better performances
      2. Developer joy
      3. Quarkus – hello world
      4. Building techniques with Quarkus
      5. Configuration management in Quarkus
    7. Most common Quarkus extensions
      1. Content Dependency Injection
      2. REST services with JAX-RS
      3. WebSockets
      4. Messaging
      5. Persistence
      6. Accelerated ORM development with Panache
    8. Quarkus and the MicroProfile standard
      1. Case studies and examples
    9. Summary
    10. Further reading
  15. Chapter 8: Designing Application Integration and Business Automation
    1. Integration – point-to-point versus centralized
      1. Understanding service-oriented architecture
      2. Enterprise service bus – what and why?
      3. Integration in the cloud-native world
      4. Citizen integration
    2. Digging into enterprise integration patterns
      1. Message routing
      2. Message transformation
      3. System management
      4. Messaging
    3. Exploring formats
      1. XML
      2. JSON
      3. Protobuf
    4. Exploring communication protocols
      1. SOAP and REST
      2. gRPC
      3. GraphQL
    5. Introducing data integration
    6. Completing the picture with business automation
      1. Business rules
      2. Business workflows
    7. Integration versus automation – where to draw the line
    8. Case studies and examples
      1. Integrating payment capabilities
      2. Automating customer onboarding
    9. Summary
    10. Further reading
  16. Chapter 9: Designing Cloud-Native Architectures
    1. Why create cloud-native applications?
    2. Learning about types of cloud service models
      1. Introducing containers and Kubernetes
    3. Defining twelve-factor applications
      1. Twelve-factor apps and the supporting technology
    4. Well-known issues in the cloud-native world
      1. Fault tolerance
      2. Transactionality
      3. Orchestration
    5. Adopting microservices and evolving existing applications
    6. Going beyond microservices
      1. Miniservices
      2. Serverless and Function as a Service
    7. Refactoring apps as microservices and serverless
      1. The five Rs of application modernization
      2. The strangler pattern
      3. Important points for application modernization
    8. Summary
    9. Further reading
  17. Chapter 10: Implementing User Interaction
    1. User interface architecture – backend versus frontend
    2. Web user interface using Jakarta Server Pages and Jakarta Server Faces
      1. Introducing basic Java web technology – Jakarta Server Pages
      2. JSP – the downsides
      3. Jakarta Server Faces – a complex JEE web technology
      4. JSF – the downsides
    3. Introducing single-page applications
      1. Basics of the JavaScript ecosystem
      2. Introducing the React framework
    4. Learning about mobile application development
      1. The importance of mobile applications
      2. The challenges of mobile application development
      3. Mobile application development options
    5. Exploring IVR, chatbots, and voice assistants
      1. Interactive voice response
      2. Chatbots
      3. Voice assistants
    6. Omnichannel strategy in enterprise applications
    7. Summary
    8. Further reading
  18. Chapter 11: Dealing with Data
    1. Exploring relational databases
      1. Keys and relationships
      2. Transactionality
      3. Stored procedures
      4. Commonly used implementations of relation databases
      5. Advantages and disadvantages of relational databases
    2. Introducing key/value stores
      1. Data caching techniques
      2. Data life cycle
      3. Commonly used implementations of key/value stores
      4. The pros and cons of key/value stores
    3. Exploring NoSQL repositories
      1. The CAP theorem
      2. NoSQL database categories
    4. Looking at filesystem storage
      1. The advantages and disadvantages of filesystems
    5. Modern approaches – a multi-tier storage strategy
    6. Summary
    7. Further reading
  19. Section 3: Architectural Context
  20. Chapter 12: Cross-Cutting Concerns
    1. Identity management
      1. Authentication
      2. Authorization
      3. Identity and Access Management
    2. Security
      1. Intrinsic software security
      2. Overall application security
      3. Security standards and regulations
    3. Resiliency
      1. Uptime
      2. Increasing system resiliency
      3. Further techniques for improving reliability
    4. Summary
    5. Further reading
  21. Chapter 13: Exploring the Software Life Cycle
    1. Technical requirements
    2. Source Code Management
      1. Introducing Git
    3. Testing
      1. Unit testing
      2. Beyond unit testing
      3. Further testing considerations
    4. Deploying
      1. Building the code
      2. Managing artifacts
      3. Completing the deployment
    5. Continuous integration/continuous delivery (and deployment)
      1. Common CI/CD software implementations
    6. Releasing
    7. Maintenance
    8. Summary
    9. Further reading
  22. Chapter 14: Monitoring and Tracing Techniques
    1. Technical requirements
    2. Log management
      1. Common concepts in logging frameworks
      2. Log aggregation
    3. Collecting application metrics
      1. Defining application health checks
    4. Application Performance Management
    5. Service monitoring
    6. Summary
    7. Further reading
  23. Chapter 15: What's New in Java?
    1. Java versioning
      1. Vendor ecosystem
    2. What's new in Java 17
      1. Sealed classes
      2. Pattern matching for switch statements
      3. Strongly encapsulating JDK internals
      4. More changes in Java 17
    3. Summary
    4. Further reading
    5. Why subscribe?
  24. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share your thoughts

Product information

  • Title: Hands-On Software Architecture with Java
  • Author(s): Giuseppe Bonocore
  • Release date: March 2022
  • Publisher(s): Packt Publishing
  • ISBN: 9781800207301