Thursday 28 November 2019

Proxy Design Pattern - C# (Structural)

The proxy design pattern is used to provide a surrogate object, which references to other objects. ( it acts as a representation of an object and will basically be the access point to use the original object.) Or we can say it acts as a substitute for a real service object used by a client
The proxy pattern involves a class, called proxy class, which represents the functionality of another class. A proxy receives client requests, does some work (access control, caching, etc.) and then passes the request to a service object.
Examples: For an example, we may have a web service API to get the live Stock Market feed or a live Cricket match score. Client applications that need these kinds of data cannot directly access the resources and need to use some kind of intermediate to fetch it. In this case, any API service acts as a Proxy on behalf of the actual resource. This kind of pattern allows not only to control the access to the resources only when required, but also provides security as the client code cannot directly access the resources and must pass through the proxy.

No comments:

Post a Comment

Baisic Useful Git Commands

  Pushing a fresh repository Create a fresh repository(Any cloud repository). Open terminal (for mac ) and command (windows) and type the be...