This document describes the structural relationship between Content Resolver and Content Provider and explains how it resembles the Proxy Design Pattern described by the GoF.
Structural Relationship between Content Resolver and Content Provider of Android - an example of Proxy Design Pattern
1. Structural Relationship between Content Resolver
and Content Provider of Android - an example of
Proxy Design Pattern
by
Somenath Mukhopadhyay
som.mukhopadhyay@gmail.com
As i was digging into the source code of Content Provider and Content Resolver, i found a nice
structural relationship among the two and it closely resembles the Proxy Pattern of the GoF
book. We need Proxy Pattern whenever there is a need of a sophisticated reference to an object
other than the simple pointer.
The class diagram of the Proxy Pattern is something similar to the following:
What it actually does is that it adds a level of indirection when accessing an object. Whenever a
client needs to interact with an object of a RealSubject, it instead interacts with a Proxy of it. The
proxy forwards the request to the RealSubject.