What is command design pattern? what is the problem that it solves?

Hi i have been reading few articles on command design pattern but was unable to understand what it is and what problem does it solve. As far as my understanding goes if there is a pre specified method in an object that could execute and perform the necessary activities then it is called as command design pattern. Why is it named as command design pattern, it is because in a shell we use commands to retrieve output. For example when we type "dir" in dos command prompt it returns the list of files. so here we have to remember a preexisting exe file named "dir" which does something when used. So here like we call it command because when "dir" is passed to the computers it returns something that is expected. may be the computer obeys the command issued and return something back. So like wise if there is a method that is defined as as the command, for example in struts framework the action class must have a method "execute()" which is called by the framework to execute the necessary action mapped to it. So if there is a predefined method like "execute" in struts then the object is said to be followed command design pattern. So what actually does it solve?
What ever i have written is my understanding from the articles i have read about the design pattern. So kindly correct me if i am wrong. Help me understanding what actual problem does this pattern solves. Thanking you in advance.

This is really off-topic for these forums. You might do better on StackOverflow.com. I'll just say that although the first Design Patterns book came as a revelation to me, it was more for (a) the nomenclature (decorator, factory, facade, etc) which is still with us and (b) about five of the original patterns, which told me things I didn't already know. I've never used any of the others, including Command, and the whole design patterns thing quickly degenerated into farce with what seemed like a sustained attempt to reduce the whole of computer science to design patterns, which really isn't the point. As an example, there is one in another book called Type Object, which is nothing but 3rd normal form, which can be defined roughly in a couple of sentences. This pattern went on for dozens of pages with a very artificial example. I wrote to the mailing list about it: 'Type Object considered hilarious'. I got a rude reply from the original author, which I guess I expected, but also an incredible response from the list owner, saying I should recast my objections in the form of a design pattern. That lost it for me. True story. Moral: don't take this religion, or any IT religion, too seriously. They come around every 18 months or so with the regularity of the next bit of Moore's Law. I've seen dozens of them come and go since 1971, all with something to say, all 90% nonsense.
See here for a longer version of this incident.

