Dynamic State PatternDynamic State Pattern
The Dynamic State Design Pattern
Home > Books > Architect's Guide to NetKernel > Design Patterns > Dynamic State Pattern

Rate this page:
Really useful
Satisfactory
Not helpful
Confusing
Incorrect
Unsure
Extra comments:


Specification

f(x,y) where y:y(z)

Description

Very often a service will require configuration state to be supplied as an argument in order to perform a function (indeed this is the embodiment of Representational State Transfer (REST)). The configuration state is supplied as a URI argument to the service. It is often useful to dynamically generate the configuration resource from another service.

Since the configuration resource is referenced by URI it is very simple to initially develop a service with a static configuration resource and later to replace it with a dynamically generated resource which reflects required application state - the URI remains constant only the implementation is changed.

Whether the configuration is static or dynamically generated the state transreption pattern may be used independently.

The resultant dynamically generated configuration resource will be cached and typically will have a lifetime longer than a single request and so will be reused - this is a typical example of dynamic flexibility with pseudo-static performance.

Usage

This pattern is used to by some of the supplied library services see for example http-bridge-config.

© 2003-2007, 1060 Research Limited. 1060 registered trademark, NetKernel trademark of 1060 Research Limited.