HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
This PDF will be accessible from your Account page after purchase and requires PDF reading software, such as Acrobat® Reader®.
The eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.
“An outstanding depth-and-breadth resource for IT architects and Java professionals to understand and apply the marriage of SOA and modern Java.”
--Antonio Bruno, Enterprise Architecture and Strategy, digitalStrom
“A great self-contained book on SOA using flexible Java implementations....”
--Roger Stoffers, Hewlett Packard
“Provides clarity on abstract concepts and is filled with concrete examples of implementing SOA principles in Java environments.”
--Sanjay Singh, Certified SOA Architect
“...provides a holistic, comprehensive view on leveraging SOA principles and architecture for building and deploying performant Java services.”
--Suzanne D’Souza, KBACE Technologies
“Thomas Erl’s series of books on services technology have shaped, influenced, and strengthened a whole community of enterprise and solution architects’ thinking and solution development, and the much awaited SOA with Java book is an excellent addition to the series. It is a must-read.”
--Lalatendu Rath, Wipro Technologies
The Definitive Guide to Building Service-Oriented Solutions with Lightweight and Mainstream Java Technologies
Java has evolved into an exceptional platform for building Web-based enterprise services. In SOA with Java, Thomas Erl and several world-class experts guide you in mastering the principles, best practices, and Java technologies you need to design and deliver high-value services and service-oriented solutions.
You’ll learn how to implement SOA with lightweight frameworks, mainstream Java services technologies, and contemporary specifications and standards. To demonstrate real-world examples, the authors present multiple case study scenarios. They further demystify complex concepts with a plain-English writing style. This book will be valuable to all developers, analysts, architects, and other IT professionals who want to design and implement Web-based service-oriented architectures and enterprise solutions with Java technologies.
Topic Areas
Foreword xix
CHAPTER 1: Introduction 1
1.1 About This Book 2
Objectives of This Book 2
Who This Book Is For 2
What This Book Does Not Cover 3
1.2 Prerequisite Reading 3
How This Book Is Organized 4
1.3 How Principles and Patterns Are Used in This Book 7
1.4 Symbols and Figures 7
1.5 Additional Information 7
Updates, Errata, and Resources (www.servicetechbooks.com) 8
Referenced Specifications (www.servicetechspecs.com) 8
The Service Technology Magazine (www.servicetechmag.com) 8
Service-Orientation (www.serviceorientation.com) 8
What Is REST? (www.whatisrest.com) 8
What Is Cloud? (www.whatiscloud.com) 8
SOA and Cloud Computing Design Patterns (www.soapatterns.org, www.cloudpatterns.org) 8
SOA Certified (SOACP) Professional (www.soaschool.com) 9
Cloud Certified Professional (CCP) (www.cloudschool.com) 9
Big Data Science Certified Professional (BDSCP) (www.bigdatascienceschool.com) 9
Notification Service 9
CHAPTER 2: Case Study Examples 11
2.1 How Case Study Examples Are Used 12
Style Characteristics 12
Relationship to Abstract Content 12
Code Samples 12
2.2 Case Study Background: NovoBank 13
Technical Infrastructure 13
Automation Solutions 13
Business Obstacles and Goals 14
Future IT Roadmap 15
1. Build Reusable Business Services 15
2. Consolidate Information 16
3. Improve Channel Experience 16
4. Build Services Infrastructure 16
2.3 Case Study Background: SmartCredit Co 16
Technical Infrastructure 17
Automation Solutions 17
Business Goals 17
Future IT Roadmap 18
PART I: FUNDAMENTALS
CHAPTER 3: Fundamental SOA Concepts 21
3.1 Basic Terminology and Concepts 22
Service-Oriented Computing 22
Service-Orientation 24
Service-Oriented Architecture (SOA) 27
SOA Manifesto 28
Services 29
Cloud Computing 29
IT Resources 30
Service Models 30
Agnostic Logic and Non-Agnostic Logic 31
Service Inventory 32
Service Portfolio 32
Service Candidate 33
Service Contract 33
Service-Related Granularity 34
Service Profiles 35
SOA Design Patterns 36
3.2 Further Reading 38
CHAPTER 4: Basic Java Distributed Technologies 39
4.1 Java Distributed Computing Basics 40
Java SE Architecture 41
Java EE Architecture 41
The Beginning of Java EE 41
Application Packaging and Deployment 44
Deployment Descriptors 44
Java EE Architectural Tiers 45
4.2 Java Distributed Technologies and APIs 46
Java SE APIs 46
RMI 46
RMI / IIOP 47
JNDI 48
JDBC 49
Java EE APIs 49
Contexts and Dependency Injection 49
JTA 50
Java EE Connector Architecture 51
EJB 51
Session EJBs 52
Persistence Entities 53
Service-Orientation Principles and the EJB Model 55
JMS 56
Message-Driven Beans 58
Security in Java EE 58
4.3 XML Standards and Java APIs 59
XML 59
XML Schema Definition 61
XSLT 63
JAXP 63
JAXB 64
4.4 Building Services with Java Components 64
Components as Services 65
Application Protocols 65
Service Contracts 68
Location 68
Operations 69
Messages 69
Further Considerations 70
Components as Services and Service-Orientation 71
Standardized Service Contract 71
Service Loose Coupling 71
Service Abstraction 72
Service Discoverability 72
4.5 Java Vendor Platforms 74
GlassFish Enterprise Server 74
IBM WebSphere Application Server 75
IBM WebSphere Application Server Community Edition 78
Oracle WebLogic Server 79
CHAPTER 5: Web-Based Service Technologies 81
5.1 SOAP-Based Web Services 82
Extensibility of Web Services Standards (WS-*) 88
WS-Addressing 89
SOAP with Attachments (SwA) 90
WS-ReliableMessaging 91
WS-Transaction 92
WS-Security 93
WS-Policy 94
Web Services Distributed Management 95
Common Web Services Middleware 95
Enterprise Service Bus (ESB) 95
Orchestration 97
Management and Monitoring 99
Registries and Repositories 99
Service Construction and Assembly 100
5.2 REST Services 101
HTTP Response Codes 102
Resources and Addresses 103
Service Request 104
Service Response 104
Service Request 104
Service Response 104
HTTP Methods 106
Resource Representations 108
The ACCEPT Header 109
CHAPTER 6: Building Web-Based Services with Java 111
6.1 JAX-WS 112
SAAJ 115
Handlers 118
Web Services Engines and Toolkits 119
JAXR 120
6.2 Java Implementations of WS-* Standards 122
Advanced Web Services Standards and Frameworks 122
Service Component Architecture 123
Spring-WS 124
6.3 JAX-RS 124
Implementing JAX-RS 125
Implementing REST Services 129
Scalability 130
Statelessness 131
Uniform Contract 131
Cacheability 131
Addressability 132
Security 132
REST Service Support 134
PART II: SERVICES
CHAPTER 7: Service-Orientation Principles with Java Web-Based Services 139
7.1 Service Reusability 140
Agnostic Functional Contexts 140
Highly Generic Service Logic 141
Generic and Extensible Service Contracts 144
Concurrent Access to Service Logic 145
7.2 Standardized Service Contract 151
Top-Down vs. Bottom-Up 151
Mapping Between Java and WSDL 152
Wrapped Document/Literal Contracts 153
Implicit and Explicit Headers 154
Explicit Headers 154
Implicit Headers 157
No Headers 159
Data Mapping with REST 159
Conversion Between JSON and POJOs 161
Binary Data in Web Services 165
Binary Data in REST Services 170
Use of Industry Standards 175
7.3 Service Loose Coupling 176
Separation of Contract and Implementation 177
Independent Functional Contexts 179
Service Consumer Coupling 180
7.4 Service Abstraction 184
Abstracting Technology Details 185
Hiding Service Details 185
Document Constraints 188
7.5 Service Composability 189
Runtime Environment Efficiency 190
Service Contract Flexibility 192
Standards-Based Runtime 193
7.6 Service Autonomy 194
Well-Defined Functional Boundary 194
Runtime Environment Control 195
High Concurrency 196
7.7 Service Statelessness 197
Orchestration Infrastructure 198
Session State 198
Storing State 199
7.8 Service Discoverability 204
Design-Time Discoverability 204
Runtime Discoverability 205
Service Registries 208
CHAPTER 8: Utility Services with Java 211
8.1 Inside the Java Utility Service 212
Architectural Considerations 212
Utility Service Taxonomy 220
8.2 Utility Service Design and Implementation 221
Utility Service Design 221
Utility Services and Java Editions 226
Utility Services in Java SE 226
Utility Services in Java EE 227
Utility Services and Open-Source Frameworks 229
Spring Framework 229
Transaction Management 229
Data Access Objects 230
Object-Relational Mapping 230
JMS 230
JMX 230
JCA 231
Spring MVC 231
Hibernate 231
Commons Logging and Log4J 231
Utility Services as Web-Based Services 231
Sending XML Data as a String 232
Utilizing <xsd:any/> 233
Provider-Style Web Service Logic in JAX-WS 234
Building REST Utility Services 236
Testing Considerations 238
Packaging Considerations 239
8.3 Utility Service Types 240
Omni Utility Services 240
Design Considerations 241
Service Implementation 241
Service Consumption 241
Resource Utility Services 248
Persistence/Data Access Resources 248
Messaging Resources 248
Transaction Resources 249
Design Considerations 249
Service Implementation 251
Service Consumption 251
Micro-Utility Services 253
Design Considerations 253
Service Implementation 253
Service Consumption 254
Wrapper Utility Services 257
Design Considerations 258
Service Implementation 259
Service Consumption 259
CHAPTER 9: Entity Services with Java 261
9.1 Inside the Java Entity Service 262
Architectural Considerations 263
Domain Entities vs. Message Entities 265
Data Aggregation 266
Data Access Modes 267
Change Notifications 268
9.2 Java Entity Service Design and Implementation 270
Entity Service Design 270
Designing Domain Entities and Message Entities 271
Designing Stateless Entity Services 272
Designing Business-Relevant Entity Services 273
Designing Generic Entity Services 273
Designing Aggregating Entity Services 275
Entity Service Implementation 278
Java Editions 278
Entity Services as Web-Based Services 282
Entity Web Services Using SOAP 283
REST Entity Services 291
Read-Only and Read-Write Resources 292
Resource Granularity 292
Resource Creation and Location 292
Request Message 292
Response Message 293
Resource Relationships 294
Request Message 294
Response Message 294
Request Message 295
Resource Collections 295
Request Message 295
Response Message 295
Aggregate Entities 297
Request Message 298
Response Message 298
Open-Source Frameworks 302
Testing Considerations 302
Java Packaging Considerations 303
PART III: SERVICE COMPOSITION AND INFRASTRUCTURE
CHAPTER 10: Task Services with Java 307
10.1 Inside a Task Service 308
Performance Considerations 315
10.2 Building Task Services 316
Implementation Considerations 316
Web-Based Task Services 320
Task Services with SOAP and WSDL 320
Task Services with REST 324
Testing Considerations 332
Packaging Considerations 334
CHAPTER 11: Service Composition with Java 335
11.1 Inside Service Compositions 336
Service Composition Roles 336
Compositions and MEPs 337
Synchronous and Asynchronous Invocation 338
Service Level Agreements (SLAs) 339
11.2 Java Service Composition Design and Implementation 340
Composition Logic: Coding vs. Orchestration 340
REST Service Composition Considerations 341
Composition Member Endpoints 344
Error Handling 345
Schema Type Reuse 353
Web-Based Services vs. Java Components 359
Packaging, Testing and Deploying Composed Services 362
11.3 Service and Service Composition Performance Guidelines 368
Measuring Performance 368
Testing Performance 370
Caching 371
Data Grids 371
REST Caching 372
Scaling Out Services with State 374
Handling Failures 375
Parsing and Marshaling 376
CHAPTER 12: ESB as SOA Infrastructure 379
12.1 Basic Traditional Messaging Frameworks 380
RPC vs. Messaging 381
Technology Coupling 82
Spatial Coupling 382
Temporal Coupling 382
Message Producers and Message Consumers 385
12.2 Basic Service Messaging Frameworks 389
Basic Service Message Processing without ESBs 389
Message Routing without an ESB 390
Message Transformation without an ESB 391
Basic Service Message Processing with ESBs 392
Message Routing with an ESB 392
Message Transformation with an ESB 392
12.3 Common ESB Features Relevant to SOA 397
Service Lookup and Invocation 397
Service Processing 399
Service Composition Support 401
REST API Management Support 402
PART IV: APPENDICES
APPENDIX A: Case Study Conclusion 405
A.1 NovoBank 406
A.2 SmartCredit Co. 407
APPENDIX B: Service-Orientation Principles Reference 409
APPENDIX C: SOA Design Patterns Reference 425
APPENDIX D: The Annotated SOA Manifesto 519
About the Authors 533
About the Foreword Contributor 535
About the Contributors 537
Index 539