From 36482d5b7ce0941cee6aabd96f35c5d4f5537a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Sun, 29 Mar 2015 21:41:41 +0300 Subject: [PATCH] Added description for Execute Around. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 24735a590..13343121b 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Behavioral patterns are concerned with algorithms and the assignment of responsi * [Double Checked Locking](#double-checked-locking) * [Null Object](#null-object) * [Callback](#callback) +* [Execute Around](#execute-around) ## Abstract Factory [↑](#list-of-design-patterns) **Intent:** Provide an interface for creating families of related or dependent objects without specifying their concrete classes. @@ -421,6 +422,14 @@ Behavioral patterns are concerned with algorithms and the assignment of responsi **Applicability:** Use the Callback pattern when * When some arbitrary synchronous or asynchronous action must be performed after execution of some defined activity. +## Execute Around [↑](#list-of-design-patterns) +**Intent:** Execute Around idiom frees the user from certain actions that should always be executed before and after the business method. A good example of this is resource allocation and deallocation leaving the user to specify only what to do with the resource. + +![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/execute-around/etc/execute-around.png "Execute Around") + +**Applicability:** Use the Execute Around idiom when +* You use an API that requires methods to be called in pairs such as open/close or allocate/deallocate. + # Frequently asked questions