Designing Enterprise applications with the J2EE platform

Free Download

Authors:

Edition: 2nd ed

Series: The Java series

ISBN: 9780201787900, 0-201-78790-3

Size: 5 MB (5455015 bytes)

Pages: 440/440

File format:

Language:

Publishing Year:

Category:

Inderjeet Singh, Beth Stearns, Mark Johnson, Enterprise Team The9780201787900, 0-201-78790-3

As part of the highly regarded Java BluePrints program, Designing Enterprise Applications with the J2EET Platform, Second Edition, describes the key architectural and design issues in applications supported by the J2EET platform and offers practical guidelines for both architects and developers. It explores key J2EE platform features such as Java servlets, JavaServer PagesT, and Enterprise JavaBeansT component models, as well as the JDBCT API, Java Message Service API, and J2EE Connector Architecture. It also discusses security, deployment, transaction management, internationalization, and other important issues for today’s applications.Through code samples and a full e-commerce application example, this book provides concrete guidelines to mastering the J2EE platform. Highlights include: * An introduction to the J2EE platform, the applications it supports, and the technologies it provides * Discussions on how to design Web-based applications using Java servlet and JavaServer Pages technologies * Architectural guidelines for designing Enterprise JavaBeans components for scalability, reliability, and performance * How to connect J2EE applications to existing systems and applications using JDBC and J2EE Connector technologies * Design motivations behind the widely used Java Pet Store demo application * A glossary of J2EE and enterprise computing terminology

