8

I keep coming across the word "proxy" used as a verb in tutorials, etc. Usually something will "proxy to" something else. What does this mean?

Having spent some time googling for what it means in a programming context, I mostly found "proxy server" or some other noun use. I understand the word proxy generally means "a stand in," so "proxy to" must mean "to stand in for." Right? But I'm still confused, because it doesn't seem to be used like that.

An example (from a PHP ZF tutorial): "__get(), __set(), __isset(), and __call(): All of these methods simply proxy to the row instance stored in $_row. This provides an easy way to composite Zend_Db_Table_Row with our Model Resource Item." from Keith Pope, Zend Framework 1.8 Web Application Development, 2009.

What does the author mean by "proxy to" in this context?

2
  • 3
    It means the author fails Dijkstra's criterion for competence: "Besides a mathematical inclination, an exceptionally good mastery of one's native tongue is the most vital asset of a competent programmer." Jun 14, 2011 at 15:02
  • 1
    Calvin: "I like to verb words".
    – Cyclops
    Jun 14, 2011 at 15:58

2 Answers 2

11

A proxy, in its most general form, is a class functioning as an interface to something else. The proxy could interface to anything: a network connection, a large object in memory, a file, or some other resource that is expensive or impossible to duplicate. - Wikipedia

In the very context you quote, it means that said methods serve to provide an interface to the instance stored in $_row.

1
  • Wikipedia provides a good definition but it's worth to say a proxy is not just an interface (contract) but a specific type of component which acts as an intermediator between others being able to have it's own logic. Jul 1, 2019 at 14:56
0

The author assumed incorrectly that everybody is familiar with the Proxy pattern. He could have written These methods act as proxies so even people without knowledge of the pattern could understand.

3
  • I agree. But the word "proxy" isn't really limited to computer science, and so it's sufficiently ambiguous by itself to warrant more specific language, I think, whether as a noun or as a verb. So if I saw "these methods act as proxies" I would still be confused. I would've preferred to read "these methods act as interfaces to the instance stored in $_row (cf. Author, "Proxy Pattern")" or something like that.
    – user25791
    Jun 14, 2011 at 16:42
  • 1
    it is not limited to CS but it has the same meaning outside it. A proxy is "something" that acts on behalf of one other. In CS it can be an object or a function, in real life can be a person. If you know the meaning of the word outside of CS you can certainly understand it in CS too. Yes I understand the ambiguity you're talking about, but then it would be the same for "interface". If we use common english words in CS is because they represent the same concept, otherwise we would call them differently. Jun 14, 2011 at 16:53
  • Well, I guess I think "act as an interface" is more descriptive than "act on behalf of," because it says a little more about what the action itself is.
    – user25791
    Jun 14, 2011 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.