Pros and cons of using plugins vs observers in Magento 2

Magento 2 Development

In a few words, plugins are omnipresent in Magento 2 since they provide the ability to modify/replace behavior of any public method in the system. On the other hand, observers represent legacy extension mechanism of Magento 1. They are limited, so it’s better to avoid using observers.

'

As for plugins, they require doing all customizations for public methods/classes marked with @api annotation whenever possible. Otherwise, you don’t have any guarantees that customization will stay functional after new Magento releases. For further information, read this post: Magento 2 Plugins; Magento 2 Observers.

More tips from Magento 2 Cookbook

Source (Magento Stackexchange Question) (Alex Paliarush)

'