Is having dependencies on Nop.Web bad style for a plugin?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
2 years ago
Hello,

  I'm a College student and I'm currently developing a plug-in that adds a recommendations list, based on Azure Personalizer Reccomendations,  on the product page.
  I wanted to have a similar item list to the one Nop has for the Related products, so I thought I could use what has already been done by the Nop team, and avoid repetition of code. My problem is that I'm not shure if it is a bad practice to have dependencies on the Nop.Web.
  If someone could tell me, I would be most thankfull!

Note: Other plugins made by the Nop team also have dependencies on the Nop.Web.Extensions. Mine are to the Nop.Web.Factories, and the Nop.Web.Views.Shared. And to be frank I'm not shure what is "allowed" or "not allowed".
2 years ago
Having dependencies on Nop.Web is not bad style. If required you could add dependency.
2 years ago
It is okay to reference Nop.Web from a plugin. The other way is bad, Nop.Web should not reference your plugin.

For example you could have a plugin that overrides only one method in CheckoutController in Nop.Web. In that case you can inherit the CheckoutController in Nop.Web and override only that  specific method and that method still has access to methods in the Nop.Web "origin" controller if such methods are required in the overridden method.

Hope that answers your question.
2 years ago
It does! Thank you both for the clarification.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.