Index

A

ACID (atomicity, consistency, isolation, and durability), 7176

business and system transactions, 7476

reducing transaction isolation for liveness, 7374

transactional resources, 7273

Active Record, 160164

example

simple person (Java), 162164

how it works, 160161

when to use it, 161162

ADO.NET data sets, 148151

Advice, some technology-specific, 100103

Java and J2EE, 100101

.NET, 1012

stored procedures, 1023

Web services, 103

Affinity, server, 85

Albums and tracks (Java), 264267

Albums, transferring information about, 407411

Application Controller, 379386

example

state model Application Controller (Java), 382386

further reading, 382

how it works, 380381

when to use it, 381382

Application Controller, state model, 382386

Application server concurrency, 7880

Applications, evolution of layers in enterprise, 1819

Architectural patterns, 3338

Architectural patterns, data source, 143181

Active Record, 160164

Data Mapper, 165181

Row Data Gateway, 152159

Table Data Gateway, 144151

ASP.NET server page (C#), 357360

Association Table Mapping, 248261

examples

employees and skills (C#), 250253

using direct SQL (Java), 253256

using single query for multiple employees (Java), 256261

how it works, 248249

when to use it, 249

B

Base patterns, 465510

Gateway, 466472

Layer Supertype, 475

Mapper, 473474

Money, 488495

Plugin, 499503

Record Set, 508510

Registry, 480485

Separated Interface, 476479

Service Stub, 5047

Special Case, 496498

Value Object, 486487

Behavioral patterns, object-relational, 183214

Identity Map, 195199

Lazy Load, 200214

Unit of Work, 184–94

Behavioral problem, 3839

Boosters, complexity, 24

Boundaries, working with distribution, 9192

Brown layers, 104

Business and system transactions, 7476

Business logic, 20

C

C#

ASP.NET server page, 357360

collection of references, 244247

concrete players, 296301

employees and skills, 250253

integral key, 221222

page handler with code behind, 340343

Person Gateway, 146148

players and their kin, 287292

revenue recognition with Table Module, 129132

simple null objects, 498

single table for players, 280281

using ADO.NET data sets, 148151

using ghosts, 206–14

Web service, 395400

Cases, Special, 496498

example

simple null objects (C#), 498

further reading, 497

how it works, 497

when to use it, 497

Class, money, 491495

Class Table Inheritance, 285292

example

players and their kin (C#), 287292

further reading, 287

how it works, 285286

when to use it, 286287

Client Session State, 456457

how it works, 456457

when to use it, 457

Coarse-Grained Lock, 438448

examples

root Optimistic Offline Lock (Java), 447448

shared Optimistic Offline Lock (Java), 441446

shared Pessimistic Offline Lock (Java), 446447

how it works, 438441

when to use it, 441

Committed, read, 73

Complexity boosters defined, 24

Compound key (Java), 224235

Concrete players (C#), 296301

Concrete Table Inheritance, 293301

example

concrete players (C#), 296301

how it works, 293295

when to use it, 295296

Concurrency, 6380

application server, 7880

application server concurrency, 7880

concurrency problems, 6465

execution contexts, 6566

isolation and immutability, 6667

off line, 75

offline, 63

optimistic and pessimistic concurrency controls, 6771

patterns for off line concurrency control, 7678

Concurrency controls

optimistic and pessimistic, 6771

ACID (atomicity, consistency, isolation, and durability), 7176

deadlocks, 7071

preventing inconsistent reads, 6869

transactions, 71

patterns for offline, 7678

Concurrency patterns, offline, 415453

Connections, database, 5052

Contexts, execution, 6566

Controller, Front, 344349

example

simple display (Java), 347349

further reading, 347

how it works, 344346

when to use it, 346

Controller, Page, 333343

examples

page handler with code behind (C#), 340343

simple display with JSP view (Java), 335337

simple display with servlet controller (Java), 335337

using JSP as handler (Java), 337340

how it works, 333334

when to use it, 334335

Controller patterns, input, 61

Controllers

simple display with, 335337

state model Application, 382386

using JSP as view with separate, 355357

Controllers, Application, 379386

example

state model Application Controller (Java), 382386

further reading, 382

how it works, 380381

when to use it, 381382

Controls

optimistic and pessimistic concurrency, 6771

ACID (atomicity, consistency, isolation, and durability), 7176

deadlocks, 7071

preventing inconsistent reads, 6869

transactions, 71

patterns for offline concurrency, 7678

Correctness, 65

Custom tags, JSP and, 374378

D

Data

immutable, 67

reading in, 4041

record, 83

Data holder for domain object (Java), 158159

Data Mapper, 165181

domain layer with, 421425

examples

creating empty objects (Java), 179181

separating finders (Java), 176179

simple database mapper (Java), 171176

how it works, 165170

when to use it, 170171

Data sets, ADO.NET, 148151

Data source

architectural patterns, 143181

Active Record, 160164

Data Mapper, 165181

Row Data Gateway, 152159

Table Data Gateway, 144151

for Domain Models, 9899

logic, 20

Table Modules, 98

for Transaction Scripts, 9798

Data source layers, down to, 97100

data source for Domain Models, 9899

data source for Transaction Scripts, 9798

data source Table Modules, 98

presentation layers, 99100

Data Transfer Objects, 401413

examples

serializing using XML (Java), 411413

transferring information about albums (Java), 407411

further reading, 407

how it works, 4016

when to use it, 406

Database connections, 5052

Database mapper, simple, 171176

Database Session State, 462464

how it works, 462463

when to use it, 464

Databases

loading objects from, 281284

mapping to relational, 3353

architectural patterns, 3338

behavioral problem, 3839

building mapping, 4749

database connections, 5052

Databases, mapping to relational, continued

reading in data, 4041

some miscellaneous points, 5253

structural mapping patterns, 4147

using metadata, 4950

Deadlocks, 7071

Department hierarchy, serializing, 274277

Dependent Mapping, 262267

example

albums and tracks (Java), 264267

how it works, 262263

when to use it, 263264

Dependents, finding person’s, 325326

Dirty reads, 74

Display, simple, 347349

Distributed objects, allure of, 8788

Distribution boundaries, working with, 9192

Distribution, interfaces for, 9293

Distribution patterns, 387413

Data Transfer Objects, 401413

Remote Facade, 388400

Distribution strategies, 8793

allure of distributed objects, 8788

interfaces for distribution, 9293

remote and local interfaces, 8890

where you have to distribute, 9091

working with distribution boundaries, 9192

DNA layers, Microsoft, 105

Domain layer with Data Mappers (Java), 421425

Domain layers, starting with, 9697

Domain logic, 20

organizing, 2532

making choices, 2930

Service Layers, 3032

patterns, 109141

Domain Model, 116124

Service Layer, 133141

Table Module, 125132

Transaction Script, 11015

Domain Model, 116124

data source for, 9899

example

revenue recognition (Java), 120124

further reading, 119120

how it works, 116119

when to use it, 119

Domain objects, data holder for, 158159

Domain objects (Java), 475

E

EAI (Enterprise Application Integration), 468

Embedded Value, 268271

example

simple value objects (Java), 270271

further reading, 270

how it works, 268

when to use it, 268269

Employees and skills (C#), 250253

Employees, using single query for multiple, 256261

Enterprise Application Integration (EAI), 468

Enterprise applications, evolution of layers in, 1819

Examples

albums and tracks (Java), 264267

ASP.NET server page (C#), 357360

collection of references (C#), 244247

concrete players (C#), 296301

data holder for domain object (Java), 158159

domain objects (Java), 475

employees and skills (C#), 250253

finding person’s dependents (Java), 325326

gateway to proprietary messaging service (Java), 468472

Id Generator (Java), 5013

implicit Pessimistic Offline Lock (Java), 451453

integral key (C#), 221222

lazy initialization (Java), 203

methods for Identity Map (Java), 198199

money class (Java), 491495

multitable find (Java}, 243244

Person Gateway (C#), 146148

person record (Java), 155158

players and their kin (C#), 287292

revenue recognition (Java), 120124, 138141

revenue recognition with Table Module (C#), 129132

root Optimistic Offline Lock (Java), 447448

sales tax service (Java), 5057

separating finders (Java), 176179

serializing department hierarchy in XML (Java), 274277

serializing using XML (Java), 411413

shared Optimistic Offline Lock (Java), 441446

shared Pessimistic Offline Lock (Java), 446447

simple database mapper (Java), 171176

simple display (Java), 347349

simple display with servlet controller (Java), 335337

simple lock manager (Java), 431437

simple null objects (C#), 498

simple person (Java), 162164

simple Query Object (Java), 318321

simple transform (Java), 363364

simple value objects (Java), 270271

single table for players (C#), 280281

single-valued reference (Java), 240243

singleton registry (Java), 483484

state model Application Controller (Java), 382386

swapping Repository strategies (Java), 326327

thread-safe registry (Java), 484485

transferring information about albums (Java), 407411

two-stage XSLT (XSLT), 371374

Unit of Work with object registration (Java), 190–94

using ADO.NET data sets (C#), 148151

using compound key (Java), 224235

using direct SQL (Java), 253256

using ghosts (C#), 206–14

using Java session been as Remote Facade (Java), 392395

using JSP as handler (Java), 337340

using key table (Java), 222224

using metadata and reflection(Java), 30915

using single query for multiple employees (Java), 256261

using value holder (Java), 2056

virtual proxy (Java), 2035

Web service (C#), 395400

Execution contexts, 6566

F

Facade, Remote, 388400

examples

using Java session been as Remote Facade (Java), 392395

Web service (C#), 395400

how it works, 389392

when to use it, 392

Fields, Identity, 216235

examples

integral key (C#), 221222

using compound key (Java), 224235

using key table (Java), 222224

further reading, 221

how it works, 216220

when to use it, 220221

Find, multitable, 243244

Finders, separating, 176179

Foreign Key Mapping, 236247

examples

collection of references (C#), 244247

multitable find (Java}, 243244

single-valued reference (Java), 240243

how it works, 236239

when to use it, 239240

Front Controller, 344349

example

simple display (Java), 347349

further reading, 347

how it works, 344346

when to use it, 346

G

Gateway, 466472

example

gateway to proprietary messaging service (Java), 468472

how it works, 466467

Gateway, continued

Person, 146148

when to use it, 467468

Gateway, Row Data, 152159

examples

data holder for domain object (Java), 158159

person record (Java), 155158

how it works, 152153

when to use it, 153155

Gateway, Table Data, 144151

examples

Person Gateway (C#), 146148

using ADO.NET data sets (C#), 148151

further reading, 146

how it works, 144145

when to use it, 145146

Gateway to proprietary messaging service (Java), 468472

Generator, Id, 5013

Ghosts, 202, 206–14

Globally Unique IDentifier (GUID), 219

GUID (Globally Unique IDentifier), 219

H

Handlers

page, 340343

using JSP as, 337340

Hierarchy, serializing department, 274277

Holder, using value, 2056

I

Id Generator (Java), 5013

Identity Field, 216235

examples

integral key (C#), 221222

using compound key (Java), 224235

using key table (Java), 222224

further reading, 221

how it works, 216220

when to use it, 220221

Identity Map, 195199

example

methods for Identity Map (Java), 198199

how it works, 195197

methods for, 198199

when to use it, 198

Immutability, isolation and, 6667

Immutable data, 67

Implicit Lock, 449453

example

implicit Pessimistic Offline Lock (Java), 451453

how it works, 450451

when to use it, 451

Implicit Pessimistic Offline Lock (Java), 451453

Inconsistent reads, 64

preventing, 6869

Inheritance, 4547

Inheritance, Class Table, 285292

example

players and their kin (C#), 287292

further reading, 287

how it works, 285286

when to use it, 286287

Inheritance, Concrete Table, 293301

example

concrete players (C#), 296301

how it works, 293295

when to use it, 295296

Inheritance Mappers, 3024

how it works, 3034

when to use it, 304

Inheritance, Single Table

example single table for players (C#), 280281

how it works, 278279

loading objects from databases, 281284

when to use it, 279280

Initialization, lazy, 203

Input controller patterns, 61

Integral key (C#), 221222

Interfaces

for distribution, 9293

remote and local, 8890

Separated, 476479

how it works, 477478

when to use it, 478479

Isolated threads, 66

Isolation

and immutability, 6667

reducing transaction for liveness, 7374

J

J2EE, Java and, 100101

J2EE layers, core, 104

Java

albums and tracks, 264267

creating empty objects, 179181

data holder for domain object, 158159

domain layer with Data Mappers, 421425

domain objects, 475

finding person’s dependents, 325326

gateway to proprietary messaging service, 468472

Id Generator, 5013

and J2EE, 100101

JSP and custom tags, 374378

methods for Identity Map, 198199

money class, 491495

multitable find, 243244

person record, 155158

revenue recognition, 11315, 120124, 138141

root Optimistic Offline Lock, 447448

sales tax service, 5057

separating finders, 176179

serializing department hierarchy in XML, 274277

serializing using XML, 411413

shared Optimistic Offline Lock, 441446

shared Pessimistic Offline Lock, 446447

simple database mapper, 171176

simple display, 347349

simple display with JSP view, 335337

simple display with servlet controller, 335337

simple person, 162164

simple Query Object, 318321

simple transform, 363364

simple value objects, 270271

single-valued reference (Java), 240243

singleton registry, 483484

state model Application Controller, 382386

swapping Repository strategies, 326327

thread-safe registry, 484485

transferring information about albums, 407411

Unit of Work with object registration, 190–94

using compound key, 224235

using direct SQL, 253256

using Java session bean as Remote Facade, 392395

using JSP as handler, 337340

using JSP as view with separate controller, 355357

using key table, 222224

using metadata and reflection, 30915

using single query for multiple employees, 256261

using value holder, 2056

Java session bean, using as Remote Facade (Java), 392395

JSP

using as handler, 337340

using as view, 355357

JSP and custom tags (Java), 374378

JSP view, simple display with, 335337

K

Key Mapping, Foreign, 236247

Key table, 222224

Keys

compound, 224235

integral, 221222

Kin, players and their, 287292

L

Late transactions, 72

Layer Supertype, 475

example

domain objects (Java), 475

how it works, 475

when to use it, 475

Layering, 1724

choosing to run your layers, 2224

evolution of layers in enterprise applications, 1819

schemes, 1036

three principal layers, 1922

Layers

Brown, 104

choosing to run your, 2224

core J2EE, 104

down to data source, 97100

data source for Domain Models, 9899

data source for Transaction Scripts, 9798

data source Table Modules, 98

presentation layers, 99100

Marinescu, 105

Microsoft DNA, 105

Nilsson, 106

presentation, 99100

Service, 3032

starting with domain, 9697

three principal, 1922

Layers, evolution of, 1819

Layers, Service, 133141

example

revenue recognition (Java), 138141

further reading, 137

how it works, 134137

when to use it, 137

Lazy initialization (Java), 203

Lazy Load, 200214

examples

lazy initialization (Java), 203

using ghosts (C#), 206–14

using value holder (Java), 2056

virtual proxy (Java), 2035

how it works, 200203

when to use it, 203

Liveness, 65

reducing transactions isolation for, 7374

Load, Lazy, 200214

examples

lazy initialization (Java), 203

using ghosts (C#), 206–14

using value holder (Java), 2056

virtual proxy (Java), 2035

how it works, 200203

when to use it, 203

Loading, ripple, 202

LOBs (large objects), serialized, 272277

example

serializing department hierarchy in XML (Java), 274277

how it works, 272273

when to use it, 274

Local interfaces, remote and, 8890

Lock manager, simple, 431437

Locking

optimistic, 67

pessimistic, 67

Locks

root Optimistic Offline, 447448

shared Optimistic Offline, 441446

shared Pessimistic Offline, 446447

Locks, Coarse-Grained, 438448

examples

root Optimistic Offline Lock (Java), 447448

shared Optimistic Offline Lock (Java), 441446

shared Pessimistic Offline Lock (Java), 446447

how it works, 438441

when to use it, 441

Locks, Implicit, 449453

example

implicit Pessimistic Offline Lock (Java), 451453

how it works, 450451

when to use it, 451

Locks, implicit Pessimistic Offline, 451453

Locks, Optimistic Offline, 416425

example

domain layer with Data Mappers (Java), 421425

how it works, 417420

when to use it, 420421

Locks, Pessimistic Offline, 426437

example

simple lock manager (Java), 431437

how it works, 427431

when to use it, 431

Logic

business, 20

data source, 20

domain, 20

organizing domain, 2532

making choices, 2930

Service Layers, 3032

presentation, 1920

Logic patterns, domain, 109141

Domain Model, 116124

Service Layer, 133141

Table Module, 125132

Transaction Script, 11015

Long transactions, 72

Lost updates, 64

M

Manager, simple lock, 431437

Map, Identity, 195199

example

methods for Identity Map (Java), 198199

how it works, 195197

when to use it, 198

Mapper, 473474

how it works, 473

when to use it, 474

Mapper, Data, 165181

examples

creating empty objects (Java), 179181

separating finders (Java), 176179

simple database mapper (Java), 171176

how it works, 165170

when to use it, 170171

Mapper, simple database, 171176

Mappers, domain layer with Data, 421425

Mappers, Inheritance, 3024

how it works, 3034

when to use it, 304

Mapping, Association Table, 248261

examples

employees and skills (C#), 250253

using direct SQL (Java), 253256

using single query for multiple employees (Java), 256261

how it works, 248249

when to use it, 249

Mapping, building, 4749

Mapping, Dependent, 262267

example

albums and tracks (Java), 264267

how it works, 262263

when to use it, 263264

Mapping, Foreign Key, 236247

examples

collection of references (C#), 244247

multitable find (Java}, 243244

single-valued reference (Java), 240243

how it works, 236239

when to use it, 239240

Mapping, Metadata

example

using metadata and reflection(Java), 30915

how it works, 3068

when to use it, 3089

Mapping patterns

object-relational metadata, 305327

Metadata Mapping, 30615

Query Object, 316321

Repository, 322327

structural, 4147

inheritance, 4547

mapping relationships, 4145

Mapping relationships, 4145

Mapping to relational databases, 3353

architectural patterns, 3338

behavioral problem, 3839

building mapping, 4749

database connections, 5052

reading in data, 4041

some miscellaneous points, 5253

structural mapping patterns, 4147

using metadata, 4950

Marinescu layers, 105

Messaging service, gateway to, 468472

Metadata and reflection, using, 30915

Metadata Mapping, 30615

example

using metadata and reflection (Java), 30915

Metadata Mapping, continued

how it works, 3068

when to use it, 3089

Metadata mapping patterns, object-relational, 305327

Metadata Mapping, 30615

Query Object, 316321

Repository, 322327

Metadata, using, 4950

Microsoft DNA layers, 105

Migration, session, 85

Model, Domain, 116124

example

revenue recognition (Java), 120124

further reading, 119120

how it works, 116119

when to use it, 119

Model View Controller (MVC), 330332

Models, data source for Domain, 9899

Modules, data source Table, 98

Modules, Table, 125132

example

revenue recognition with Table Module (C#), 129132

how it works, 126128

when to use it, 128

Money, 488495

example

money class (Java), 491495

how it works, 488490

when to use it, 490491

Money class (Java), 491495

Multiple employees, using single query for, 256261

Multitable find (Java), 243244

MVC (Model View Controller), 330332

how it works, 330332

when to use it, 332

N

.NET, 1012

Nilsson layers, 106

Null objects, simple, 498

O

Object registration, 186

Object registration, Unit of Work with, 190–94

Object-relational behavioral patterns, 183214

Identity Map, 195199

Lazy Load, 200214

Unit of Work, 184–94

Object-relational metadata mapping patterns, 305327

Metadata Mapping, 30615

Query Object, 316321

Repository, 322327

Object-relational structural patterns, 215284

Association Table Mapping, 248261

Class Table Inheritance, 285292

Concrete Table Inheritance, 293301

Dependent Mapping, 262267

Embedded Value, 268271

Foreign Key Mapping, 236247

Identity Field, 216235

Inheritance Mappers, 3024

serialized LOBs (large objects), 272277

Single Table Inheritance, 278284

Object, simple Query, 318321

Objects

allure of distributed, 8788

creating empty, 179181

domain, 475

loading from databases, 281284

simple null, 498

simple value, 270271

Objects, Data Transfer, 401413

examples

serializing using XML (Java), 411413

transferring information about albums (Java), 407411

further reading, 407

how it works, 4016

when to use it, 406

Objects, Query, 316321

example

simple Query Object (Java), 318321

further reading, 318

how it works, 316317

when to use it, 317318

Objects, Value, 486487

how it works, 486487

when to use it, 487

Offline concurrency, 63, 75

Offline concurrency control, patterns for, 7678

Offline concurrency patterns, 415453

Coarse-Grained Lock, 438448

Implicit Lock, 449453

Optimistic Offline Lock, 416425

Pessimistic Offline Lock, 426437

Offline Lock, implicit Pessimistic, 451453

Offline Lock, Optimistic, 416425

example

domain layer with Data Mappers (Java), 421425

how it works, 417420

when to use it, 420421

Offline Lock, Pessimistic, 426437

example

simple lock manager (Java), 431437

how it works, 427431

when to use it, 431

Offline Lock, root Optimistic, 447448

Offline Lock, shared Optimistic, 441446

Offline Lock, shared Pessimistic, 446447

Optimistic and pessimistic concurrency controls, 6771

Optimistic locking, 67

Optimistic Offline Lock, 416425

example

domain layer with Data Mappers (Java), 421425

how it works, 417420

root, 447448

shared, 441446

when to use it, 420421

P

Page Controller, 333343

examples

page handler with code behind (C#), 340343

simple display with JSP view (Java), 335337

simple display with servlet controller (Java), 335337

using JSP as handler (Java), 337340

how it works, 333334

when to use it, 334335

Page handler with code behind, 340343

Patterns

architectural, 3338

base, 465510

Gateway, 466472

Layer Supertype, 475

Mapper, 473474

Money, 488495

Plugin, 499503

Record Set, 508510

Registry, 480485

Separated Interface, 476479

Service Stub, 5047

Special Case, 496498

Value Object, 486487

data source architectural, 143181

Active Record, 160164

Data Mapper, 165181

Row Data Gateway, 152159

Table Data Gateway, 144151

distribution, 387413

Data Transfer Objects, 401413

Remote Facade, 388400

domain logic, 109141

input controller, 61

mapping structural, 4147

inheritance, 4547

mapping relationships, 4145

object-relational behavioral, 183214

Identity Map, 195199

Lazy Load, 200214

Unit of Work, 184–94

object-relational metadata mapping, 305327

Metadata Mapping, 30615

Query Object, 316321

Repository, 322327

object-relational structural, 215284

Association Table Mapping, 248261

Class Table Inheritance, 285292

Concrete Table Inheritance, 293301

Dependent Mapping, 262267

Embedded Value, 268271

Foreign Key Mapping, 236247

Identity Field, 216235

Inheritance Mappers, 3024

Serialized LOBs (large objects), 272277

Single Table Inheritance, 278284

Patterns, continued

offline concurrency, 415453

Coarse-Grained Lock, 438448

Implicit Lock, 449453

Optimistic Offline Lock, 416425

Pessimistic Offline Lock, 426437

session state, 455464

Client Session State, 456457

Database Session State, 462464

Server Session State, 458461

view, 5860

Web presentation, 329386

Application Controller, 379386

Front Controller, 344349

MVC (Model View Controller), 330332

Page Controller, 333343

Template View, 350360

Transform View, 361364

Two Step View, 365378

Person Gateway (C#), 146148

Person record (Java), 155158

Person, simple, 162164

Person’s dependents, finding, 325326

Pessimistic concurrency controls, optimistic and, 6771

Pessimistic locking, 67

Pessimistic Offline Lock, 426437

example

simple lock manager (Java), 431437

how it works, 427431

implicit, 451453

shared, 446447

when to use it, 431

Phantoms, 73

Plain old Java objects (POJOs), 392

Players

concrete, 296301

single table for, 280281

Players and their kin (C#), 287292

Plugin, 499503

example

Id Generator (Java), 5013

how it works, 499500

when to use it, 500

POJOs (plain old Java objects), 392

Presentation

layers, 99100

logic, 1920

Web, 5561

Presentation patterns, Web, 329386

Application Controller, 379386

Front Controller, 344349

MVC (Model View Controller), 330332

Page Controller, 333343

Template View, 350360

Transform View, 361364

Two Step View, 365378

Problems

behavioral, 3839

concurrency, 6465

Procedures, stored, 1023

Process-per-request, 78

Process-per-session, 78

Processes defined, 66

Proxy, virtual, 2035

Putting it all together, 95106

down to data source layers, 97100

miscellaneous layering schemes, 1036

some technology-specific advice, 100103

starting with domain layers, 9697

Q

Query Object, 316321

example

simple Query Object (Java), 318321

further reading, 318

how it works, 316317

when to use it, 317318

Query Object, simple, 318321

Query, using single, 256261

R

Read

inconsistent, 64

repeatable, 73

Read committed, 73

Read uncommitted, 74

Reads

dirty, 74

preventing inconsistent, 6869

Temporal, 69

unrepeatable, 73

Record data, 83

Record Set, 508510

how it works, 508510

when to use it, 510

Records, Active, 160164

example

simple person (Java), 162164

how it works, 160161

when to use it, 161–62

References

collection of, 244247

single-valued, 240243

Reflection, using metadata and, 30915

Registration

object, 186

Unit of Work with object, 190–94

Registry, 480485

examples

singleton registry (Java), 483484

thread-safe registry (Java), 484485

how it works, 480482

singleton, 483484

thread-safe, 484485

when to use it, 482483

Relational databases, mapping to, 3353

architectural patterns, 3338

behavioral problem, 3839

building mapping, 4749

database connections, 5052

reading in data, 4041

some miscellaneous points, 5253

structural mapping patterns, 4147

using metadata, 4950

Relationships, mapping, 4145

Remote and local interfaces, 8890

Remote Facade, 388400

examples

using Java session been as Remote Facade (Java), 392395

Web service (C#), 395400

how it works, 389392

when to use it, 392

Remote Facade, using Java session bean as, 392395

Repeatable read, 73

Repository, 322327

examples

finding person’s dependents (Java), 325326

swapping Repository strategies (Java), 326327

further reading, 325

how it works, 323324

when to use it, 324325

Repository strategies, swapping, 326327

Request transactions, 72

Requests, 65

Resources, transactional, 7273

Revenue recognition (Java), 11315, 120124

Revenue recognition problem, 112113

Revenue recognition with Table Module (C#), 129132

Ripple loading, 202

Root Optimistic Offline Lock (Java), 447448

Row Data Gateway, 152159

examples

data holder for domain object (Java), 158159

person record (Java), 155158

how it works, 152153

when to use it, 153155

S

Safety, 65

Sales tax service (Java), 5057

Schemes, miscellaneous layering, 1036

SCM (source code management), 420

Scripts, data source for Transaction, 9798

Scripts, Transaction, 11015

example

revenue recognition (Java), 11315

how it works, 110111

revenue recognition problem, 112113

when to use it, 111112

Separate controller, using JSP as view with, 355357

Separated Interface, 476479

how it works, 477478

when to use it, 478479

Serializable, transactions are, 73

Serialized LOBs (large objects), 272277

example

serializing department hierarchy in XML (Java), 274277

how it works, 272273

when to use it, 274

Serializing using XML (Java), 411413

Server affinity, 85

Server concurrency, application, 7880

Server page, ASP.NET, 357360

Server Session State, 458461

how it works, 458460

when to use it, 460461

Servers, stateless, 81

Service Layer, 3032, 133141

example

revenue recognition (Java), 138141

further reading, 137

how it works, 134137

when to use it, 137

Service Stub, 5047

example

sales tax service (Java), 5057

how it works, 5045

when to use it, 505

Services, gateway to proprietary messaging, 468472

Services, Web, 103, 395400

Servlet controller, simple display with, 335337

Session migration, 85

Session state, 81, 8386

Session State

Client, 456457

how it works, 456457

when to use it, 457

Database, 462464

how it works, 462463

when to use it, 464

Server, 458461

how it works, 458460

when to use it, 460461

Session state

value of statelessness, 8183

ways to store, 8486

ways to store session state, 8486

Session state patterns, 455464

Client Session State, 456457

Database Session State, 462464

Server Session State, 458461

Sessions defined, 66

Shared Optimistic Offline Lock (Java), 441446

Shared Pessimistic Offline Lock (Java), 446447

Simple display (Java), 347349

Simple person (Java), 162164

Simple transform (Java), 363364

Single Table Inheritance

example

single table for players (C#), 280281

how it works, 278279

loading objects from databases, 281284

when to use it, 279280

Singleton registry (Java), 483484

Skills, employees and, 250253

Source code management (SCM), 420

Source layers, down to data, 97100

Special Case, 496498

example

simple null objects (C#), 498

further reading, 497

how it works, 497

when to use it, 497

SQL, using direct, 253256

State

session, 81, 8386

ways to store session, 8486

State model Application Controller (Java), 382386

Stateless servers, 81

Stored procedures, 1023

Strategies

distribution, 8793

allure of distributed objects, 8788

interfaces for distribution, 9293

remote and local interfaces, 8890

where you have to distribute, 9091

working with distribution boundaries, 9192

swapping Repository, 326327

Structural mapping patterns., 4147

inheritance, 4547

mapping relationships, 4145

Structural patterns, object-relational, 215284

Association Table Mapping, 248261

Class Table Inheritance, 285292

Concrete Table Inheritance, 293301

Dependent Mapping, 262267

Embedded Value, 268271

Foreign Key Mapping, 236247

Identity Field, 216235

Inheritance Mappers, 3024

serialized LOBs (large objects), 272277

Single Table Inheritance, 278284

Stub, Service, 5047

example

sales tax service (Java), 5057

how it works, 5045

when to use it, 505

System transactions, business and, 7476

T

Table Data Gateway, 144151

examples

Person Gateway (C#), 146148

using ADO.NET data sets (C#), 148151

further reading, 146

how it works, 144145

when to use it, 145146

Table Inheritance, Class, 285292

Table Inheritance, Concrete, 293301

example

concrete players (C#), 296301

how it works, 293295

when to use it, 295296

Table Inheritance, Single

example

single table for players (C#), 280281

how it works, 278279

loading objects from databases, 281284

when to use it, 279280

Table Mapping, Association, 248261

examples

employees and skills (C#), 250253

using direct SQL (Java), 253256

using single query for multiple employees (Java), 256261

how it works, 248249

when to use it, 249

Table Modules, 125132

data source, 98

example

revenue recognition with Table Module (C#), 129132

how it works, 126128

when to use it, 128

Tables, key, 222224

Tags, JSP and custom, 374378

Tax service, sales, 5057

Technology-specific advice, some, 100103

Java and J2EE, 100101

.NET, 1012

stored procedures, 1023

Web services, 103

Template View, 350360

examples

ASP.NET server page (C#), 357360

using JSP as view with separate controller (Java), 355357

how it works, 351–54

when to use it, 354355

Temporal Reads, 69

Thread-safe registry (Java), 484485

Threads

defined, 66

isolated, 66

Together, putting it all, 95106

down to data source layers, 97100

miscellaneous layering schemes, 1036

some technology-specific advice, 100103

starting with domain layers, 9697

Tracks, albums and, 264267

Transaction isolation, reducing for liveness, 7374

Transaction Script, 11015

example

revenue recognition (Java), 11315

how it works, 110111

revenue recognition problem, 112113

when to use it, 111112

Transaction Scripts, data source for, 9798

Transactional resources, 7273

Transactions, 66, 71

business and system, 7476

late, 72

long, 72

request, 72

system, 7476

Transform, simple, 363364

Transform View, 361364

example

simple transform (Java), 363364

when to use it, 362363

Two-stage XSLT (XSLT), 371374

Two Step View, 365378

examples

JSP and custom tags (Java), 374378

two-stage XSLT (XSLT), 371374

how it works, 365367

when to use it, 367371

U

Uncommitted, read, 74

Unit of Work, 184–94

example

Unit of Work with object registration (Java), 190–94

how it works, 184189

when to use it, 189190

Unit of Work with object registration (Java), 190–94

Unrepeatable reads, 73

Updates, lost, 64

V

Value holder, using, 2056

Value Object, 486487

how it works, 486487

when to use it, 487

Value objects, simple, 270271

Values, Embedded, 268271

example

simple value objects (Java), 270271

further reading, 270

how it works, 268

when to use it, 268269

View patterns, 5860

View, simple display with JSP, 335337

Views, Template, 350360

examples

ASP.NET server page (C#), 357360

using JSP as view with separate controller (Java), 355357

how it works, 351–54

when to use it, 354355

Views, Transform, 361364

example

simple transform (Java), 363364

how it works, 361–62

when to use it, 362363

Views, Two Step, 365378

examples

JSP and custom tags (Java), 374378

two-stage XSLT (XSLT), 371374

how it works, 365367

when to use it, 367371

Virtual proxy (Java), 2035

W

Web presentation, 5561

input controller patterns, 61

view patterns, 5860

Web presentation patterns, 329386

Application Controller, 379386

Front Controller, 344349

MVC (Model View Controller), 330332

Page Controller, 333343

Template View, 350360

Transform View, 361364

Two Step View, 365378

Web service (C#), 395400

Web services, 103

Work, Unit of, 184–94

example

Unit of Work with object registration (Java), 190–94

how it works, 184189

when to use it, 189190

X

XML

serializing department hierarchy in, 274277

serializing using, 411413

XSLT, two stage, 371374