diff --git a/README.md b/README.md index 325f42b27..073cb4859 100644 --- a/README.md +++ b/README.md @@ -422,6 +422,9 @@ 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. +**Real world examples:** +* [CyclicBarrier] (http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CyclicBarrier.html#CyclicBarrier%28int,%20java.lang.Runnable%29) constructor can accept callback that will be triggered every time when barrier is tripped. + ## 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. @@ -430,7 +433,6 @@ Behavioral patterns are concerned with algorithms and the assignment of responsi **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 **Q: What is the difference between State and Strategy patterns?** diff --git a/callback/src/main/java/com/iluwatar/App.java b/callback/src/main/java/com/iluwatar/App.java index 6a36d66d7..2d79d8edf 100644 --- a/callback/src/main/java/com/iluwatar/App.java +++ b/callback/src/main/java/com/iluwatar/App.java @@ -1,7 +1,7 @@ package com.iluwatar; /** - * Callback pattern is more native for dynamic languages where function are first-class citizen. + * Callback pattern is more native for functional languages where function is treated as first-class citizen. * Prior to Java8 can be simulated using simple (alike command) interfaces. */ public class App {