Similar Messages

  • What kind of design pattern is this?

    Hi ,
    I am just learning the designpattern. So when I went through different kinds of design pattern, I got some doubts as it looks same some design patterns. could anybody please tell what kind of design pattern is the following one?
    public interface IExporter{
         void export();
    public class ExcelExporter implements IExporter{
    public void export(){
    //TODO implementation
    public class CVSExporter implements IExporter{
    public void export(){
    //TODO implementation
    }thanks in advance..

    Well - in structure, it is nearest to the Command pattern as far as I can tellOr Strategy. Or Builder. Several design pattenrs may share the same class structure, the difference is in the context, forces, and the parts one want to be flexible. And if someone wants to make it explicit which pattern is applied, they should name things accordingly.
    As Saish said this example shows little more that inheritance at work. Not a pattern in itself, but a core element of the language. Trying to "identify" a pattern that is not obvious from the context is either:
    - a sign that the original coder completely missed the point of using a pattern (which is, as Saish said too, assentially about communication)
    - a sign that the maintenance coder is looking for patterns where there aren't
    - an exercise question
    but it differs in so much as its motivation is to polymorphically allow the use of different exporters rather than provide a set of action commands.That shouldn't count as a difference, merely as an "application" (it's perfectly valid to have a hierarchy of commands all devoted to exporting, although, as stated, if the original coder applied the Command pattern, he should have made it explicit, by renaming the interface, e.g. to ExportCommand).

  • What is singleton design pattern

    Hi All,
    Anybody please tell me what is Singleton Design Pattern ?
    What is the right definition of it and where can I get the right information about it.
    Please help and reply soon
    Thanks
    Amitindia

    Not meaning to be arrogant: check the topic "Public singleton". It explains what the singleton pattern tries to achieve and show various ways of creating singleton classes.

  • Command Design Pattern

    Could someone please explain the command design pattern.
    Initially, I thought each action resulted in a the creation of a new command object that contained the data and methods to accomplish its task.
    But it appears to me now that the command object representing a possible action would actually be created at initialization and it would be given to all the related objects that need to update the command object or respond to the command object .
    Could someone provide some clarity
    Stephen

    I don't see that it makes a difference whether the command objects are reusable or not.

  • My itunes wont auto sync my iphone 4 after i connect it to itunes. But it can auto sync when i connect it to my old laptop. what's the problem that it can't auto sync and when i did a backup in my new laptop, it was corrupted the next day.

    But it can auto sync when i connect it to my old laptop. what's the problem that it can't auto sync and when i did a backup in my new laptop, it was corrupted the next day and i was forced to use back a backup which i did in my old laptop 4 months ago. do i have to reinstall the itunes? will my backups be corrupted after i sync again? pls guide.
    P.S/ its the latest version of the itunes whenever i did the backups.

    iPod touches or any iDevices from Apple sync only to one computer. If you sync to a different computer, all your music will be replace with the music from the new computer's iTunes. If the music were purchased from iTunes, you can re-download them again otherwise the music on iPod touch will be deleted. Do you have iTunes backup? 

  • I have an apple iphone4 im facing the problem that my phone senser is not working when i rotate the phone in videos or music play there is working from the senser can u tell me what can i do for this....

    i have an apple iphone4 im facing the problem that my phone senser is not working when i rotate the phone in videos or music play there is working from the senser can u tell me what can i do for this....

    If you double tap the home button, and then swipe your finger to the right, make sure you DO NOT have the Lock Orientation button enabled.
    You know it is disabled if there is no padlock in the middle of the icon.

  • TS4291 I can't send mail from my iPad apps, I just get the error message, 'The recipient- was rejected by the server because it does not allow relaying.' Does anyone know what this means and how to fix the problem.

    I can't send mail from my iPad apps, I just get the error message, 'The recipient… was rejected by the server because it does not allow relaying.' Does anyone know what this means and how to fix the problem.

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Using a POP account with multiple devices
    http://support.apple.com/kb/ht3228
    iOS: Adding an email account
    http://support.apple.com/kb/HT4810
    iOS: Setting up an Outlook.com, Hotmail, Live, or MSN email account
    http://support.apple.com/kb/ht1694
    Server does not allow relaying email error, fix
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    Why Does My iPad Say "Cannot Connect to Server"?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    How to Sync Contacts with Your iPad Using iTunes
    http://www.dummies.com/how-to/content/how-to-sync-contacts-with-your-ipad-using- itunes.html
    iOS: 'Mailbox Locked', account is in use on another device, or prompt to re-enter POP3 password
    http://support.apple.com/kb/ts2621
    eMail Groups - You can use a third party app that many users recommend.
    MailShot -  https://itunes.apple.com/us/app/mailshot-pro-group-email-done/id445996226?mt=8
    Group Email  -  https://itunes.apple.com/us/app/group-email!-mail-client-attachments/id380690305 ?mt=8
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Configuration problems with IMAP e-mail on iOS with a non-standard SSL port.
    http://colinrobbins.me/2013/02/09/configuration-problems-with-imap-e-mail-on-ios -with-a-non-standard-ssl-port/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • Hello I'm from mexico and I have the problem that my ipod touch 5g load not ..... I've been reading and this may in total discharge because I trying it a week and I have not been able to load what do I do? please help

    hello I'm from mexico and I have the problem that my ipod touch 5g load not ..... I've been reading and this may in total discharge because I trying it a week and I have not been able to load what do I do? please help

    - See:      
    iPod touch: Hardware troubleshooting
    - Try another cable. Some 5G iPods were shipped with Lightning cable that were either initially defective or failed after short use.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
      - Make an appointment at the Genius Bar

  • TS1398 my iphone 4s can not scan any wifi network, i tried everything but still can not scan any wifi connection even though our wifi is working properly in our mac book and ipad. What do i need to do if the problem is the hardware?pls help

    my iphone 4s can not scan any wifi network, i tried everything but still can not scan any wifi connection even though our wifi is working properly in our mac book and ipad. What do i need to do if the problem is the hardware?pls help

    When you say it "can not scan any wifi network" do you mean it is not detecting Wi-Fi networks?
    Is Wi-Fi turned on in Settings > General > Wi-Fi?
    Have you tried Settings > General > Reset > Reset Network Settings?
    Is it just the home network that the device will not connect to? or any network?

  • Good morning, my photoshop stopped working, it gives error when started, what can it be?  This is the message that appears: Unable to start the program it took a unexpected end of file  I hope answer

    Good morning, my photoshop stopped working, it gives error when started, what can it be?
    This is the message that appears:
    Unable to start the program it took a unexpected end of file
    I hope answer

    Could not initialize Photoshop because an unexpected end-of-file was encountered. | Mylenium's Error Code Database
    Mylenium

  • When i'm trying to opem Itunes, I get a message that I'm missing MSVCR80.dll on my computer. I have tryies to re-install Itunes, but the problem wasn't solved - what should I do?

    When i'm trying to opem Itunes, I get a message that I'm missing MSVCR80.dll on my computer. I have tryies to re-install Itunes, but the problem wasn't solved - what should I do?

    Click here and follow the instructions. You may need to completely remove and reinstall iTunes and all related components, or run the process multiple times; this won't normally affect its library, but that should be backed up anyway.
    (99343)

  • HT201441 I buy may iPhone 5 from the UK store ,, It s A new one and no one has used it before ,, the problem that it asked for an other apple ID !!! ,, my order for my iPhone is here in the UK store .. what should i do now ????     ,,, help me please

    I buy may iPhone 5 from the UK store ,, It s A new one and no one has used it before ,, the problem that it asked for an other apple ID !!! ,, my order for my iPhone is here in the UK store .. what should i do now ????     ,,, help me please

    Take it back and ask for a refund or a replacement.

  • TS3899 In my iPad 2 with IO6 today I can not send emails from my gmail account, they go to the outbox directly...why? How can i solve this problem? ..I restarted the IPad but the problem was not solved. Please help.

    In my iPad 2 with IO6 today I can not send emails from my gmail account, they go to the outbox directly...why? How can i solve this problem? ..I restarted the IPad but the problem was not solved. Please help.

    Greetings,
    Questions:
    1. What version of the Mac OS are you running (Apple > About this Mac)?
    2. What version of the iOS are you running (Settings > About)?
    3. Do you use MobileMe/ iCloud or another server based sync solution like Google or Yahoo?
    4. Do other changes to synced information like Address Book content sync successfully back and forth?
    Based on your description it sounds like you have a 1 way sync issue.  Events sync fine between the iOS devices and fine from the computer to the iOS devices but not from the iOS devices to the computer.
    Try:
    Backup your computer and iOS devices before doing anything else:
    http://support.apple.com/kb/HT1427
    http://support.apple.com/kb/ht1766
    Ensure all the devices in use are fully up to date: Apple > Software Update / Settings > General > Software Update
    Make separate backups of critical data:
    Backup your computer Addressbook: http://docs.info.apple.com/article.html?path=AddressBook/4.0/en/ad961.html
    Backup your computer iCal: http://support.apple.com/kb/HT2966
    Reset syncing on your Mac: http://support.apple.com/kb/TS1627
    Reply back if that does not resolve your issue.
    Hope that helps.

  • A few months ago, I purchased a new iMac. I recently created a movie using iMovie. Then I found out that iDVD is not included. So I have the problem that I want to burn a movie that I can play on my DVD player and watch on a television. i rang Applecare a

    A few months ago, I purchased a new iMac. I recently created a movie using iMovie. Then I found out that iDVD is not included. So I have the problem that I want to burn a movie that I can play on my DVD player and watch on a television. I rang Applecare and was told that I need a program called BURN.
    Is this correct? I can export the movie from iMovie in a m4v format, but I think I need to convert this to iso format before I can burn the disc.
    I know there are programs like TOAST that will do this, but it is expensive.
    I would be very grateful for any assistance.

    Burn will not do what you want, and there is no real substutute for iDVD.
    Why is there no iDVD on my new Mac?
    Apple insists that the entire world has access to fast broadband (and are prepared to pay for the considerable bandwidth usage) and wants to distribute home movies to friends and relatives via download (iCloud, YouTube, Facebook, whatever) rather than mailing them a DVD. The fact that in reality not all users do, has so far had no effect on this policy. If you scream and shout loudly enough down the phone Apple may send you a free copy of iDVD. Stating that they would return their brand new Mac unless they received a copy of iDVD worked for some, but that is now said to have been withdrawn by Apple.
    Also, you can complain bitterly via Apple’s Feedback link, perhaps suggesting that Apple could have provided a choice between burning DVDs and distributing home movies by other means. You may feel that Apple should not dictate how you destribute family videos or photos to distant relatives and friends, and should not assume that every user is prepared to pay for the excessive bandwidth usage charged by ISPs for huge downloads from the App Store:
    http://www.apple.com/feedback/
    Whilst Macs with a Superdrive continue to be able to burn video DVDs, the software for so doing, iDVD, is no longer included in the iLife bundle that came with OS 10.7 Lion (which also omitted iWeb) or that comes with OS 10.8 Mountain Lion. And it is no longer included in the iLife 11 from the online Apple Store: http://www.apple.com/ilife/. Your only solution is to look on Amazon or eBay and try to get an older version that includes iDVD 7, i.e. iLife version 9 onwards. You should also do this if you plan to buy a new Mac anytime soon, as stocks of iLife that include iDVD will not be available for ever.
    However, the vastly more expensive FCPX can burn a DVD without iDVD or DVD Studio Pro involvement, but lack the themes etc of iDVD. Also, of course, there is Roxio Toast, which is the best software for burning anything but again does not offer the flexibility of iDVD.
    And if you think Microsoft are any better, their new Windows 8 operating system will not play DVDs, or burn them, unless customers buy an extra upgrade, the company has announced:  http://www.gizmag.com/windows-8-no-dvd-playback/22443/
    In other words, computer manufacturers have declared optical media as dead, long before consumers are ready to stop using them, which is fine as long as they offered us a choice, but they won’t even do that. Flexibility and intuitive use of a computer seems to be a thing of the past.

  • Is ios8.2 solving the problems that ios8.0.2 is causing. I will not be caught out again untill I hear of the results.

    I Have just had a notification that IOS 8.2 is available for download. Does it cure the problems that IOS 8.0.2 caused?

    It is not 8.2, but 8.1 and I am NOT convinced it solves most of the vexing issues with iPad 2 and 3, yet.
    I still have not updated my iPad 3 at this stage and I guess I will be waiting even longer until I see how iOS 8.2 shakes out.
    This my own opinion and feelings based on what iPad 2 and 3 owners are still reporting on this latest iOS 8.1 update.
    I would continue to wait it out.
    We spent a lot of money on our iPads to have Apple's recent iOS offering turn them into useless paperweights.

Maybe you are looking for

  • Boot Camp and Windows 7 Problems

    I have found a reproducible bug with Boot Camp and WIndows 7. Clean install of OS X 10.6.2, Boot Camp Asst. Partition on my Mac Pro boot drive, clean install Win 7. Problem: while in OS X, Disk Util Repair Permissions takes forever, churning away at

  • HT4718 Ilife not in 'purchased' apps after recovery. How can I get it without buying it?

    I recently formatted my mac and recovered it using the provided disk. I went to use Iphoto (which I had previously - I think the store installed it for me?) and it wasn't there so I read the discussions and this post and checked the app store, but th

  • Passing variable with function in AS3

    This is a function on the first frame of a .fla updated to AS3 from an old AS2 file: function initialize() { MovieClip(root).stage_target_mc.max_messages = 600; When the function is called it should set "max_messages" to 600 in AS3, right? Thanks

  • How can you save "text to speech" as file?

    Does anyone know how to save "text to speech" as an audio file?

  • BBP_OM_FIND_SC Brings deleted purchase Organizations

    Hi, When creating a SC in SRM 5.0 and we get an exception.  After debuging LBBP_PDORGF11 we get to the point where the BBP_OM_FIND_SC is called. with parameters : SEARCH_FOR = some_user and SEARCH_CATID = [logsys,catid] the result is [C22,50001122] (