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

  • Home
  • SEARCH
  • 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 7729105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:53:05+00:00 2026-06-01T05:53:05+00:00

Sometimes I think that Controller and Command are the same because they both encapsulate

  • 0

Sometimes I think that Controller and Command are the same because they both encapsulate business logic. The only difference I can think of is that a command must have an execute() method with no parameters but the controller’s execute() method can accept parameters. Or am I wrong?

  • 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-01T05:53:07+00:00Added an answer on June 1, 2026 at 5:53 am

    It’s a bit like comparing apples to oranges. Conceptually a command is a design pattern, but the controller is a part of a meta design pattern. Which means that they are not mutually exclusive or inclusive. A controller could consist out of a command (or even a collection of commands).
    There are many flavors of MVC and the controller has slightly different responsibilities in many of them, but in general the controller is strictly used to translate user input to application data (model). In most MVC flavors it’s also responsible for updating the view when the model changes.
    In general controllers are longlived. They exist as long as a certain model and/or view exists, or even outlive them if they have a view/model registration system.

    A command on the other hand is theoretically stateless, it does its thing and then is released for garbage collection. In reality commands can live just a little longer than the execution time of their execute method, this is to facilitate async operations more easily. But commands should ALWAYS be strictly focused on one and only one task only and when that’s finished they should disappear.

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

Sidebar

Related Questions

I think allowing recursion can be very handy sometimes, not because I can code
I think that framework shouldn' be a cage for developer, and because Kohana gives
Naming classes is sometimes hard. What do you think name of the class should
I think that (the title) is the problem I am having. I set up
I can successfully push only next view in my iPhone app. However, cause the
I read sometimes from people that seem to be working with rails since longer,
I think that's an easy question but couldn't find the solution. I redirect the
I have a bucket on Amazon S3 where I keep files that sometimes change
This error comes up in our MVC app randomly. Sometimes doing the same exact
I'm always facing a problem where I can't really think of service object encapsulating

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.