Plugins are small pieces of functionality that are swappable. Plugins that perform similar functionality are of the same plugin type.
Link : https://www.drupal.org/developing/api/8/plugins
Plugins are much like PHP native interfaces with a little extra: the plugin system can discover every implementation of an interface (the default is magic namespacing), deals with metadata (by default this is provided by annotations) and provides a factory for the plugin classes.
Plugin or Service?
Plugin
Plugins implement different behaviors via a common interface.
Service
Services provide the same functionality, and are interchangeable, differing only in their internal implementation.
Comments