2

I'm writing an application in which a certain piece of functionality can be fulfilled by one of more components. The app user defines in the settings which class should be used to provide each functionality. Does this concept have name?

The closest concept I can think of would be a stub, but that is used only for testing.

An example of that concept is in Django: the setting variable STATICFILES_FINDERS stores the class names to be used for finding static files.

Community
  • 1
  • 1
Régis B.
  • 10,092
  • 6
  • 54
  • 90

1 Answers1

2

I don't know Django but from the documentation this is an implementation of the chain of responsibility pattern.

The pattern where you can specify an implementation from the configuration is called a plugin pattern.

fjardon
  • 7,921
  • 22
  • 31
  • The Django example is not the best one, since I'm not necessarily looking for a series of processing objects; but the plugin pattern is spot on. – Régis B. Jul 28 '16 at 15:23