𝔖 Scriptorium
✦   LIBER   ✦

πŸ“

Designing Enterprise Applications with the J2EE Platform, 2nd Edition

✍ Scribed by Inderjeet Singh


Publisher
Prentice Hall
Year
2002
Tongue
English
Leaves
441
Edition
2
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Sun's own J2EE architects and enterprise development consultants have written the definitive guide to developing complete enterprise solutions with Java 2 Enterprise Edition, Version 1.3. This new edition fully reflects Sun's latest Version 1.3 technologies and enhancements, and covers every component of a complete enterprise solution: client-side, middleware, and back-end. The authors begin by introducing the J2EE Version 1.3 platform, reviewing several scenarios for using it to build Internet and intranet applications, and offering detailed introductions to each key J2EE technology. Using both code snippets and a complete, start-to-finish case study, they walk through the construction of Web-based clients based on Java Servlets and Java ServerPages (JSP), middle-tier solutions utilizing Enterprise JavaBeans, and backend connections based on JDBC technology. Coverage also includes: packaging and deploying J2EE applications; automatic and programmatic techniques for managing transactions; and leveraging J2EE's robust security features. For all software developers, architects, and IT managers working with Java 2 Enterprise Edition or providing J2EE-based products.

✦ Table of Contents


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


πŸ“œ SIMILAR VOLUMES


Designing Enterprise applications with t
✍ Inderjeet Singh, Beth Stearns, Mark Johnson, Enterprise Team The πŸ“‚ Library πŸ“… 2002 πŸ› Addison-Wesley 🌐 English

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

Designing Enterprise Applications with t
✍ Nicholas Kassem πŸ“‚ Library πŸ“… 2000 πŸ› Addison-Wesley Professional 🌐 English

This book covers every component of J2EE, providing Β«best practicesΒ» principles for building secure, high-performance multi-tier enterprise applications, plus a detailed case study showing exactly how to get the job done. The authors begin with an insiders overview of the J2EE platform, and how it c

Applying Enterprise JavaBeans 2.1: compo
✍ Vlada Matena, Sanjeev Krishnan, Linda DeMichiel, Beth Stearns πŸ“‚ Library πŸ“… 2003 πŸ› Addison-Wesley 🌐 English

As an authoritative resource for using Enterprise JavaBeans (EJB) effectively to build and integrate even the largest systems, Applying Enterprise JavaBeans provides what IT managers and developers need to adopt this powerful component standard successfully in new Java projects.Most books about EJB

Developing enterprise Java applications
✍ Khawar Zaman Ahmed, Cary E. Umrysh πŸ“‚ Library πŸ“… 2002 πŸ› Addison-Wesley 🌐 English

Developing complex software requires more than just churning out lines of code. As a software architect or developer involved in an industrial project, you must understand and be able to leverage critical software sub-disciplines such as architecture, analysis and design techniques, development proc