Skip to content

Commit 36482d5

Browse files
committed
Added description for Execute Around.
1 parent 12bc65a commit 36482d5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Behavioral patterns are concerned with algorithms and the assignment of responsi
5151
* [Double Checked Locking](#double-checked-locking)
5252
* [Null Object](#null-object)
5353
* [Callback](#callback)
54+
* [Execute Around](#execute-around)
5455

5556
## <a name="abstract-factory">Abstract Factory</a> [&#8593;](#list-of-design-patterns)
5657
**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
421422
**Applicability:** Use the Callback pattern when
422423
* When some arbitrary synchronous or asynchronous action must be performed after execution of some defined activity.
423424

425+
## <a name="execute-around">Execute Around</a> [&#8593;](#list-of-design-patterns)
426+
**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.
427+
428+
![alt text](https://github.com/iluwatar/java-design-patterns/blob/master/execute-around/etc/execute-around.png "Execute Around")
429+
430+
**Applicability:** Use the Execute Around idiom when
431+
* You use an API that requires methods to be called in pairs such as open/close or allocate/deallocate.
432+
424433

425434
# Frequently asked questions
426435

0 commit comments

Comments
 (0)