Design Pattern : Proxy Versus Chain of Responsibility

Connect with

These two design pattern i.e. Proxy design pattern and chain of responsibility (CoR) seems similarity somewhere or others. Structurally both are same but intent of both design pattern are different. Let me explain the similarity and differences between them.

Proxy Design Pattern

control Access to it.

What is proxy?

It’s an intermediary between a client object and the target object. responsibility wise it, It receives a call from client object and forwards them to the target Object.

Chain of Responsibility

allows an object to send a command without knowing what object will receive and handle it.

The Chain of Responsibility design pattern allows an object to send a command without knowing what object will receive and handle it. The request is sent from one object to another making them parts of a chain and each object in this chain can handle the command, pass it on or do both.

The example of Chain of Responsibility is Filter Interceptor in core J2EE design pattern. In the Filter there is a chain and no one know about another , if any filter does not fulfilled then request to next filter , if fulfilled then return from the same filter to caller. There could be possibility that no one fulfilled the request. Another example of approval of Purchase Order in work flow by Manger, sr Manger, Director, AVP, VP, COO etc.. Every person has limit to approve if limit exceeds , send request to next in the work flow.

Key Points

[table “” not found /]

Reference

Please write your comment to improve this post.


Connect with

12 thoughts on “Design Pattern : Proxy Versus Chain of Responsibility

  1. I have been rowsing online more thqn 3 hours today, yet I never found any interesting article like yours.
    It’s pretty worth enough for me. In my view, if all site
    owners and bloggers made goood content as you did, the net will
    be a lot more useful than ever before.|
    I couldn’t refrain from commenting. Well written!|

  2. It is pretty worth enough for me. In my opinion, if all web owners and bloggers made good content as
    you did, the net will be much more useful than ever before.|
    I couldn’t resist commenting. Perfectly written!

  3. I have beesn browsing online more than 3 hours today, yet I never found any
    interesting article like yours. It’s pretty worth enough for me.

  4. I’ve been surfing online more han three hours today, yet I never
    found any ihteresting article like yours. It’s pretty worth enough for me.
    In my opinion, iif all website owners and bloggers made good content as you did, the internet will be a loot more
    useful than ever before.|
    I couldn’tresist commenting. Perfectly written!

  5. I have been surfing online more than 2 hours today, yet I never found any interesting
    article like yours. It’s pretty worth enouygh for me.
    Personally, if all site owners and bloggers made good content as you did,
    the internet will be much more useful than evr before.|
    I could not refrain from commenting. Very ell written!|

  6. I have been beowsing onlinne more than three
    hours today, yet I never found any interesting article like yours.
    It is pretty wrth enough for me. Personally, if all web owners aand bloggers made gpod content as youu did, the web will
    be much more useful than ever before.|
    I could not refrain from commenting. Very well written!

  7. I have been browsing online more than 2 hours today, yett I never found any nteresting article like yours.

  8. I’ve been surfing online more than 2 hojrs today, yet I never found any interesting article like yours.
    It is pretty worth enough for me.
    I couldn’t refrain from commenting. Perfectly written!
    I will immediately grab your rss as I can not find
    your e-mail subscription link oor e-newsletter service. Do you’ve any? Kindly let me
    recognize so that I may subscribe. Thanks.

  9. I am no more sure where you’re getting your information, but good topic.
    I must spend a little while learning a lot more or exercising more.
    Thanks for magnificent information I found myself searching for this info for my mission.

  10. First of all I want to say fantastic blog! I had a quick question that I’d like to ask
    if you don’t mind. I was curious to know how
    you center yourself and clear your mind prior to writing.

    I’ve had trouble clearing my thoughts in getting
    my thoughts out there. I truly do enjoy writing but it
    just seems like the first 10 to 15 minutes are generally wasted just trying to figure out how to begin. Any ideas or hints?
    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *