Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8231289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:26:12+00:00 2026-06-07T17:26:12+00:00

Proxy – what code (and where) translates ProxyService into RealService calls? Why/when use this?

  • 0

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 Service interface that has ProxyService and RealService concretions. For some reason, you can’t access the RealService, so you code against a ProxyService instance and then let the framework link the proxy to the real instance of your service. Only two problems:

  • I can’t think of a single example when I would have access to Service and ProxyService, but not RealService – can someone provide examples as to when this could happen?

How is this different from the Memento pattern? My understanding of Memento’s definition is that it is used for saving an object state, which is what a Proxy is really doing, yes? If not please explain how Memento is different than Proxy! Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T17:26:13+00:00Added an answer on June 7, 2026 at 5:26 pm

    First off, I’ll caveat my answer by saying that I don’t believe there are any hard and fast rules about patterns – you take what you need from them and nothing more. The way that I use certain patterns is undoubtedly different from how another developer might choose to use them. That said, here’s my take on your question.

    Proxy Pattern Explained

    The way I know the Proxy design pattern, you use it to do two things:

    1. Restrict access to otherwise public methods of a particular object instance
    2. Prevent otherwise-expensive, and unnecessary instantiation costs, by instantiating the concrete object on the first call to the proxy, then passing all further calls on the proxy through to the concrete instance your proxy created.

    Maybe RealService has a method doSomethingReallyDangerous() that you want to hide. Or even more innocuous, maybe RealService has several hundred methods that you don’t need to see every time you type the . after a RealService instance’s variable name. You’d use a proxy for any of this.

    For further reading, this article has a lot of good information:

    http://sourcemaking.com/design_patterns/proxy

    Differences with Memento Pattern

    The Memento pattern allows you to roll back an object to its original state, or some previous state, by storing intermediate states alongside the concrete object. Sort of like an “undo” for programming. You’d probably use a Proxy pattern to implement Memento, but Proxy doesn’t guarantee saving of object state or rollback – it just lets you refer to the same object for method calls if instantiating that object over again is prohibitively expensive.

    So hopefully that helps – I like to think of Memento as a more full-featured version of Proxy, but not all Proxy implementations are Mementos.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I can proxy a single function in javascript by doing something like this (just
I've got a proxy class (created with WDSL). Now i want to use this
I have this image proxy. It worked fine in PHP 4 but not that
I create a proxy service with Carbon Studio, this service has a Throttling policy,
where do we use proxy script manager
The proxy objects generated by gSoap indicate that I should use a vector of
I'm writing a proxy library (called Library A) that is just an interface to
Proxy update on ExtJS is not loading my update API instead it loads URL
I use a proxy model on User like class Nuser(User): class Meta: proxy =
How I can add proxy/socks4/socks5 to C# Socket. I need use it throw Socket.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.