lundi 9 janvier 2017

Strategy design or Adaptor pattern pattern?

I want to create some classes of each Virtual Server Provider, for example:

  • Digital Ocean
  • Linode
  • Amazon AWS

Each Provider has own PHP class (via composer) to use their API interface, I want to use their class library but I want to make sure I can use same method for each provider. For example of shutting down VPS:

  • Linode: powerOff()
  • Digital Ocean: haltServer()

I want to create shutdown() method that will be available all providers classes. Should I use Strategy design or Adaptor pattern?

Aucun commentaire:

Enregistrer un commentaire