SimpleCommand.lua 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --[[
  2. * @author PureMVC Lua Native Port by Sean
  3. * @author Copyright(c) 2006-2012 Futurescale, Inc., Some rights reserved.
  4. *
  5. * @class puremvc.SimpleCommand
  6. * @extends puremvc.Notifier
  7. *
  8. * SimpleCommands encapsulate the business logic of your application. Your
  9. * subclass should override the #execute method where your business logic will
  10. * handle the
  11. * {@link puremvc.Notification Notification}
  12. *
  13. * Take a look at
  14. * {@link puremvc.Facade#registerCommand Facade's registerCommand}
  15. * or {@link puremvc.Controller#registerCommand Controllers registerCommand}
  16. * methods to see how to add commands to your application.
  17. *
  18. * @constructor
  19. ]]
  20. local Notifier = require( framework.PACKAGE_NAME .. '/patterns/observer/Notifier')
  21. local SimpleCommand = class('SimpleCommand', Notifier)
  22. function SimpleCommand:ctor()
  23. SimpleCommand.super.ctor(self)
  24. end
  25. --[[
  26. * Fulfill the use-case initiated by the given Notification
  27. *
  28. * In the Command Pattern, an application use-case typically begins with some
  29. * user action, which results in a Notification is handled by the business logic
  30. * in the #execute method of a command.
  31. *
  32. * @param {puremvc.Notification} notification
  33. * The notification to handle.
  34. * @return {void}
  35. ]]
  36. function SimpleCommand:execute(notification)
  37. end
  38. return SimpleCommand