Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion to change naming of "plugins" #991

Closed
airbone42 opened this issue Jan 21, 2015 · 10 comments
Closed

Suggestion to change naming of "plugins" #991

airbone42 opened this issue Jan 21, 2015 · 10 comments

Comments

@airbone42
Copy link

Hi,

I would like to raise the awareness that the usage of "plugins" is quite verbose in the open source industry. So most cms or ecommerce projects reference to plugins as what we in the Magento world call extensions or modules. Especially merchants and not so experienced users might get confused by using the word plugin for something really technically specific and I can already think of a lot confusing discussions about that. :)

So is it still possible to change that naming to something more specific?

@antonmakarenko
Copy link

@airbone42
We also use "Interceptor" word as a synonym to plugins. If we change it only in documentation, but keep using "plugin" in the source code -- is that good enough or you'd suggest to completely eliminate this term?

@TexanHogman
Copy link

Just today I learned it breaks down like this:
Technology: Interception
Developer creates: Plugins
Magento framework: Generates Interceptors classes to call plugin

So yes we can align on a better non overloaded name. Suggestions?

-----Original Message-----
From: "Anton Makarenko" notifications@github.com
Sent: ‎1/‎21/‎2015 5:39 PM
To: "magento/magento2" magento2@noreply.github.com
Subject: Re: [magento2] Suggestion to change naming of "plugins" (#991)

@airbone42
We also use "Interceptor" word as a synonym to plugins. If we change it only in documentation, but keep using "plugin" in the source code -- is that good enough or you'd suggest to completely eliminate this term?

Reply to this email directly or view it on GitHub.=

@buskamuza
Copy link
Contributor

@antonmakarenko , using different terms in the code and in the discussions is a bad idea, as "Domain-Driven Design" book says :)
"Interceptor" sounds good and reflects the idea/behavior.

@antonkril
Copy link
Contributor

Interceptor doesn't reflect idea and it's already taken by auto-generated internal class that is used to call plugins.

@airbone42
Copy link
Author

What do you think about naming it a "hook"?

Anyway I don't care so much about the final name, more that the current name plugin is really ambigious.

@fooman
Copy link
Contributor

fooman commented Jan 27, 2015

Maybe we can make it more specific by including method in the name - so something like method hook.

@davidalger
Copy link
Member

My 2 cents: plugin is ambiguous as others have stated. There is no difference between a plugin, module, and extension in Magento 2. However, the documentation talks about creating "plugins" acting as if they are their own variety of extension/module which behaves differently in how it's built. But these "plugins" (aka interceptors) are used by core modules to create their functionality in a few cases as well. My recommendation…

  1. Plugin/extension/module is: a software package installed into the system to alter/extend/create functionality non-native to the core.
  2. Interceptor: a technology used to achieve the desired effect within the confines of a plugin/extension/module (see above definition).
  3. Given the above definitions, change the use of "plugin" in the code and XML to "interceptor" to reduce confusion.

@TexanHogman
Copy link

To add to @davidalger point.

Reviewing Unity, this link https://msdn.microsoft.com/en-us/library/ff660861(v=pandp.20).aspx#_Instance_Interception best describes Magento implementation and uses the following terminology (interception, interceptor and interceptor pipeline) https://msdn.microsoft.com/en-us/library/ff660844(v=pandp.20).aspx#interception_pipeline
UNITY
Interception – is the technology
Interceptor – is the executed code
Interceptor Pipeline – is the term for the collection of user provided interceptors.

therefore this maps to

MAGENTO
Interception – Magento technology
Interceptor – would be the actual code executed (currently called Plugin)
Interceptor Pipeline – would be Magento framework term for code generated today (currently called Interceptor)

This allows us to drop Plugin from our nomenclature and therefore makes it a bit easier to understand.

@davidalger
Copy link
Member

@TexanHogman I beg to differ regarding it allowing us to drop "plugin" from our nomenclature.

Interceptor Pipeline – is the term for the collection of user provided interceptors

This would correlate to the Magento framework actually gathering the interceptors from the many plugins installed in the system, or more specifically, the di.xml system.

Something has to contain that di.xml and provide the "call" to the interceptor pipeline (which is demonstrated in the MSDN link via the call to pipeline.Add(interceptor);) and we would then need to call this unit something. What has the interceptor, adds it to the interceptor pipeline, etc? A plugin! Overall I agree though, the correlations between the two are pretty synonymous as written. :)

@TexanHogman
Copy link

Due to our focus on making functional changes, we have unfortunately missed our opportunity on this naming clarification. Tomorrow, we are code complete for our Dev RC release and such a change (as simple as it may be) would have developer impact going forward because of changes to di.xml and related schema. Scrambling to make the code and related documentation changes in time didn't rank high enough. Nevertheless, thanks for the good idea.

magento-team pushed a commit that referenced this issue Apr 1, 2017
magento-team pushed a commit that referenced this issue Dec 11, 2017
#991

 - Merge Pull Request magento-engcom/magento2ce#991 from magento-engcom/magento2:MAGETWO-84903
 - Merged commits:
   1. 89b8f3a
magento-team pushed a commit that referenced this issue Dec 11, 2017
[EngCom] Public Pull Requests - 2.2-develop
 - MAGETWO-85311: Added namespace to product videos fotorama events #12469 #991
 - MAGETWO-85300: 8437: Silent error when an email template is not found #970
 - MAGETWO-85293: 12613: Verbiage Update Required: Product Image Watermark size Validation Message. #985
 - MAGETWO-85286: 8176: LinkManagement::getChildren() does not include product visibility. #986
 - MAGETWO-85285: 12482: Sitemap image links in MultiStore #935
 - MAGETWO-84955: Set Current Store from Store Code if isUseStoreInUrl #12529
 - MAGETWO-84764: NewRelic: Disables Module Deployments, Creates new Deploy Marker Command #12477
 - MAGETWO-84439: 12180 Remove unnecessary use operator for Context, causes 503 error i… #12220
magento-engcom-team added a commit that referenced this issue Oct 13, 2019
…\QuoteGraphQl… #991

 - Merge Pull Request magento/graphql-ce#991 from kisroman/graphql-ce:graphql-987
 - Merged commits:
   1. afae879
   2. d3850aa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants