Please enable JavaScript.
Coggle requires JavaScript to display documents.
PROXY PATTERN - Coggle Diagram
PROXY PATTERN
CODE
class BookParser : IBookParser
- // Constructor
public BookParser (string book) :fire:
- // Method
public int getNumPages()
-
class LazyBookParser : IBookParser
string book;
BookParser parser = null;
public LazyBookParser(string book)
int getNumPages()
- The lazy book parser will have a constructor to pass the string of the book
- We have to check if we have a parser and call getNumPages
Definition
The proxy pattern provides a surrogate or placeholder for another object. In order to control access to it
We have an object that we want to interact with, but instead of interacting with the object we interact with a proxy and the proxy will interact with the object
-
-
-
-
-
-
-