Martin Fowler 2003

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
 
  
 
== Martin Fowler's architectural patterns book ==
 
== Martin Fowler's architectural patterns book ==
Line 15: Line 14:
 
{|
 
{|
 
|-
 
|-
| TransactionScriptPattern || Organizes business logic by procedures where each procedure handles a single request from the presentation.
+
| [[Transaction script pattern]] || Organizes business logic by procedures where each procedure handles a single request from the presentation.
 
|-
 
|-
| DomainModelPattern || An object model of the domain that incorporates both behavior and data.
+
| [[Domain model pattern]] || An object model of the domain that incorporates both behavior and data.
 
|-
 
|-
| TableModulePattern || A single instance that handles the business logic for all rows in a database table or view.
+
| [[Table module pattern]] || A single instance that handles the business logic for all rows in a database table or view.
 
|-
 
|-
| ServiceLayerPattern || Defines an application's boundary with a layer of services that establishes a set of available operations and coordinates the application's response in each.
+
| [[Service layer pattern]] || Defines an application's boundary with a layer of services that establishes a set of available operations and coordinates the application's response in each.
 
|-
 
|-
 
|}
 
|}
  
 
'''Data source architectural patterns'''
 
'''Data source architectural patterns'''
 +
 
{|
 
{|
 
|-
 
|-
| TableDataGatewayPattern || An object that acts as a Gateway to a database table. One instance handles all the rows in the table.
+
| [[Table data gateway pattern]] || An object that acts as a Gateway to a database table. One instance handles all the rows in the table.
 
|-
 
|-
| RowDataGatewayPattern || An object that acts as a Gateway to a single record in a data source. There is one instance per row.
+
| [[Row data gateway pattern]] || An object that acts as a Gateway to a single record in a data source. There is one instance per row.
 
|-
 
|-
| ActiveRecordPattern || An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.
+
| [[Active record pattern]] || An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.
 
|-
 
|-
| DataMapperPattern || A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.
+
| [[Data mapper pattern]] || A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.
  
 
'''Object-Relational Behavioral Patterns'''
 
'''Object-Relational Behavioral Patterns'''
Line 40: Line 40:
 
{|
 
{|
 
|-
 
|-
| UnitOfWorkPattern || Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.
+
| [[Unit of work pattern]] || Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.
 
|-
 
|-
| IdentityMapPattern || Ensures that each object gets loaded only once by keeping every loaded object in a map. Looks up objects using the map when referring to them.
+
| [[Identity map pattern]] || Ensures that each object gets loaded only once by keeping every loaded object in a map. Looks up objects using the map when referring to them.
 
|-
 
|-
| LazyLoadPattern || An object that doesn't contain all of the data you need but knows how to get it.
+
| [[Lazy load pattern]] || An object that doesn't contain all of the data you need but knows how to get it.
 
|}
 
|}
  
Line 51: Line 51:
 
{|
 
{|
 
|-
 
|-
| IdentityFieldPattern || Saves a database ID field in an object to maintain identity between an in-memory object and a database row.
+
| [[Identity field pattern]] || Saves a database ID field in an object to maintain identity between an in-memory object and a database row.
 
|-
 
|-
| ForeignKeyMappingPattern || Maps an association between objects to a foreign key reference between tables.
+
| [[Foreign key mapping pattern]] || Maps an association between objects to a foreign key reference between tables.
 
|-
 
|-
| AssociationTableMappingPattern || Saves an association as a table with foreign keys to the tables that are linked by the association.
+
| [[Association table mapping pattern]] || Saves an association as a table with foreign keys to the tables that are linked by the association.
 
|-
 
|-
| DependentMappingPattern || Has one class perform the database mapping for a child class.
+
| [[Dependent mapping pattern]] || Has one class perform the database mapping for a child class.
 
|-
 
|-
| EmbeddedValuePattern || Maps an object into several fields of another object's table.
+
| [[Embedded value pattern]] || Maps an object into several fields of another object's table.
 
|-
 
|-
| SerializedLobPattern || Saves a graph of objects by serializing them into a single large object (LOB), which it stores in a database field.
+
| [[Serialized lob pattern]] || Saves a graph of objects by serializing them into a single large object (LOB), which it stores in a database field.
 
|-
 
|-
| SingleTableInheritancePattern || Represents an inheritance hierarchy of classes as a single table that has columns for all the fields of the various classes.
+
| [[Single table inheritance pattern]] || Represents an inheritance hierarchy of classes as a single table that has columns for all the fields of the various classes.
 
|-
 
|-
| ClassTableInheritancePattern || Represents an inheritance hierarchy of classes with one table for each class.
+
| [[Class table inheritance pattern]] || Represents an inheritance hierarchy of classes with one table for each class.
 
|-
 
|-
| ConcreteTableInheritancePattern || Represents an inheritance hierarchy of classes with one table per concrete class in the hierarchy.
+
| [[Concrete table inheritance pattern]] || Represents an inheritance hierarchy of classes with one table per concrete class in the hierarchy.
 
|-
 
|-
| InheritanceMappersPattern || A structure to organize database mappers that handle inheritance hierarchies.
+
| [[Inheritance mappers pattern]] || A structure to organize database mappers that handle inheritance hierarchies.
 
|-
 
|-
 
|}
 
|}
Line 77: Line 77:
 
{|
 
{|
 
|-
 
|-
MetadataMappingPattern || Holds details of object-relational mapping in metadata.
+
| [[Metadata mapping pattern]] || Holds details of object-relational mapping in metadata.
 
|-
 
|-
| QueryObjectPattern || An object that represents a database query.
+
| [[Query object pattern]] || An object that represents a database query.
 
|-
 
|-
| RepositoryPattern || Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.
+
| [[Repository pattern]] || Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.
 
|-
 
|-
 
|}
 
|}
Line 89: Line 89:
 
{|
 
{|
 
|-
 
|-
| ModelViewControllerPattern || Splits user interface interaction into three distinct roles.
+
| [[Model view controller pattern]] || Splits user interface interaction into three distinct roles.
 
|-
 
|-
| PageControllerPattern || An object that handles a request for a specific page or action on a Web site.
+
| [[Page controller pattern]] || An object that handles a request for a specific page or action on a Web site.
 
|-
 
|-
| FrontControllerPattern || A controller that handles all requests for a Web site.
+
| [[Front controller pattern]] || A controller that handles all requests for a Web site.
 
|-
 
|-
| TemplateViewPattern || Renders information into HTML by embedding markers in an HTML page.
+
| [[Template view pattern]] || Renders information into HTML by embedding markers in an HTML page.
 
|-
 
|-
| TransformViewPattern || A view that processes domain data element by element and transforms it into HTML.
+
| [[Transform view pattern]] || A view that processes domain data element by element and transforms it into HTML.
 
|-
 
|-
| TwoStepViewPattern || Turns domain data into HTML in two steps: first by forming some kind of logical page, then rendering the logical page into HTML.
+
| [[Two step view pattern]] || Turns domain data into HTML in two steps: first by forming some kind of logical page, then rendering the logical page into HTML.
 
|-
 
|-
| ApplicationControllerPattern || A centralized point for handling screen navigation and the flow of an application.
+
| [[Application controller pattern]] || A centralized point for handling screen navigation and the flow of an application.
 
|-
 
|-
 
|}
 
|}
Line 109: Line 109:
 
{|
 
{|
 
|-
 
|-
| RemoteFacadePattern || Provides a coarse-grained facade on fine-grained objects to improve efficiency over a network.
+
| [[Remote facade pattern]] || Provides a coarse-grained facade on fine-grained objects to improve efficiency over a network.
 
|-
 
|-
| DataTransferObjectPattern || An object that carries data between processes in order to reduce the number of method calls.
+
| [[Data transfer object pattern]] || An object that carries data between processes in order to reduce the number of method calls.
 
|-
 
|-
 
|}
 
|}
Line 119: Line 119:
 
{|
 
{|
 
|-
 
|-
| OptimisticOfflineLockPattern || Prevents conflicts between concurrent business transactions by detecting a conflict and rolling back the transaction.
+
| [[Optimistic offline lock pattern]] || Prevents conflicts between concurrent business transactions by detecting a conflict and rolling back the transaction.
 
|-
 
|-
| PessimisticOfflineLockPattern || Prevents conflicts between concurrent business transactions by allowing only one business transaction at a time to access data.
+
| [[Pessimistic offline lock pattern]] || Prevents conflicts between concurrent business transactions by allowing only one business transaction at a time to access data.
 
|-
 
|-
| CoarseGrainedLockPattern || Locks a set of related objects with a single lock.
+
| [[Coarse grained lock pattern]] || Locks a set of related objects with a single lock.
 
|-
 
|-
| ImplicitLockPattern || Allows framework or layer supertype code to acquire offline locks.
+
| [[Implicit lock pattern]] || Allows framework or layer supertype code to acquire offline locks.
 
|-
 
|-
 
|}
 
|}
Line 133: Line 133:
 
{|
 
{|
 
|-
 
|-
| ClientSessionStatePattern || Stores session state on the client.
+
| [[Client session state pattern]] || Stores session state on the client.
 
|-
 
|-
| ServerSessionStatePattern || Keeps the session state on a server system in a serialized form.
+
| [[Server session state pattern]] || Keeps the session state on a server system in a serialized form.
 
|-
 
|-
| DatabaseSessionStatePattern || Stores session data as committed data in the database.
+
| [[Database session state pattern]] || Stores session data as committed data in the database.
 
|-
 
|-
 
|}
 
|}
Line 145: Line 145:
 
{|
 
{|
 
|-
 
|-
| GatewayPattern || An object that encapsulates access to an external system or resource.
+
| [[Gateway pattern]] || An object that encapsulates access to an external system or resource.
 
|-
 
|-
| MapperPattern || An object that sets up a communication between two independent objects.
+
| [[Mapper pattern]] || An object that sets up a communication between two independent objects.
 
|-
 
|-
| LayerSupertypePattern || A type that acts as the supertype for all types in its layer.
+
| [[Layer supertype pattern]] || A type that acts as the supertype for all types in its layer.
 
|-
 
|-
| SeparatedInterfacePattern || Defines an interface in a separate package from its implementation.
+
| [[Separated interface pattern]] || Defines an interface in a separate package from its implementation.
 
|-
 
|-
| RegistryPattern || A well-known object that other objects can use to find common objects and services.
+
| [[Registry pattern]] || A well-known object that other objects can use to find common objects and services.
 
|-
 
|-
| ValueObjectPattern || A small simple object, like money or a date range, whose equality isn't based on identity.
+
| [[Value object pattern]] || A small simple object, like money or a date range, whose equality isn't based on identity.
 
|-
 
|-
| MoneyPattern || Represents a monetary value.
+
| [[Money pattern]] || Represents a monetary value.
 
|-
 
|-
| SpecialCasePattern || A subclass that provides special behavior for particular cases.
+
| [[Special case pattern]] || A subclass that provides special behavior for particular cases.
 
|-
 
|-
| PluginPattern || Links classes during configuration rather than compilation.
+
| [[Plugin pattern]] || Links classes during configuration rather than compilation.
 
|-
 
|-
| ServiceStubPattern || Removes dependence upon problematic services during testing.
+
| [[Service stub pattern]] || Removes dependence upon problematic services during testing.
 
|-
 
|-
| RecordSetPattern || An in-memory representation of tabular data.
+
| [[Record set pattern]] || An in-memory representation of tabular data.
 
|-
 
|-
 
|}
 
|}

Revision as of 03:20, 23 September 2008

Martin Fowler's architectural patterns book

Patterns of enterprise application architecture by Martin Fowler, 2003.

This is a must-have book for anyone working on "enterprise applications", which used to be known as "information systems", or (for old farts) "data processing". The patterns cover topics such as complex data, concurrency, persistence, distribution, and user interfaces.

The book is in two parts: Part 1 is a narrative that motivates and explains the patterns; part 2 is a catalogue.

The UML diagrams are [[1]].

Domain logic patterns

Transaction script pattern Organizes business logic by procedures where each procedure handles a single request from the presentation.
Domain model pattern An object model of the domain that incorporates both behavior and data.
Table module pattern A single instance that handles the business logic for all rows in a database table or view.
Service layer pattern Defines an application's boundary with a layer of services that establishes a set of available operations and coordinates the application's response in each.

Data source architectural patterns

Table data gateway pattern An object that acts as a Gateway to a database table. One instance handles all the rows in the table.
Row data gateway pattern An object that acts as a Gateway to a single record in a data source. There is one instance per row.
Active record pattern An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.
Data mapper pattern A layer of Mappers that moves data between objects and a database while keeping them independent of each other and the mapper itself.

Object-Relational Behavioral Patterns

Unit of work pattern Maintains a list of objects affected by a business transaction and coordinates the writing out of changes and the resolution of concurrency problems.
Identity map pattern Ensures that each object gets loaded only once by keeping every loaded object in a map. Looks up objects using the map when referring to them.
Lazy load pattern An object that doesn't contain all of the data you need but knows how to get it.

Object-Relational Structural Patterns

Identity field pattern Saves a database ID field in an object to maintain identity between an in-memory object and a database row.
Foreign key mapping pattern Maps an association between objects to a foreign key reference between tables.
Association table mapping pattern Saves an association as a table with foreign keys to the tables that are linked by the association.
Dependent mapping pattern Has one class perform the database mapping for a child class.
Embedded value pattern Maps an object into several fields of another object's table.
Serialized lob pattern Saves a graph of objects by serializing them into a single large object (LOB), which it stores in a database field.
Single table inheritance pattern Represents an inheritance hierarchy of classes as a single table that has columns for all the fields of the various classes.
Class table inheritance pattern Represents an inheritance hierarchy of classes with one table for each class.
Concrete table inheritance pattern Represents an inheritance hierarchy of classes with one table per concrete class in the hierarchy.
Inheritance mappers pattern A structure to organize database mappers that handle inheritance hierarchies.

Object-Relational Metadata Mapping Patterns

Metadata mapping pattern Holds details of object-relational mapping in metadata.
Query object pattern An object that represents a database query.
Repository pattern Mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects.

Web Presentation Patterns

Model view controller pattern Splits user interface interaction into three distinct roles.
Page controller pattern An object that handles a request for a specific page or action on a Web site.
Front controller pattern A controller that handles all requests for a Web site.
Template view pattern Renders information into HTML by embedding markers in an HTML page.
Transform view pattern A view that processes domain data element by element and transforms it into HTML.
Two step view pattern Turns domain data into HTML in two steps: first by forming some kind of logical page, then rendering the logical page into HTML.
Application controller pattern A centralized point for handling screen navigation and the flow of an application.

Distribution Patterns

Remote facade pattern Provides a coarse-grained facade on fine-grained objects to improve efficiency over a network.
Data transfer object pattern An object that carries data between processes in order to reduce the number of method calls.

Offline Concurrency Patterns

Optimistic offline lock pattern Prevents conflicts between concurrent business transactions by detecting a conflict and rolling back the transaction.
Pessimistic offline lock pattern Prevents conflicts between concurrent business transactions by allowing only one business transaction at a time to access data.
Coarse grained lock pattern Locks a set of related objects with a single lock.
Implicit lock pattern Allows framework or layer supertype code to acquire offline locks.

Session State Patterns

Client session state pattern Stores session state on the client.
Server session state pattern Keeps the session state on a server system in a serialized form.
Database session state pattern Stores session data as committed data in the database.

Base Patterns

Gateway pattern An object that encapsulates access to an external system or resource.
Mapper pattern An object that sets up a communication between two independent objects.
Layer supertype pattern A type that acts as the supertype for all types in its layer.
Separated interface pattern Defines an interface in a separate package from its implementation.
Registry pattern A well-known object that other objects can use to find common objects and services.
Value object pattern A small simple object, like money or a date range, whose equality isn't based on identity.
Money pattern Represents a monetary value.
Special case pattern A subclass that provides special behavior for particular cases.
Plugin pattern Links classes during configuration rather than compilation.
Service stub pattern Removes dependence upon problematic services during testing.
Record set pattern An in-memory representation of tabular data.

Update

Fowler is working on a new edition, which will merge in updated ideas from his analysis patterns book, MartinFowler1997 * See [enterprise architecture].

Personal tools