Home > Articles > Programming > C/C++

  • Print
  • + Share This
Like this article? We recommend

The Strategy

The strategy design pattern provides a means for similar algorithms to be provided by multiple handlers. The handlers are similar but not the same! In other words, each handler might do something slightly different, as we saw with the handler for the path and lsp objects. As mentioned above, the event handlers are the strategy methods. Each handler can do its own thing specific to the incoming event; for example, the lsp object can go so far as to suggest a new path for the LSP123 entity. The path object is much less capable in that it can only suggest that a new path is needed without being able to say which lsp object requires the new path.

  • + Share This
  • 🔖 Save To Your Account