وبلاگ بلیان

Practical Domain-Driven Design in Enterprise Java - Using Jakarta EE, Eclipse MicroProfile, Spring Boot, and the Axon Framework.

معرفی کتاب «Practical Domain-Driven Design in Enterprise Java - Using Jakarta EE, Eclipse MicroProfile, Spring Boot, and the Axon Framework.» نوشتهٔ Alexander Osterwalder، Alan Smith، Yves Pigneur، Timothy Clark، Bruce Hazen و Vijay Nair، منتشرشده توسط نشر Apress : Imprint : Apress در سال 2019. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است.

See how Domain-Driven Design (DDD) combines with Jakarta EE MicroProfile or Spring Boot to offer a complete suite for building enterprise-grade applications. In this book you will see how these all come together in one of the most efficient ways to develop complex software, with a particular focus on the DDD process. Practical Domain-Driven Design in Enterprise Java starts by building out the Cargo Tracker reference application as a monolithic application using the Jakarta EE platform. By doing so, you will map concepts of DDD (bounded contexts, language, and aggregates) to the corresponding available tools (CDI, JAX-RS, and JPA) within the Jakarta EE platform. Once you have completed the monolithic application, you will walk through the complete conversion of the monolith to a microservices-based architecture, again mapping the concepts of DDD and the corresponding available tools within the MicroProfile platform (config, discovery, and fault tolerance). To finish this section, you will examine the same microservices architecture on the Spring Boot platform. The final set of chapters looks at what the application would be like if you used the CQRS and event sourcing patterns. Here you’ll use the Axon framework as the base framework. What You Will Learn Discover the DDD architectural principles and use the DDD design patterns Use the new Eclipse Jakarta EE platform Work with the Spring Boot framework Implement microservices design patterns, including context mapping, logic design, entities, integration, testing, and security Carry out event sourcing Apply CQRS Who This Book Is For Junior developers intending to start working on enterprise Java; senior developers transitioning from monolithic- to microservices-based architectures; and architects transitioning to a DDD philosophy of building applications. Table of Contents 5 About the Author 9 About the Technical Reviewer 10 Acknowledgments 11 Introduction 12 Chapter 1: Domain Driven Design 13 DDD Concepts 14 Problem Space/Business Domain 14 Sub-Domains/Bounded Contexts 16 The Domain Model 20 Aggregates/Entity Objects/Value Objects 22 Domain Rules 23 Commands/Queries 24 Events 24 Sagas 25 Summary 27 Chapter 2: Cargo Tracker 28 Core Domain 28 Cargo Tracker: Sub-Domains/Bounded Contexts 29 Cargo Tracker: Domain Model 33 Aggregates 33 Aggregate Identifiers 34 Entities 34 Value Objects 35 Cargo Tracker: Domain Model Operations 40 Sagas 41 Domain Model Services 43 Domain Model Services Design 45 Cargo Tracker: DDD Implementations 48 Summary 48 Chapter 3: Cargo Tracker: Jakarta EE 49 The Java EE Platform 50 Rebranding to Jakarta EE and the Way Forward 50 Jakarta EE Platform Specifications 51 Web Application Technologies 52 Java Servlet 53 JavaServer Faces 53 JavaServer Pages 53 Expression Language 54 JSP Standard Tag Library (JSTL) 54 Java API for WebSocket 54 Java API for JSON Binding 54 Java API for JSON Processing 54 Enterprise Application Technologies 55 Enterprise Java Beans (3.2) 55 Contexts and Dependency Injection for Java (2.0) 55 Bean Validation 56 Java Persistence API (JPA) 56 Java Transaction API (JTA) 56 Common Annotations 57 Interceptors 57 Web Services in Jakarta EE 57 Java API for RESTful Web Services (JAX-RS) 57 Security Technologies 57 Java EE Security API (1.0) 57 Jakarta EE Specification Summary 58 Cargo Tracker as a Modular Monolith 58 Bounded Context(s) with Jakarta EE 60 interfaces 61 application 62 domain 63 infrastructure 64 Shared Kernels 65 Implementing the Domain Model with Jakarta EE 65 Aggregates 66 Aggregate Class Implementation 67 Domain-Rich Aggregate vs. Anemic Aggregates 68 Business Attribute Coverage 69 Business Method Coverage 70 Aggregate State Construction 71 Aggregate State Persistence 73 Inter-Aggregate References 73 Aggregate Events 74 Entities 75 Entity Class Implementation 76 Entity-Aggregate Relationships 77 Entity State Construction/Persistence 77 Value Objects 78 Value Object Class Implementation 79 Value Object-Aggregate Relationship 81 Value Object Construction/Persistence 82 Domain Rules 83 Commands 85 Queries 87 Implementing Domain Model Services with Jakarta EE 88 Inbound Services 88 RESTful API(s) 89 Native Web API(s) 89 Application Services 91 Application Services: Events 94 Outbound Services 98 Implementation Summary 100 Summary 101 Chapter 4: Cargo Tracker: Eclipse MicroProfile 102 Eclipse MicroProfile 103 Eclipse MicroProfile: Capabilities 105 Eclipse MicroProfile: Core Specifications 107 Eclipse MicroProfile Config 108 Eclipse MicroProfile Health Check 109 Eclipse MicroProfile JWT Authentication 109 Eclipse MicroProfile Metrics 109 Eclipse MicroProfile OpenAPI 109 Eclipse MicroProfile OpenTracing 110 Eclipse MicroProfile Type Safe Rest Client 110 Eclipse MicroProfile: Supporting Specifications 110 Contexts and Dependency Injection for Java (2.0) 111 Common Annotations 111 Java API for RESTful Web Services (JAX-RS) 112 Java API for JSON Binding 112 Java API for JSON Processing 112 Eclipse MicroProfile Specification Summary 112 Cargo Tracker Implementation: Eclipse MicroProfile 113 Implementation Choice: Helidon MP 114 Cargo Tracker Implementation: Bounded Context(s) 115 Bounded Contexts: Packaging 117 Bounded Contexts: Package Structure 120 interfaces 121 application 122 domain 123 infrastructure 124 Cargo Tracker Implementation 127 Domain Model: Implementation 129 Core Domain Model: Implementation 129 Aggregates/Entities/Value Objects 129 Aggregate Class Implementation 130 JPA Integration: Helidon MP 130 Domain Richness: Business Attributes 135 Implementing Entity Objects/Value Objects 139 Domain Model Operations 144 Commands 144 Identification of Commands 145 Implementation of Commands 145 Identification of Command Handlers 147 Implementation of Command Handlers 147 Queries 149 Events 149 Domain Model Services 153 Inbound Services 154 REST API 155 Event Handlers 162 Application Services 164 Application Services: Command/Query Delegation 165 Application Services: Raising Domain Events 171 Outbound Services 175 Outbound Services: Repositories 176 Outbound Services: REST API(s) 181 Outbound Services: Message Broker 193 Implementation Summary 196 Summary 197 Chapter 5: Cargo Tracker: Spring Platform 198 The Spring Platform 199 Spring Boot: Capabilities 202 Spring Cloud 203 Spring Framework Summary 204 Bounded Context(s) with Spring Boot 205 Bounded Contexts: Packaging 207 Bounded Contexts: Package Structure 208 interfaces 210 application 211 domain 212 infrastructure 213 Cargo Tracker Implementation 216 Domain Model: Implementation 219 Core Domain Model: Implementation 219 Aggregates/Entities/Value Objects 219 Aggregate Class Implementation 220 JPA Integration: Spring Data JPA 220 Domain Richness: Business Attributes 224 Implementing Entity Objects/Value Objects 228 Domain Model Operations 233 Commands 233 Queries 238 Domain Events 238 Registration of Events 241 Domain Model Services 245 Inbound Services 246 REST API 247 Event Handlers 254 Application Services 257 Application Services: Command/Query Delegation 258 Outbound Services 264 Outbound Services: Repository Classes 266 Outbound Services: Rest API(s) 267 Outbound Services: Message Broker 279 Implementation Summary 283 Summary 285 Chapter 6: Cargo Tracker: Axon Framework 286 Event Sourcing 287 CQRS 290 The Axon Framework 294 Axon Components 295 Axon Framework Domain Model Components 297 Aggregates 297 Commands/Command Handlers 297 Events/Event Handlers 297 Query Handlers 298 Sagas 298 Axon Dispatch Model Components 299 Command Bus 299 Query Bus 301 Event Bus 302 Sagas 303 Axon Infrastructure Components: Axon Server 305 Cargo Tracker with Axon 309 Bounded Contexts with Axon 309 Bounded Contexts: Artifact Creation 312 Bounded Contexts: Package Structure 314 interfaces 315 application 316 domain 317 infrastructure 318 Implementing the Domain Model with Axon 321 Aggregates 322 State 325 Command Handling 331 Identification of Commands 331 Implementation of Commands 331 Identification of Command Handlers 333 Implementation of Command Handlers 334 Event Publishing 337 Identification/Implementation of Events 337 Implementation of Event Publishing 338 State Maintenance 339 Event Handling within Aggregates 340 State Maintenance: The First Command 341 State Maintenance: Subsequent Commands 345 Aggregate Projections 353 Query Handlers 359 Identification of Queries 359 Implementation of Queries 359 Implementation of Query Handlers 361 Sagas 365 Implementation Summary 372 Implementing Domain Model Services with Axon 373 Inbound Services 373 REST API 373 Event Handler 376 Application Services 379 Summary 381 Index 382 Front Matter ....Pages i-xv Domain Driven Design (Vijay Nair)....Pages 1-15 Cargo Tracker (Vijay Nair)....Pages 17-37 Cargo Tracker: Jakarta EE (Vijay Nair)....Pages 39-91 Cargo Tracker: Eclipse MicroProfile (Vijay Nair)....Pages 93-188 Cargo Tracker: Spring Platform (Vijay Nair)....Pages 189-276 Cargo Tracker: Axon Framework (Vijay Nair)....Pages 277-372 Back Matter ....Pages 373-379
دانلود کتاب Practical Domain-Driven Design in Enterprise Java - Using Jakarta EE, Eclipse MicroProfile, Spring Boot, and the Axon Framework.