ACID (atomicity, consistency, isolation, and durability), 71–76
business and system transactions, 74–76
reducing transaction isolation for liveness, 73–74
transactional resources, 72–73
example
Advice, some technology-specific, 100–103
Web services, 103
Affinity, server, 85
Albums and tracks (Java), 264–267
Albums, transferring information about, 407–411
Application Controller, 379–386
example
state model Application Controller (Java), 382–386
further reading, 382
Application Controller, state model, 382–386
Application server concurrency, 78–80
Applications, evolution of layers in enterprise, 18–19
Architectural patterns, data source, 143–181
ASP.NET server page (C#), 357–360
Association Table Mapping, 248–261
examples
employees and skills (C#), 250–253
using direct SQL (Java), 253–256
using single query for multiple employees (Java), 256–261
when to use it, 249
Layer Supertype, 475
Behavioral patterns, object-relational, 183–214
Unit of Work, 184–94
Boosters, complexity, 24
Boundaries, working with distribution, 91–92
Brown layers, 104
Business and system transactions, 74–76
Business logic, 20
C#
collection of references, 244–247
page handler with code behind, 340–343
players and their kin, 287–292
revenue recognition with Table Module, 129–132
simple null objects, 498
single table for players, 280–281
using ADO.NET data sets, 148–151
using ghosts, 206–14
example
simple null objects (C#), 498
further reading, 497
how it works, 497
when to use it, 497
Class Table Inheritance, 285–292
example
players and their kin (C#), 287–292
further reading, 287
when to use it, 457
examples
root Optimistic Offline Lock (Java), 447–448
shared Optimistic Offline Lock (Java), 441–446
shared Pessimistic Offline Lock (Java), 446–447
when to use it, 441
Committed, read, 73
Complexity boosters defined, 24
Concrete players (C#), 296–301
Concrete Table Inheritance, 293–301
example
concrete players (C#), 296–301
application server concurrency, 78–80
isolation and immutability, 66–67
off line, 75
offline, 63
optimistic and pessimistic concurrency controls, 67–71
patterns for off line concurrency control, 76–78
Concurrency controls
optimistic and pessimistic, 67–71
ACID (atomicity, consistency, isolation, and durability), 71–76
preventing inconsistent reads, 68–69
transactions, 71
Concurrency patterns, offline, 415–453
example
simple display (Java), 347–349
further reading, 347
when to use it, 346
examples
page handler with code behind (C#), 340–343
simple display with JSP view (Java), 335–337
simple display with servlet controller (Java), 335–337
using JSP as handler (Java), 337–340
Controller patterns, input, 61
Controllers
state model Application, 382–386
using JSP as view with separate, 355–357
Controllers, Application, 379–386
example
state model Application Controller (Java), 382–386
further reading, 382
Controls
optimistic and pessimistic concurrency, 67–71
ACID (atomicity, consistency, isolation, and durability), 71–76
preventing inconsistent reads, 68–69
transactions, 71
patterns for offline concurrency, 76–78
Correctness, 65
Data
immutable, 67
record, 83
Data holder for domain object (Java), 158–159
examples
creating empty objects (Java), 179–181
separating finders (Java), 176–179
simple database mapper (Java), 171–176
Data source
architectural patterns, 143–181
logic, 20
Table Modules, 98
for Transaction Scripts, 97–98
Data source layers, down to, 97–100
data source for Domain Models, 98–99
data source for Transaction Scripts, 97–98
data source Table Modules, 98
Data Transfer Objects, 401–413
examples
serializing using XML (Java), 411–413
transferring information about albums (Java), 407–411
further reading, 407
when to use it, 406
Database mapper, simple, 171–176
Database Session State, 462–464
when to use it, 464
Databases
Databases, mapping to relational, continued
some miscellaneous points, 52–53
structural mapping patterns, 41–47
Department hierarchy, serializing, 274–277
example
albums and tracks (Java), 264–267
Dependents, finding person’s, 325–326
Dirty reads, 74
Distributed objects, allure of, 87–88
Distribution boundaries, working with, 91–92
Distribution, interfaces for, 92–93
Distribution patterns, 387–413
Data Transfer Objects, 401–413
Distribution strategies, 87–93
allure of distributed objects, 87–88
interfaces for distribution, 92–93
remote and local interfaces, 88–90
where you have to distribute, 90–91
working with distribution boundaries, 91–92
DNA layers, Microsoft, 105
Domain layer with Data Mappers (Java), 421–425
Domain layers, starting with, 96–97
Domain logic, 20
example
revenue recognition (Java), 120–124
when to use it, 119
Domain objects, data holder for, 158–159
Domain objects (Java), 475
EAI (Enterprise Application Integration), 468
example
simple value objects (Java), 270–271
further reading, 270
how it works, 268
Employees and skills (C#), 250–253
Employees, using single query for multiple, 256–261
Enterprise Application Integration (EAI), 468
Enterprise applications, evolution of layers in, 18–19
Examples
albums and tracks (Java), 264–267
ASP.NET server page (C#), 357–360
collection of references (C#), 244–247
concrete players (C#), 296–301
data holder for domain object (Java), 158–159
domain objects (Java), 475
employees and skills (C#), 250–253
finding person’s dependents (Java), 325–326
gateway to proprietary messaging service (Java), 468–472
implicit Pessimistic Offline Lock (Java), 451–453
lazy initialization (Java), 203
methods for Identity Map (Java), 198–199
multitable find (Java}, 243–244
players and their kin (C#), 287–292
revenue recognition (Java), 120–124, 138–141
revenue recognition with Table Module (C#), 129–132
root Optimistic Offline Lock (Java), 447–448
sales tax service (Java), 505–7
separating finders (Java), 176–179
serializing department hierarchy in XML (Java), 274–277
serializing using XML (Java), 411–413
shared Optimistic Offline Lock (Java), 441–446
shared Pessimistic Offline Lock (Java), 446–447
simple database mapper (Java), 171–176
simple display (Java), 347–349
simple display with servlet controller (Java), 335–337
simple lock manager (Java), 431–437
simple null objects (C#), 498
simple Query Object (Java), 318–321
simple transform (Java), 363–364
simple value objects (Java), 270–271
single table for players (C#), 280–281
single-valued reference (Java), 240–243
singleton registry (Java), 483–484
state model Application Controller (Java), 382–386
swapping Repository strategies (Java), 326–327
thread-safe registry (Java), 484–485
transferring information about albums (Java), 407–411
two-stage XSLT (XSLT), 371–374
Unit of Work with object registration (Java), 190–94
using ADO.NET data sets (C#), 148–151
using compound key (Java), 224–235
using direct SQL (Java), 253–256
using ghosts (C#), 206–14
using Java session been as Remote Facade (Java), 392–395
using JSP as handler (Java), 337–340
using key table (Java), 222–224
using metadata and reflection(Java), 309–15
using single query for multiple employees (Java), 256–261
using value holder (Java), 205–6
examples
using Java session been as Remote Facade (Java), 392–395
when to use it, 392
examples
using compound key (Java), 224–235
using key table (Java), 222–224
further reading, 221
examples
collection of references (C#), 244–247
multitable find (Java}, 243–244
single-valued reference (Java), 240–243
example
simple display (Java), 347–349
further reading, 347
when to use it, 346
example
gateway to proprietary messaging service (Java), 468–472
Gateway, continued
examples
data holder for domain object (Java), 158–159
examples
using ADO.NET data sets (C#), 148–151
further reading, 146
Gateway to proprietary messaging service (Java), 468–472
Globally Unique IDentifier (GUID), 219
GUID (Globally Unique IDentifier), 219
Handlers
Hierarchy, serializing department, 274–277
examples
using compound key (Java), 224–235
using key table (Java), 222–224
further reading, 221
example
methods for Identity Map (Java), 198–199
when to use it, 198
Immutability, isolation and, 66–67
Immutable data, 67
example
implicit Pessimistic Offline Lock (Java), 451–453
when to use it, 451
Implicit Pessimistic Offline Lock (Java), 451–453
Inconsistent reads, 64
Inheritance, Class Table, 285–292
example
players and their kin (C#), 287–292
further reading, 287
Inheritance, Concrete Table, 293–301
example
concrete players (C#), 296–301
when to use it, 304
Inheritance, Single Table
example single table for players (C#), 280–281
loading objects from databases, 281–284
Initialization, lazy, 203
Input controller patterns, 61
Interfaces
Isolated threads, 66
Isolation
reducing transaction for liveness, 73–74
J2EE layers, core, 104
creating empty objects, 179–181
data holder for domain object, 158–159
domain layer with Data Mappers, 421–425
domain objects, 475
finding person’s dependents, 325–326
gateway to proprietary messaging service, 468–472
methods for Identity Map, 198–199
revenue recognition, 113–15, 120–124, 138–141
root Optimistic Offline Lock, 447–448
serializing department hierarchy in XML, 274–277
serializing using XML, 411–413
shared Optimistic Offline Lock, 441–446
shared Pessimistic Offline Lock, 446–447
simple database mapper, 171–176
simple display with JSP view, 335–337
simple display with servlet controller, 335–337
single-valued reference (Java), 240–243
state model Application Controller, 382–386
swapping Repository strategies, 326–327
transferring information about albums, 407–411
Unit of Work with object registration, 190–94
using Java session bean as Remote Facade, 392–395
using JSP as view with separate controller, 355–357
using metadata and reflection, 309–15
using single query for multiple employees, 256–261
Java session bean, using as Remote Facade (Java), 392–395
JSP
JSP and custom tags (Java), 374–378
JSP view, simple display with, 335–337
Keys
Kin, players and their, 287–292
Late transactions, 72
Layer Supertype, 475
example
domain objects (Java), 475
how it works, 475
when to use it, 475
choosing to run your layers, 22–24
evolution of layers in enterprise applications, 18–19
Layers
Brown, 104
core J2EE, 104
data source for Domain Models, 98–99
data source for Transaction Scripts, 97–98
data source Table Modules, 98
Marinescu, 105
Microsoft DNA, 105
Nilsson, 106
example
revenue recognition (Java), 138–141
further reading, 137
when to use it, 137
Lazy initialization (Java), 203
examples
lazy initialization (Java), 203
using ghosts (C#), 206–14
using value holder (Java), 205–6
when to use it, 203
Liveness, 65
reducing transactions isolation for, 73–74
examples
lazy initialization (Java), 203
using ghosts (C#), 206–14
using value holder (Java), 205–6
when to use it, 203
Loading, ripple, 202
LOBs (large objects), serialized, 272–277
example
serializing department hierarchy in XML (Java), 274–277
when to use it, 274
Local interfaces, remote and, 88–90
Locking
optimistic, 67
pessimistic, 67
Locks
root Optimistic Offline, 447–448
shared Optimistic Offline, 441–446
shared Pessimistic Offline, 446–447
Locks, Coarse-Grained, 438–448
examples
root Optimistic Offline Lock (Java), 447–448
shared Optimistic Offline Lock (Java), 441–446
shared Pessimistic Offline Lock (Java), 446–447
when to use it, 441
example
implicit Pessimistic Offline Lock (Java), 451–453
when to use it, 451
Locks, implicit Pessimistic Offline, 451–453
Locks, Optimistic Offline, 416–425
example
domain layer with Data Mappers (Java), 421–425
Locks, Pessimistic Offline, 426–437
example
simple lock manager (Java), 431–437
when to use it, 431
Logic
business, 20
data source, 20
domain, 20
Logic patterns, domain, 109–141
Long transactions, 72
Lost updates, 64
example
methods for Identity Map (Java), 198–199
when to use it, 198
how it works, 473
when to use it, 474
examples
creating empty objects (Java), 179–181
separating finders (Java), 176–179
simple database mapper (Java), 171–176
Mapper, simple database, 171–176
Mappers, domain layer with Data, 421–425
when to use it, 304
Mapping, Association Table, 248–261
examples
employees and skills (C#), 250–253
using direct SQL (Java), 253–256
using single query for multiple employees (Java), 256–261
when to use it, 249
example
albums and tracks (Java), 264–267
examples
collection of references (C#), 244–247
multitable find (Java}, 243–244
single-valued reference (Java), 240–243
Mapping, Metadata
example
using metadata and reflection(Java), 309–15
Mapping patterns
object-relational metadata, 305–327
Mapping to relational databases, 33–53
some miscellaneous points, 52–53
structural mapping patterns, 41–47
Marinescu layers, 105
Messaging service, gateway to, 468–472
Metadata and reflection, using, 309–15
example
using metadata and reflection (Java), 309–15
Metadata Mapping, continued
Metadata mapping patterns, object-relational, 305–327
Microsoft DNA layers, 105
Migration, session, 85
example
revenue recognition (Java), 120–124
when to use it, 119
Model View Controller (MVC), 330–332
Models, data source for Domain, 98–99
Modules, data source Table, 98
example
revenue recognition with Table Module (C#), 129–132
when to use it, 128
example
Multiple employees, using single query for, 256–261
Multitable find (Java), 243–244
MVC (Model View Controller), 330–332
when to use it, 332
Nilsson layers, 106
Null objects, simple, 498
Object registration, 186
Object registration, Unit of Work with, 190–94
Object-relational behavioral patterns, 183–214
Unit of Work, 184–94
Object-relational metadata mapping patterns, 305–327
Object-relational structural patterns, 215–284
Association Table Mapping, 248–261
Class Table Inheritance, 285–292
Concrete Table Inheritance, 293–301
serialized LOBs (large objects), 272–277
Single Table Inheritance, 278–284
Objects
domain, 475
loading from databases, 281–284
simple null, 498
Objects, Data Transfer, 401–413
examples
serializing using XML (Java), 411–413
transferring information about albums (Java), 407–411
further reading, 407
when to use it, 406
example
simple Query Object (Java), 318–321
further reading, 318
when to use it, 487
Offline concurrency control, patterns for, 76–78
Offline concurrency patterns, 415–453
Optimistic Offline Lock, 416–425
Pessimistic Offline Lock, 426–437
Offline Lock, implicit Pessimistic, 451–453
Offline Lock, Optimistic, 416–425
example
domain layer with Data Mappers (Java), 421–425
Offline Lock, Pessimistic, 426–437
example
simple lock manager (Java), 431–437
when to use it, 431
Offline Lock, root Optimistic, 447–448
Offline Lock, shared Optimistic, 441–446
Offline Lock, shared Pessimistic, 446–447
Optimistic and pessimistic concurrency controls, 67–71
Optimistic locking, 67
Optimistic Offline Lock, 416–425
example
domain layer with Data Mappers (Java), 421–425
examples
page handler with code behind (C#), 340–343
simple display with JSP view (Java), 335–337
simple display with servlet controller (Java), 335–337
using JSP as handler (Java), 337–340
Page handler with code behind, 340–343
Patterns
Layer Supertype, 475
data source architectural, 143–181
Data Transfer Objects, 401–413
input controller, 61
object-relational behavioral, 183–214
Unit of Work, 184–94
object-relational metadata mapping, 305–327
object-relational structural, 215–284
Association Table Mapping, 248–261
Class Table Inheritance, 285–292
Concrete Table Inheritance, 293–301
Serialized LOBs (large objects), 272–277
Single Table Inheritance, 278–284
Patterns, continued
Optimistic Offline Lock, 416–425
Pessimistic Offline Lock, 426–437
Database Session State, 462–464
Application Controller, 379–386
MVC (Model View Controller), 330–332
Person’s dependents, finding, 325–326
Pessimistic concurrency controls, optimistic and, 67–71
Pessimistic locking, 67
Pessimistic Offline Lock, 426–437
example
simple lock manager (Java), 431–437
when to use it, 431
Phantoms, 73
Plain old Java objects (POJOs), 392
Players
Players and their kin (C#), 287–292
example
when to use it, 500
POJOs (plain old Java objects), 392
Presentation
Presentation patterns, Web, 329–386
Application Controller, 379–386
MVC (Model View Controller), 330–332
Problems
Process-per-request, 78
Process-per-session, 78
Processes defined, 66
Putting it all together, 95–106
down to data source layers, 97–100
miscellaneous layering schemes, 103–6
some technology-specific advice, 100–103
starting with domain layers, 96–97
example
simple Query Object (Java), 318–321
further reading, 318
Read
inconsistent, 64
repeatable, 73
Read committed, 73
Read uncommitted, 74
Reads
dirty, 74
preventing inconsistent, 68–69
Temporal, 69
unrepeatable, 73
Record data, 83
when to use it, 510
example
when to use it, 161–62
Reflection, using metadata and, 309–15
Registration
object, 186
Unit of Work with object, 190–94
examples
singleton registry (Java), 483–484
thread-safe registry (Java), 484–485
Relational databases, mapping to, 33–53
some miscellaneous points, 52–53
structural mapping patterns, 41–47
Remote and local interfaces, 88–90
examples
using Java session been as Remote Facade (Java), 392–395
when to use it, 392
Remote Facade, using Java session bean as, 392–395
Repeatable read, 73
examples
finding person’s dependents (Java), 325–326
swapping Repository strategies (Java), 326–327
further reading, 325
Repository strategies, swapping, 326–327
Request transactions, 72
Requests, 65
Resources, transactional, 72–73
Revenue recognition (Java), 113–15, 120–124
Revenue recognition problem, 112–113
Revenue recognition with Table Module (C#), 129–132
Ripple loading, 202
Root Optimistic Offline Lock (Java), 447–448
examples
data holder for domain object (Java), 158–159
Safety, 65
Sales tax service (Java), 505–7
Schemes, miscellaneous layering, 103–6
SCM (source code management), 420
Scripts, data source for Transaction, 97–98
example
revenue recognition (Java), 113–15
revenue recognition problem, 112–113
Separate controller, using JSP as view with, 355–357
Serializable, transactions are, 73
Serialized LOBs (large objects), 272–277
example
serializing department hierarchy in XML (Java), 274–277
when to use it, 274
Serializing using XML (Java), 411–413
Server affinity, 85
Server concurrency, application, 78–80
Servers, stateless, 81
example
revenue recognition (Java), 138–141
further reading, 137
when to use it, 137
example
sales tax service (Java), 505–7
when to use it, 505
Services, gateway to proprietary messaging, 468–472
Servlet controller, simple display with, 335–337
Session migration, 85
Session State
when to use it, 457
when to use it, 464
Session state
ways to store session state, 84–86
Session state patterns, 455–464
Database Session State, 462–464
Sessions defined, 66
Shared Optimistic Offline Lock (Java), 441–446
Shared Pessimistic Offline Lock (Java), 446–447
Simple display (Java), 347–349
Simple transform (Java), 363–364
Single Table Inheritance
example
single table for players (C#), 280–281
loading objects from databases, 281–284
Singleton registry (Java), 483–484
Skills, employees and, 250–253
Source code management (SCM), 420
Source layers, down to data, 97–100
example
simple null objects (C#), 498
further reading, 497
how it works, 497
when to use it, 497
State
State model Application Controller (Java), 382–386
Stateless servers, 81
Strategies
allure of distributed objects, 87–88
interfaces for distribution, 92–93
remote and local interfaces, 88–90
where you have to distribute, 90–91
working with distribution boundaries, 91–92
Structural mapping patterns., 41–47
Structural patterns, object-relational, 215–284
Association Table Mapping, 248–261
Class Table Inheritance, 285–292
Concrete Table Inheritance, 293–301
serialized LOBs (large objects), 272–277
Single Table Inheritance, 278–284
example
sales tax service (Java), 505–7
when to use it, 505
System transactions, business and, 74–76
examples
using ADO.NET data sets (C#), 148–151
further reading, 146
Table Inheritance, Class, 285–292
Table Inheritance, Concrete, 293–301
example
concrete players (C#), 296–301
Table Inheritance, Single
example
single table for players (C#), 280–281
loading objects from databases, 281–284
Table Mapping, Association, 248–261
examples
employees and skills (C#), 250–253
using direct SQL (Java), 253–256
using single query for multiple employees (Java), 256–261
when to use it, 249
data source, 98
example
revenue recognition with Table Module (C#), 129–132
when to use it, 128
Technology-specific advice, some, 100–103
Web services, 103
examples
ASP.NET server page (C#), 357–360
using JSP as view with separate controller (Java), 355–357
how it works, 351–54
Temporal Reads, 69
Thread-safe registry (Java), 484–485
Threads
defined, 66
isolated, 66
Together, putting it all, 95–106
down to data source layers, 97–100
miscellaneous layering schemes, 103–6
some technology-specific advice, 100–103
starting with domain layers, 96–97
Transaction isolation, reducing for liveness, 73–74
example
revenue recognition (Java), 113–15
revenue recognition problem, 112–113
Transaction Scripts, data source for, 97–98
Transactional resources, 72–73
late, 72
long, 72
request, 72
example
simple transform (Java), 363–364
Two-stage XSLT (XSLT), 371–374
examples
JSP and custom tags (Java), 374–378
two-stage XSLT (XSLT), 371–374
Uncommitted, read, 74
Unit of Work, 184–94
example
Unit of Work with object registration (Java), 190–94
Unit of Work with object registration (Java), 190–94
Unrepeatable reads, 73
Updates, lost, 64
when to use it, 487
Value objects, simple, 270–271
example
simple value objects (Java), 270–271
further reading, 270
how it works, 268
View, simple display with JSP, 335–337
examples
ASP.NET server page (C#), 357–360
using JSP as view with separate controller (Java), 355–357
how it works, 351–54
example
simple transform (Java), 363–364
how it works, 361–62
examples
JSP and custom tags (Java), 374–378
two-stage XSLT (XSLT), 371–374
input controller patterns, 61
Web presentation patterns, 329–386
Application Controller, 379–386
MVC (Model View Controller), 330–332
Web services, 103
Work, Unit of, 184–94
example
Unit of Work with object registration (Java), 190–94
XML