Home Page Icon
Home Page
Table of Contents for
PROFESSIONAL Java® EE Design Patterns
Close
PROFESSIONAL Java® EE Design Patterns
by Alex Theedom, Murat Yener
Professional Java EE Design Patterns
FOREWORD
INTRODUCTION
WHO THIS BOOK IS FOR
WHAT THIS BOOK COVERS
HOW THIS BOOK IS STRUCTURED
WHAT YOU NEED TO USE THIS BOOK
MOTIVATION FOR WRITING
CONVENTIONS
SOURCE CODE
ERRATA
P2P.WROX.COM
CONTACT THE AUTHORS
NOTES
PART I INTRODUCTION TO JAVA EE DESIGN PATTERNS
CHAPTER 1 A BRIEF OVERVIEW OF DESIGN PATTERNS
WHAT IS A DESIGN PATTERN?
DESIGN PATTERN BASICS
ENTERPRISE PATTERNS
SUMMARY
NOTES
CHAPTER 2 THE BASICS OF JAVA EE
MULTITIER ARCHITECTURE
THE CLIENT TIER
THE MIDDLE TIER
THE EIS TIER
JAVA EE SERVERS
THE JAVA EE WEB PROFILE
CORE PRINCIPLES OF JAVA EE
CONVENTION OVER CONFIGURATION
CONTEXT AND DEPENDENCY INJECTION
INTERCEPTORS
SUMMARY
EXERCISES
PART II IMPLEMENTING DESIGN PATTERNS IN JAVA EE
CHAPTER 3 FAÇADE PATTERN
WHAT IS A FAÇADE?
IMPLEMENTING THE FAÇADE PATTERN IN PLAIN CODE
IMPLEMENTING THE FAÇADE PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE FAÇADE PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 4 SINGLETON PATTERN
WHAT IS A SINGLETON?
IMPLEMENTING THE SINGLETON PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE SINGLETON PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 5 DEPENDENCY INJECTION AND CDI
WHAT IS DEPENDENCY INJECTION?
IMPLEMENTING DI IN PLAIN CODE
IMPLEMENTING DI IN JAVA EE
SUMMARY
EXERCISES
NOTES
CHAPTER 6 FACTORY PATTERN
WHAT IS A FACTORY?
FACTORY METHOD
ABSTRACT FACTORY
IMPLEMENTING THE FACTORY PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE FACTORY PATTERNS
SUMMARY
EXERCISES
NOTES
CHAPTER 7 DECORATOR PATTERN
WHAT IS A DECORATOR?
IMPLEMENTING THE DECORATOR PATTERN IN PLAIN CODE
IMPLEMENTING THE DECORATOR PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE DECORATOR PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 8 ASPECT-ORIENTED PROGRAMMING (INTERCEPTORS)
WHAT IS ASPECT-ORIENTED PROGRAMMING?
IMPLEMENTING AOP IN PLAIN CODE
ASPECTS IN JAVA EE, INTERCEPTORS
WHERE AND WHEN TO USE INTERCEPTORS
SUMMARY
NOTES
CHAPTER 9 ASYNCHRONOUS
WHAT IS ASYNCHRONOUS PROGRAMMING?
IMPLEMENTING ASYNCHRONOUS PATTERN IN PLAIN CODE
ASYNCHRONOUS PROGRAMMING IN JAVA EE
WHERE AND WHEN TO USE ASYNCHRONOUS PROGRAMMING
SUMMARY
EXERCISES
NOTES
CHAPTER 10 TIMER SERVICE
WHAT IS THE TIMER SERVICE?
IMPLEMENTING A TIMER IN JAVA EE
SUMMARY
EXERCISES
NOTES
CHAPTER 11 OBSERVER PATTERN
WHAT IS AN OBSERVER?
IMPLEMENTING THE OBSERVER PATTERN IN PLAIN CODE
IMPLEMENTING THE OBSERVER PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE OBSERVER PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 12 DATA ACCESS PATTERN
WHAT IS A DATA ACCESS PATTERN?
OVERVIEW OF THE DATA ACCESS PATTERN
IMPLEMENTING THE DATA ACCESS PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE DATA ACCESS PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 13 RESTFUL WEB SERVICES
WHAT IS REST?
THE SIX CONSTRAINTS OF REST
RICHARDSON MATURITY MODEL OF REST API
DESIGNING A RESTFUL API
REST IN ACTION
IMPLEMENTING REST IN JAVA EE
HATEOAS
WHERE AND WHEN TO USE REST
SUMMARY
EXERCISES
NOTES
CHAPTER 14 MODEL VIEW CONTROLLER PATTERN
WHAT IS THE MVC DESIGN PATTERN?
IMPLEMENTING THE MVC PATTERN IN PLAIN CODE
IMPLEMENTING THE MVC PATTERN IN JAVA EE
THE FACESSERVLET
MVC USING THE FACESSERVLET
WHERE AND WHEN TO USE THE MVC PATTERN
SUMMARY
EXERCISES
NOTE
CHAPTER 15 OTHER PATTERNS IN JAVA EE
WHAT ARE WEBSOCKETS?
WHAT IS MESSAGE-ORIENTATED MIDDLEWARE
WHAT IS THE MICROSERVICE ARCHITECTURE?
FINALLY, SOME ANTI-PATTERNS
NOTES
PART III SUMMARY
CHAPTER 16 DESIGN PATTERNS: THE GOOD, THE BAD, AND THE UGLY
THE GOOD: PATTERNS FOR SUCCESS
THE BAD: OVER AND MISUSE OF PATTERNS
…AND THE UGLY
SUMMARY
NOTES
TITLEPAGE
COPYRIGHT
DEDICATION
ABOUT THE AUTHORS
ABOUT THE TECHNICAL EDITOR
CREDITS
ACKNOWLEDGMENTS
ADVERT
WILEY END USER LICENSE AGREEMENT
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Prev
Previous Chapter
Wiley Template v5.0
Next
Next Chapter
FOREWORD
CONTENTS
FOREWORD
INTRODUCTION
WHO THIS BOOK IS FOR
WHAT THIS BOOK COVERS
HOW THIS BOOK IS STRUCTURED
WHAT YOU NEED TO USE THIS BOOK
MOTIVATION FOR WRITING
CONVENTIONS
SOURCE CODE
ERRATA
P2P.WROX.COM
CONTACT THE AUTHORS
NOTES
PART I INTRODUCTION TO JAVA EE DESIGN PATTERNS
CHAPTER 1 A BRIEF OVERVIEW OF DESIGN PATTERNS
WHAT IS A DESIGN PATTERN?
DESIGN PATTERN BASICS
ENTERPRISE PATTERNS
SUMMARY
NOTES
CHAPTER 2 THE BASICS OF JAVA EE
MULTITIER ARCHITECTURE
THE CLIENT TIER
THE MIDDLE TIER
THE EIS TIER
JAVA EE SERVERS
THE JAVA EE WEB PROFILE
CORE PRINCIPLES OF JAVA EE
CONVENTION OVER CONFIGURATION
CONTEXT AND DEPENDENCY INJECTION
INTERCEPTORS
SUMMARY
EXERCISES
PART II IMPLEMENTING DESIGN PATTERNS IN JAVA EE
CHAPTER 3 FAÇADE PATTERN
WHAT IS A FAÇADE?
IMPLEMENTING THE FAÇADE PATTERN IN PLAIN CODE
IMPLEMENTING THE FAÇADE PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE FAÇADE PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 4 SINGLETON PATTERN
WHAT IS A SINGLETON?
IMPLEMENTING THE SINGLETON PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE SINGLETON PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 5 DEPENDENCY INJECTION AND CDI
WHAT IS DEPENDENCY INJECTION?
IMPLEMENTING DI IN PLAIN CODE
IMPLEMENTING DI IN JAVA EE
SUMMARY
EXERCISES
NOTES
CHAPTER 6 FACTORY PATTERN
WHAT IS A FACTORY?
FACTORY METHOD
ABSTRACT FACTORY
IMPLEMENTING THE FACTORY PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE FACTORY PATTERNS
SUMMARY
EXERCISES
NOTES
CHAPTER 7 DECORATOR PATTERN
WHAT IS A DECORATOR?
IMPLEMENTING THE DECORATOR PATTERN IN PLAIN CODE
IMPLEMENTING THE DECORATOR PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE DECORATOR PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 8 ASPECT-ORIENTED PROGRAMMING (INTERCEPTORS)
WHAT IS ASPECT-ORIENTED PROGRAMMING?
IMPLEMENTING AOP IN PLAIN CODE
ASPECTS IN JAVA EE, INTERCEPTORS
WHERE AND WHEN TO USE INTERCEPTORS
SUMMARY
NOTES
CHAPTER 9 ASYNCHRONOUS
WHAT IS ASYNCHRONOUS PROGRAMMING?
IMPLEMENTING ASYNCHRONOUS PATTERN IN PLAIN CODE
ASYNCHRONOUS PROGRAMMING IN JAVA EE
WHERE AND WHEN TO USE ASYNCHRONOUS PROGRAMMING
SUMMARY
EXERCISES
NOTES
CHAPTER 10 TIMER SERVICE
WHAT IS THE TIMER SERVICE?
IMPLEMENTING A TIMER IN JAVA EE
SUMMARY
EXERCISES
NOTES
CHAPTER 11 OBSERVER PATTERN
WHAT IS AN OBSERVER?
IMPLEMENTING THE OBSERVER PATTERN IN PLAIN CODE
IMPLEMENTING THE OBSERVER PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE OBSERVER PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 12 DATA ACCESS PATTERN
WHAT IS A DATA ACCESS PATTERN?
OVERVIEW OF THE DATA ACCESS PATTERN
IMPLEMENTING THE DATA ACCESS PATTERN IN JAVA EE
WHERE AND WHEN TO USE THE DATA ACCESS PATTERN
SUMMARY
EXERCISES
NOTES
CHAPTER 13 RESTFUL WEB SERVICES
WHAT IS REST?
THE SIX CONSTRAINTS OF REST
RICHARDSON MATURITY MODEL OF REST API
DESIGNING A RESTFUL API
REST IN ACTION
IMPLEMENTING REST IN JAVA EE
HATEOAS
WHERE AND WHEN TO USE REST
SUMMARY
EXERCISES
NOTES
CHAPTER 14 MODEL VIEW CONTROLLER PATTERN
WHAT IS THE MVC DESIGN PATTERN?
IMPLEMENTING THE MVC PATTERN IN PLAIN CODE
IMPLEMENTING THE MVC PATTERN IN JAVA EE
THE FACESSERVLET
MVC USING THE FACESSERVLET
WHERE AND WHEN TO USE THE MVC PATTERN
SUMMARY
EXERCISES
NOTE
CHAPTER 15 OTHER PATTERNS IN JAVA EE
WHAT ARE WEBSOCKETS?
WHAT IS MESSAGE-ORIENTATED MIDDLEWARE
WHAT IS THE MICROSERVICE ARCHITECTURE?
FINALLY, SOME ANTI-PATTERNS
NOTES
PART III SUMMARY
CHAPTER 16 DESIGN PATTERNS: THE GOOD, THE BAD, AND THE UGLY
THE GOOD: PATTERNS FOR SUCCESS
THE BAD: OVER AND MISUSE OF PATTERNS
…AND THE UGLY
SUMMARY
NOTES
TITLEPAGE
COPYRIGHT
DEDICATION
ABOUT THE AUTHORS
ABOUT THE TECHNICAL EDITOR
CREDITS
ACKNOWLEDGMENTS
ADVERT
WILEY END USER LICENSE AGREEMENT
List of Tables
Chapter 10
Table 10.1
Table 10.2
Table 10.3
Table 10.4
List of Illustrations
Chapter 1
Figure 1.1 A class diagram showing inheritance
Figure 1.2 The singleton pattern class diagram
Chapter 2
Figure 2.1 Multitier architecture showing the interaction between tiers
Figure 2.2 Technology used in the Web and Business layers
Chapter 3
Figure 3.1 Class diagram of the façade pattern
Chapter 4
Figure 4.1 The singleton pattern class diagram
Chapter 6
Figure 6.1 The class diagram shows the structure of the factory method pattern. You can see how the object creation is encapsulated in the subclasses.
Figure 6.2 As can be seen in the class diagram, you can use the abstract factory pattern to group existing factories and encapsulate how you access them.
Chapter 7
Figure 7.1 Class diagram of the decorator pattern
Chapter 9
Figure 9.1 Asynchronous flow diagram
Chapter 11
Figure 11.1 Class diagram of the observer pattern
Chapter 12
Figure 12.1 Class diagram of the data access pattern
Chapter 14
Figure 14.1 Diagram of the model view controller pattern
Figure 14.2 Diagram of Spring’s MVC implementation
Chapter 15
Figure 15.1 Point-to-point implementation
Figure 15.2 Publish/subscribe implementation
Figure 15.3 Monolithic architecture
Figure 15.4 The AKF cube should have X-, Y-, and Z-axis scaling.
Figure 15.5 Y-axis decomposition
Guide
Cover
Table of Contents
Part
Pages
xxv
xxvi
xxvii
xxviii
xxix
xxx
1
3
4
5
6
7
8
9
10
11
13
14
15
16
17
18
19
20
21
22
23
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
153
154
155
156
157
158
159
160
161
162
163
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
195
196
197
198
199
200
201
202
203
204
205
206
207
209
210
211
212
213
214
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset