Enterprise application patterns
The PoEAA patterns for domain logic, distribution, offline concurrency, session state and the base patterns.
Concepts
- Enterprise application
An enterprise application keeps a lot of persistent data, serves many users at the same time, shows the data on many screens and works with other systems.
core
Patterns
- Client session state
Client session state keeps the data of a session on the client, in a cookie, a hidden field or the URL, so the server keeps nothing between requests.
core - Data transfer object
A data transfer object holds all the data for one remote call, so the call can carry it in one message. An assembler copies the data between it and the domain objects.
core - Domain model
A domain model is a set of objects for the concepts of the business, where each object holds its data and the rules that use the data.
core - Gateway
A gateway is an object that wraps the access to an external system or resource, so that the rest of the program calls it in its own terms and not in the terms of the foreign API.
core - Layer supertype
A layer supertype is one base type for all the types of a layer, such as all the domain objects, so that their shared behaviour, like the identity and the equality, is written once.
core - Money
Money is a value object for an amount and its currency. It keeps exact amounts, refuses to add different currencies, and splits an amount with no lost cents.
core - Optimistic offline lock
An optimistic offline lock gives each record a version. A save checks that the version did not change since the session read the record, and fails on a conflict.
core - Pessimistic offline lock
A pessimistic offline lock makes a business transaction take a lock on the data before it uses the data, so only one business transaction at a time can edit it.
core - Plugin
A plugin factory reads a configuration when the program starts and creates the implementation that it names, so the program links classes during configuration and not at compile time.
core - Registry
A registry is a well-known object that other objects use to find common objects and services, such as finders, when they have no reference to start from.
core - Remote facade
A remote facade gives remote clients a few coarse-grained methods over many fine-grained objects, so one network call does the work of many local calls.
core - Separated interface
A separated interface is an interface defined in one package and implemented in another, so that the client depends only on the interface and a dependency can point against the layers.
core - Server session state
Server session state keeps the data of each session on the server, in a serialized form under a session ID. The client holds only the ID.
core - Service layer
A service layer is the set of operations that an application offers to all its clients. Each operation controls its transaction and coordinates the domain objects.
core - Service stub
A service stub replaces a slow, remote or unfinished service with a local implementation of the same interface that gives canned answers, so tests and development do not depend on the service.
core - Special case
A special case is a subclass, or another implementation of the same interface, that gives the behavior for a particular case, such as a missing customer, in place of null.
core - Transaction script
A transaction script puts the business logic of one request in one procedure, which reads the database, makes the checks and calculations, and writes the result.
core - Value object
A value object is a small object, such as an amount of money or a date range, that is equal to another when their values are equal. It is usually immutable.
core - Coarse-grained lock
A coarse-grained lock is one lock for a group of related objects, such as a customer and its addresses. A change to any member of the group takes the lock of the group.
advanced - Database session state
Database session state keeps the data of each session in the database as committed rows, apart from the business data, so that any server can handle the next request.
advanced - Implicit lock
An implicit lock puts the code that takes and checks the offline locks into the framework, the mappers or a layer supertype, so that no application script can forget a lock.
advanced - Mapper
A mapper is an object that connects two independent subsystems, so that they work together while neither of them knows the other or the mapper.
advanced - Record set
A record set is an in-memory table of rows and named columns that looks like the result of an SQL query, so other code and data-aware UI tools can read and change it.
advanced - Table module
A table module is one object that holds the business logic for all the rows of one database table, and works on the rows of a record set.
advanced