26 COUNTING PROXY
This pattern was previously described in GoF95.
DESCRIPTION
The Counting Proxy pattern is useful in designing a set of additional operations such as logging and counting that need to be performed before and/or after a client object invokes a method on a service pr ovider object. Instead of keeping these additional operations’ implementation inside the service provider object, the Counting Proxy pattern suggests encapsulating the additional functionality in a separate object referred to as a counting proxy. One of the characteristics of a well-designed object is that it offers focused functionality. In other words, an object, ideally, should not do various unr elated things. Encapsulating the logging, counting and other similar ...
Get Software Architecture Design Patterns in Java now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.