Table of contents :
Foreword……Page 13
Preface……Page 15
About the Authors……Page 19
Introduction……Page 23
1.1 Challenges of Enterprise Application Development……Page 24
1.1.1 Programming Productivity……Page 25
1.1.4 Response to Demand……Page 26
1.2 The Platform for Enterprise Solutions……Page 27
1.2.1.1 Multitier Model……Page 28
1.2.1.3 Support for Client Components……Page 29
1.2.1.4 Support for Business Logic Components……Page 30
1.2.1.5 Support for the J2EE Standard……Page 31
1.2.2.1 Simplified Architecture and Development……Page 32
1.2.2.2 Integrating Existing Enterprise Information Systems……Page 34
1.2.2.3 Choice of Servers, Tools, and Components……Page 35
1.3 J2EE Application Scenarios……Page 36
1.3.1 Multitier Application Scenario……Page 38
1.3.2 Stand-Alone Client Scenario……Page 40
1.3.3 Web-Centric Application Scenario……Page 41
1.3.4 Business-to-Business Scenario……Page 42
1.4 How This Book Is Organized……Page 43
1.6 References and Resources……Page 45
2.1 Component Technologies……Page 47
2.1.1 Types of J2EE Clients……Page 48
2.1.2.1 Servlets……Page 49
2.1.3 Enterprise JavaBeans Components……Page 50
2.1.3.2 Entity Beans……Page 51
2.1.3.4 EJB Component Containers……Page 52
2.1.4 Components, Containers, and Services……Page 53
2.2 Platform Roles……Page 54
2.2.2 Application Component Provider……Page 55
2.2.6 Tool Provider……Page 56
2.3.1 Naming Services……Page 57
2.3.2.1 Deployment Units……Page 58
2.3.3 Transaction Services……Page 59
2.3.3.2 Web Component Transactions……Page 60
2.3.3.3 Enterprise Bean Transactions……Page 61
2.3.4.2 Authentication……Page 62
2.3.4.3 Authorization……Page 63
2.4.1 JDBC API……Page 64
2.4.4 J2EE Connector Architecture……Page 65
2.4.5 Java API for XML Processing Technology……Page 66
2.5.1 Internet Protocols……Page 67
2.5.3.2 RMI-IIOP……Page 68
2.5.4.1 Java Message Service API……Page 69
2.5.4.2.1 JavaBeans Activation Framework API……Page 70
2.5.5 Data Formats……Page 71
2.7 References and Resources……Page 72
3.1 Client Considerations……Page 73
3.1.2 Security Considerations……Page 74
3.1.3 Platform Considerations……Page 75
3.3 Design Issues and Guidelines for Browser Clients……Page 76
3.3.1 Presenting the User Interface……Page 77
3.3.2 Validating User Inputs……Page 78
3.3.3 Communicating with the Server……Page 80
3.3.4 Managing Conversational State……Page 81
3.4.0.0.1 Application Clients……Page 82
3.4.1 Presenting the User Interface……Page 83
3.4.2 Validating User Inputs……Page 86
3.4.3.0.1 Web Clients……Page 87
3.4.3.0.2 EJB Clients……Page 90
3.4.4 Managing Conversational State……Page 91
3.5 Summary……Page 94
3.6 References and Resources……Page 95
4.1 The Purpose of the Web Tier……Page 97
4.2.1 Traditional Web-Tier Technologies……Page 98
4.2.3 The Web Container……Page 100
4.2.4 Java Servlets……Page 101
4.2.5.1 XML JSP Page Syntax……Page 102
4.2.5.3 Standard Tag Libraries……Page 103
4.2.6.1.2 Use Servlets as Controllers……Page 104
4.2.6.1.3 Use Servlets to Generate Binary Content……Page 105
4.2.6.2 Avoid Writing Servlets That Print Mostly Static Text……Page 106
4.2.6.3 Use RequestDispatcher Methods forward and include Correctly……Page 107
4.2.6.4.2 Use JSP Pages to Generate XML……Page 108
4.2.6.7 Use JSP Include Directives and Tags Appropriately……Page 109
4.2.6.8 Using Custom Tags to Avoid Scriptlets……Page 111
4.3 Web-Tier Application Structure……Page 113
4.4 Web-Tier Application Framework Design……Page 116
4.4.1 Structuring the Web Tier……Page 118
4.4.1.0.1 When to Switch from Model 1 to Model 2……Page 119
4.4.2.1.1 Identifying the Operation to Perform……Page 120
4.4.2.1.2 Invoking Model Methods……Page 122
4.4.2.1.3 Controlling Dynamic Screen Flow……Page 125
4.4.2.1.4 Example……Page 127
4.4.2.2 Serving Multiple Client Types……Page 129
4.4.3.1 Templating……Page 132
4.4.4 Web-Tier MVC Model Design……Page 135
4.4.5 Web Application Frameworks……Page 136
4.4.6 Separating Business Logic from Presentation……Page 137
4.4.7.1 State Scope……Page 138
4.4.7.2 Performance Implications of State Scope……Page 139
4.4.7.3.1 Maintain Session State with Stateful Session Beans……Page 140
4.4.7.3.2 Maintain Web-Tier Session State in Session Attributes……Page 141
4.4.7.3.3 Share Data among Servlets and JSP Pages with JavaBeans Components……Page 142
4.4.7.3.4 Avoid Using Cookies Directly……Page 144
4.4.8 Distributable Web Applications……Page 145
4.4.8.2 Distributed Conversational State……Page 146
4.4.8.3 Distributable Servlet Restrictions……Page 147
4.5 Summary……Page 148
4.6 References and Resources……Page 149
The Enterprise JavaBeans Tier……Page 151
5.1 Business Logic and Business Objects……Page 152
5.1.1 Common Requirements of Business Objects……Page 153
5.1.1.3 Participate in Transactions……Page 154
5.1.1.7 Control Access……Page 155
5.2 Enterprise Beans as J2EE Business Objects……Page 156
5.2.1 Enterprise Beans and EJB Containers……Page 158
5.2.1.1 Home Interface……Page 160
5.2.1.3 Enterprise Bean Class……Page 161
5.3 Remote and Local Client Views……Page 162
5.3.1 Guidelines for Using Local or Remote Client Views……Page 163
5.4 Entity Beans……Page 164
5.4.1 Guidelines for Using Entity Beans……Page 165
5.4.2 Entity Bean Persistence……Page 166
5.4.2.1 Example: A Customer Account Bean……Page 167
5.4.2.2 Container-Managed Relationships……Page 168
5.4.2.3 EJB QL, the EJB Query Language……Page 169
5.4.2.4 Benefits of EJB 2.0 Container-Managed Persistence……Page 170
5.4.3 When to Use Bean-Managed Persistence……Page 171
5.5.1.1 Uses of Stateful Session Beans……Page 172
5.5.2 Stateless Session Beans……Page 173
5.5.2.2 Example: A Catalog Bean……Page 174
5.6 Message-Driven Beans……Page 175
5.6.1 Uses of Message-Driven Beans……Page 176
5.6.2 Example: Invoice Message-Driven Bean……Page 177
5.7 Design Guidelines……Page 178
5.7.2 Session Beans as a Facade to Entity Beans……Page 179
5.7.3 Fine-Grained versus Coarse-Grained Object Access……Page 180
5.7.3.1 Example: An Address Value Object……Page 181
5.7.5 Data Access Objects……Page 182
5.7.5.1 Clarifying Bean Implementations……Page 183
5.7.5.2 Consequences of Using DAO Pattern……Page 184
5.7.7 Representing References to Entity Beans……Page 185
5.8 Portability Guidelines……Page 186
5.8.2 Mark Non-Serializable Fields Transient……Page 187
5.8.3.1 SQL and Database Connections……Page 188
5.8.3.3 Avoid Exposing Resource-Specific Details……Page 189
5.9 Summary……Page 190
5.10 References and Resources……Page 192
Integrating with the Enterprise Information System Tier……Page 193
6.1.1 An Internet E-Store Application……Page 194
6.1.3 A Distributed Purchasing Application……Page 196
6.2 J2EE Integration Technologies……Page 198
6.2.1 J2EE Connector Architecture……Page 199
6.2.2 Java Message Service API……Page 201
6.2.3 JDBC and RDBMS Access……Page 202
6.3 Application Integration Design Approaches……Page 203
6.3.1 Synchronous Integration……Page 204
6.3.2 Asynchronous Integration……Page 205
6.3.4 Data Integration……Page 207
6.4 Developing an Integration Layer……Page 208
6.4.2 Using Tools for EIS Integration……Page 209
6.4.3 Developing EIS Access Objects……Page 210
6.4.3.1.1 Command Beans……Page 211
6.4.3.1.2 Data Access Objects……Page 212
6.4.3.3 Guidelines for Access Objects……Page 214
6.4.4 Guidelines for Connection Management……Page 215
6.4.4.1 Connection Management by Component Type……Page 217
6.4.5.1 EIS Sign On……Page 218
6.4.5.1.1 Container-Managed Sign On……Page 219
6.4.5.1.2 Application-Managed Sign On……Page 220
6.5 Summary……Page 221
6.6 References and Resources……Page 222
7.1 Packaging Components……Page 223
7.2 Roles and Tasks……Page 225
7.2.1 Application Component Provider Tasks……Page 226
7.2.3 Deployer Tasks……Page 228
7.3 Packaging J2EE Applications……Page 229
7.3.2.1 Packaging Components into EJB Modules……Page 232
7.3.2.1.2 Grouping Interrelated Beans……Page 234
7.3.2.2 Local Interfaces in the JNDI Namespace……Page 235
7.3.3 Web Modules……Page 236
7.3.4.1 Request Path Elements……Page 237
7.3.4.2 Web Application Directory Structure……Page 238
7.3.4.4 Decoupling Application Components……Page 240
7.3.4.5 Cross-Linked Static Content……Page 242
7.3.4.6 Logical Grouping of Functionality……Page 243
7.3.5 Application Client Modules……Page 244
7.4 Deployment Descriptors……Page 245
7.4.1.0.1 Parameterized Component Behavior……Page 246
7.4.2 Specifying Deployment Descriptor Elements……Page 247
7.4.2.1.1 Declaring Environment Entries……Page 248
7.4.2.1.2 Declaring and Resolving References to Enterprise Beans……Page 249
7.4.2.1.3 Declaring References to Connection Factories……Page 253
7.4.2.1.4 Declaring Resource Environment References……Page 255
7.4.2.1.5 Security Elements……Page 256
7.4.2.2.1 Transaction Elements……Page 257
7.4.2.2.2 Persistence Elements……Page 258
7.4.2.3.2 Servlet Mapping……Page 259
7.4.2.3.4 Form-Based Authentication Configuration……Page 260
7.4.3 Naming Convention Recommendations……Page 261
7.4.3.0.2 Naming Enterprise Bean References……Page 262
7.4.3.0.4 Naming Environment Resource References……Page 263
7.5.1 Deployment Tool Actions……Page 264
7.5.2.1 Vendor-Specific Deployment Information……Page 266
7.5.2.2 Single Point of Entry for Deployment……Page 268
7.5.2.4 Undeployment Capability……Page 269
7.6 Summary……Page 270
7.7 References and Resources……Page 271
8.1 Transactional Concepts……Page 273
8.1.1 ACID Transaction Properties……Page 274
8.1.4 Distributed Transactions……Page 275
8.1.5 Two-Phase Commit Protocol……Page 277
8.2.1 Accessing Multiple Resources within a Transaction……Page 278
8.2.1.0.1 Example: Transactions across Multiple Resource Managers……Page 279
8.2.2.0.1 Example: Transactions across J2EE Servers……Page 280
8.3.0.0.1 Java Transaction API (JTA)……Page 281
8.4 Client Tier Transactions……Page 282
8.5 Web Tier Transaction Guidelines……Page 283
8.6 Enterprise JavaBeans Tier Transactions……Page 284
8.6.1 Bean-Managed Transaction Demarcation……Page 285
8.6.3 Transaction Attributes……Page 286
8.6.3.0.4 Supports……Page 287
8.6.4.1 Transaction Attributes Guidelines……Page 288
8.6.4.2 Container-Managed Persistence Transaction Attributes Guidelines……Page 289
8.7.1 JTA Transactions……Page 290
8.7.4 Compensating Transactions……Page 291
8.7.4.1 Compensating Transaction Guidelines……Page 293
8.7.5 Isolation Level……Page 294
8.8.1 JDBC Databases……Page 295
8.8.3 J2EE Connector Architecture……Page 296
8.9 Summary……Page 298
8.10 References and Resources……Page 299
9.1 Security Threats and Mechanisms……Page 301
9.2 Authentication……Page 302
9.2.1 Protection Domains……Page 303
9.2.2.1 Web Tier Authentication……Page 306
9.2.2.1.1 Authentication Configuration……Page 307
9.2.2.1.2 Hybrid Authentication……Page 308
9.2.2.2 EJB Tier Authentication……Page 309
9.2.2.2.1 Common Secure Interoperability (CSIv2)……Page 310
9.2.2.3 Client Identity Selection……Page 311
9.2.2.4 Enterprise Information System Tier Authentication……Page 313
9.2.3.1 Self-Registration……Page 314
9.3 Authorization……Page 315
9.3.1 Declarative Authorization……Page 316
9.3.2 Programmatic Authorization……Page 317
9.3.4 Isolation……Page 318
9.3.6 Encapsulation for Access Control……Page 319
9.3.7 Controlling Access to J2EE Resources……Page 320
9.3.7.2 Controlling Access to Enterprise Beans……Page 321
9.3.7.3 Unprotected Resources……Page 323
9.3.8 Example……Page 324
9.4.1 Integrity Mechanisms……Page 326
9.4.3 Identifying Sensitive Components……Page 327
9.4.4 Ensuring Confidentiality of Web Resources……Page 328
9.5 Auditing……Page 329
9.6 Summary……Page 330
9.7 References and Resources……Page 331
J2EE Internationalization and Localization……Page 333
10.1.1 Internationalization, Localization, and Locale……Page 334
10.1.2.2 ASCII……Page 335
10.1.3 Encodings……Page 336
10.1.3.5 UTF-8……Page 337
10.2.1 Resource Bundles……Page 338
10.2.2 Message Formatting……Page 341
10.2.4 Collation……Page 342
10.3.1.1 Determining HTTP Request Locale and Encoding……Page 343
10.3.1.2 Storing Locale and Encoding at Runtime……Page 345
10.3.1.3 Setting HTTP Response Locale and Encoding……Page 346
10.3.2 Presentation Component Design……Page 347
10.3.2.3.1 Example……Page 348
10.3.3 Internationalizing and Localizing JSP Pages……Page 349
10.3.3.4 Localizing JSP Pages with Resource Bundles……Page 350
10.3.3.5 Locale-Specific JSP Pages……Page 352
10.4.1.0.1 Value Conversion, Value Representation, and Information Loss……Page 354
10.4.2 Internationalizing Database Schema……Page 356
10.5 Internationalized Application Design……Page 358
10.6.1 Generating Localized Dynamic Content with XSLT……Page 359
10.6.3 Communicating Locale among Applications……Page 360
10.7.1 Client Messages and Application Exceptions……Page 363
10.7.1.0.2 Servlet Error Mechanism……Page 364
10.7.1.0.3 Localizing Error Messages……Page 365
10.7.2 System Exceptions and Message Logging……Page 366
10.9 References and Resources……Page 367
Architecture of the Sample Application……Page 369
11.1.1 Model-View-Controller Architecture……Page 370
11.1.2 J2EE Design Patterns……Page 372
11.2 Sample Application Overview……Page 374
11.3 Designing the Sample Application……Page 375
11.3.1 Choosing Application Tiers……Page 377
11.3.2.1 Comparison of Local and Distributed Architectures……Page 379
11.3.2.2 J2EE Platform Distributed and Local Options……Page 380
11.4 Architecture of the Sample Application……Page 381
11.4.1 Application Web Site Architecture……Page 382
11.4.1.1 View Layer of the Application Architecture……Page 388
11.4.1.2 Model Layer of the Application Architecture……Page 391
11.4.1.3 Controller Layer of the Application Architecture……Page 393
11.4.1.4 Applying MVC Architecture to Web Application……Page 394
11.4.2 Fulfillment Center Architecture……Page 397
11.5 Summary……Page 404
11.6 References and Resources……Page 405
Afterword……Page 407
Glossary……Page 409
B……Page 427
C……Page 428
D……Page 429
E……Page 430
J……Page 432
M……Page 434
P……Page 435
S……Page 436
T……Page 437
W……Page 438
X……Page 439

Reviews

There are no reviews yet.

Be the first to review “Designing Enterprise applications with the J2EE platform”
Shopping Cart
Scroll to Top