layout: pattern title: Service Layer folder: service-layer permalink: /patterns/service-layer/ categories: Architectural tags: – Data access Intent Service Layer is an abstraction over domain logic. Typically applications require multiple kinds of interfaces to the data they store and logic they implement: data loaders, user interfaces, integration gateways, and others. Despite their different purposes, these interfaces often […]


layout: pattern title: Service Locator folder: service-locator permalink: /patterns/service-locator/ categories: Architectural tags: Game programming – Performance Intent Encapsulate the processes involved in obtaining a service with a strong abstraction layer. Class diagram Applicability The service locator pattern is applicable whenever we want to locate/fetch various services using JNDI which, typically, is a redundant and expensive […]


layout: pattern title: Servant folder: servant permalink: /patterns/servant/ categories: Behavioral tags: – Decoupling Intent Servant is used for providing some behavior to a group of classes. Instead of defining that behavior in each class – or when we cannot factor out this behavior in the common parent class – it is defined once in the […]


layout: pattern title: Serverless folder: serverless permalink: /patterns/serverless/ categories: Architectural tags: – Cloud distributed Serverless Serverless eliminates the need to plan for infrastructure and let’s you focus on your application. Following are optimization katas you should be aware of while building a serverless applications The Lean function Concise logic – Use functions to transform, not […]


layout: pattern title: Saga folder: saga permalink: /patterns/saga/ categories: Concurrency tags: – Cloud distributed Also known as This pattern has a similar goal with two-phase commit (XA transaction) Intent This pattern is used in distributed services to perform a group of operations atomically. This is an analog of transaction in a database but in terms […]


layout: pattern title: Semaphore folder: semaphore permalink: /patterns/semaphore/ categories: Concurrency tags: – Performance Also known as Counting Semaphore Intent Create a lock which mediates access to a pool of resources. Only a limited number of threads, specified at the creation of the semaphore, can access the resources at any given time. A semaphore which only […]


layout: pattern title: Resource Acquisition Is Initialization folder: resource-acquisition-is-initialization permalink: /patterns/resource-acquisition-is-initialization/ categories: Idiom tags: – Data access Intent Resource Acquisition Is Initialization pattern can be used to implement exception safe resource management. Class diagram Applicability Use the Resource Acquisition Is Initialization pattern when You have resources that must be closed in every condition


layout: pattern title: Retry folder: retry permalink: /patterns/retry/ categories: Behavioral tags: – Performance Retry / resiliency Enables an application to handle transient failures from external resources. Intent Transparently retry certain operations that involve communication with external resources, particularly over the network, isolating calling code from the retry implementation details. Explanation The Retry pattern consists retrying […]


layout: pattern title: Role Object folder: role-object permalink: /patterns/role-object/ categories: Structural tags: – Extensibility Also known as Post pattern, Extension Object pattern Intent Adapt an object to different client’s needs through transparently attached role objects, each one representing a role the object has to play in that client’s context. The object manages its role set […]


layout: pattern title: Reader Writer Lock folder: reader-writer-lock permalink: /patterns/reader-writer-lock/ categories: Concurrency tags: – Performance Intent Suppose we have a shared memory area with the basic constraints detailed above. It is possible to protect the shared data behind a mutual exclusion mutex, in which case no two threads can access the data at the same […]