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 8628175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:28:15+00:00 2026-06-12T08:28:15+00:00

Please somebody clears me up the mess in my head with these patterns: Chain

  • 0

Please somebody clears me up the mess in my head with these patterns:

  • Chain of Command
  • Chain of Responsibility

I’ve seen sites in which both are the same (examples of Chain of Command which are the same as Chain of Responsibility), and other sites in which not.

This is what I understand about each:

CHAIN OF COMMAND:

A class let’s call it CommandChain, with a property holding a list of “commands”, which are instances of classes which implement the same interface. Say they all must implement onCommand(command, arguments).

CommandChain has the addCommand() method to register new commands within it, and runCommand() which accepts a command name, and its parameters. This method should loop through the list of commands until one of them responds, does the corresponding actions, and sends ok.

CHAIN OF RESPONSIBILITY

Just as I’ve seen in some sites, this would be pretty much the same, with this difference:
instead of having a class storing a list of commands to loop through, each command instance would store a reference to the next command instance.

So, is this difference big enough to consider both design patterns different?

In what real cases are they applicable?

  • 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-12T08:28:17+00:00Added an answer on June 12, 2026 at 8:28 am

    They are the same design pattern.

    If they have the same properties and only the implementation differs, they are functionally the same. This indicates that the two design patterns are one and the same.

    Another hint is that there is a Wikipedia page for Chain of Responsibility DP, but none for Chain of Command.

    The “Gang of Four” who wrote the seminal book on DPs were very clear on that behavior and properties, not implementation, defined a design pattern.

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

Sidebar

Related Questions

Can somebody please compare these two logging mechanism?
Please somebody help me. I want to compress a folder (which contains images &
Please somebody advice me how i can run external application from web browser on
could somebody please take a look at this http://jsfiddle.net/bloodygeese/EzkFR/1/ My aim is to on
Can somebody please help me with the if statement and arrays. So for example
Could somebody please explain what this notation is in javascript? What is function(d) doing?
Could somebody please explain or link to a resource that will tell me why
Can somebody please explain how to use macros in x86 assembly coding
Can somebody please explain how to find out if full text search is enabled
Can somebody please let me know how we can determine if a local disk

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.