Questions tagged [proxy-pattern]

A design pattern that provides a placeholder for another object to control access, reduce cost, and reduce complexity. One of the Gang of Four's structural design patterns.

A Proxy may

  • Provide a surrogate or placeholder for another object to control access to it.
  • Use an extra level of indirection to support distributed, controlled, or intelligent access.
  • Add a wrapper and delegation to protect the real component from undue complexity.

This is one of the Gang of Four's structural , first published in Gamma et al.'s book "Design Patterns: Elements of Reusable Object-Oriented Software".

More information is available on Wikipedia.

130 questions
1
vote
2 answers

What is the appropriate terminology in Java when building remote proxies?

Suppose that I am implementing a remote proxy in Java to an object that is likely to reside on a remote server but may reside locally. There's my real object on the remote server, there's the local implementation (the proxy itself), and there's the…
Uri
  • 88,451
  • 51
  • 221
  • 321
1
vote
2 answers

Proxy Pattern: how is it more efficent that creating the real object?

In the following example, from wiki books https://en.wikibooks.org/wiki/Computer_Science_Design_Patterns/Proxy I am not sure how this is faster/more effiecent than just creating the real object and using display image from it. Becuase the proxy…
user3287264
1
vote
2 answers

Why proxy implements subject interface in Proxy pattern

I was going through the proxy pattern and noticed that the Proxy class also implements the Subject interface, which is implemented by the concrete implementations or the Subject classes as well. Can anyone provide a reason why we need to do so ?…
Tech Jay
  • 404
  • 1
  • 6
  • 16
1
vote
0 answers

Python Proxy pattern classmethod fails

I'm working on a Proxy pattern in Python. I got the regular methods proxied properly using the __getattr__ method. However, the classmethod fails. class DBClass(object): def aMethod(self): print 'aMethod' @classmethod …
user1928896
  • 514
  • 1
  • 4
  • 16
1
vote
1 answer

how is Proxy pattern defined?

from my understanding i implement the proxy pattern when i hold a reference to another type as a member in my Proxy class. i also need to provides an interface, identical to the subject type, and Controls access to the real object. so, if my code…
1
vote
0 answers

Forward declaration in externing data from DLL to core program

I'm writing a dll, which contains a c++ class definition, and a core program based on the proxy pattern, as described in this tutorial: http://www.linuxjournal.com/article/3687 Specifically, this dll, after is loaded on the core program, will fill…
khanhhh89
  • 317
  • 5
  • 19
1
vote
3 answers

JavaScript Proxy Pattern Explained

I study JavaScript Proxy Pattern, but I still do not get, where I can benefit from it. I would therefore like to provide you with two examples and kindly ask you to point at the difference between them. Please, take a look at the code below: What…
Bunkai.Satori
  • 4,698
  • 13
  • 49
  • 77
1
vote
2 answers

Visitor design pattern with GWT

I had an idea and it goes like this: Parse a file on service side. Create a list of actions based on the file's contents. Pass the list of actions to the client side. Have the client define and perform actions based on the items on the list. As in…
denarced
  • 322
  • 3
  • 10
1
vote
2 answers

Proxy & Memento Patterns

Proxy - what code (and where) translates ProxyService into RealService calls? Why/when use this? Layers - how to implement? Memento - why not just persist state to a cache or file? My understanding of the Proxy pattern is that you have some kind of…
IAmYourFaja
  • 55,468
  • 181
  • 466
  • 756
0
votes
2 answers

Is this over-eager loader object an example of a Proxy Pattern implementation?

I have a Java system that consumes an API. A few days ago, we started facing the following problem: the remote API was receiving too many requests from my system. Back in the system's early days, it was not a major concern, but little by little the…
Cacovsky
  • 2,536
  • 3
  • 23
  • 27
0
votes
1 answer

Where in the .NET Framework is Proxy pattern utilized

I know Web Services and WCF services are examples of the proxy pattern, where else in .NET land is the proxy pattern utilized?
dbobrowski
  • 846
  • 2
  • 9
  • 18
0
votes
1 answer

How to annotate proxy beans to not be considered as "bean of interface" in CDI

Following scenario public interface MyInterface{ void doSomething(); } @ApplicationScoped public static class MyInterfaceImpl implements MyInterface{ @Override public void doSomething() { …
Marian Klühspies
  • 15,824
  • 16
  • 93
  • 136
0
votes
2 answers

Error expected unqualified-id before '=' token when assigning a function pointer to the address of another function

I have the following program that I attempt to use function pointer to "save memory",by saving an address of a function to a member variable, which is the function pointer. The function pointer is provideService_proxy which is defined by typedef…
0
votes
1 answer

spring Aspect return and Controller method return, i don't understand

1. Controller @Controller public class myViewController{ @RequestMapping("myMainPage") public void myMainPage(Model model){ model.addAttribute("logoImg", "site_logo.png"); } } 2. Aspect @Around("execution(*…
gf160
  • 21
  • 1
  • 2
0
votes
0 answers

How can I fix/improve the typings of my Decorator containing a Proxy?

I've written this decorator which uses a Proxy to read value from the local storage for a list of specified properties. function StoredValues(storageKey: string, storedProperties: Array) { function keyForProperty(property: string |…
Matthieu Riegler
  • 31,918
  • 20
  • 95
  • 134
1 2 3
8 9