Click here to Skip to main content
15,893,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

i have doubt in general term of plugins..
ya i searched about it in net, got point like its a program that add extra features to existing application..

but i couldnt understood clearly ..

can any one explain it with practially?
Posted
Comments
Sergey Alexandrovich Kryukov 14-Feb-13 23:40pm    
The notion if plug-in or something more particular.
What's not clear?
—SA

A very practical example would be plug ins for PhotoShop or other graphics programs.

The application gives the essential functionality, but other developers can write plug ins that extends that functionality - adding different filters, effects etc.

As you mention jQuery in your tags, jQuery is another good example. While it provides a number of functions (which are essentially short cuts to javascript functionality) others can write plug ins that work with jQuery to provide additional functionality - such as different animation effects, controls etc.
 
Share this answer
 
Yes, to add features. On of the important point is: the host application is developed by one party, but some plug-ins can be developed by others, such as users or 3rd-parties.

I don't know why explaining the uses. Isn't that obvious? It can be used nearly anywhere. Do you know the Browser plug-ins? Now, look at some advanced text editor. A plug-in can provide syntax coloring for a particular programming language, invoke a compiler, present compilation results in a way adequate for this language. A support for every particular language can be a separate plug-in, or one plug-in can contain several implementations, for example, for a set of languages. A host application does not have to be a UI application. It can be a console-only application, service, even a driver.

From the standpoint of .NET, the plug-in model is pretty interesting. A host application should define one or more interfaces to be implemented by some plug-ins. I will call them plug-in interfaces. This is something which always needed. In some cases, the host application itself needs to provide some interface to the plug-in implementations. For example, in case of the editor, this application should provide some interface, and implemented it, to give plug-in some access to edit buffer; this way, the plug-in could read text entered by the user or generate some text. What to generate "knows" just the plug-in code, calls interface methods, and how to insert the generated text into the edit buffer is "known" only to the host application which implements this host interface.

Compilation with the definition of interfaces (interfaces, not their implementations) is pretty interesting. Usually, you define some assembly, and define interfaces there. This assembly is referenced by both host application and plug-ins. Less people understand that it's possible to define everything directly in the host application. The assembly of this application can be referenced by plug-ins just as well. There is no circular dependency here: compilation of plug-ins depends on host application assembly, but plug-ins are loaded during run time using Reflection.

I shared a lot of detail on development of plug-in architectures and implementation in my past answers:
AppDomain refuses to load an assembly[^],
code generating using CodeDom[^],
Create WPF Application that uses Reloadable Plugins...[^],
Dynamically Load User Controls[^],
C# Reflection InvokeMember on existing instance[^],
Projects and DLL's: How to keep them managable?[^],
http://www.codeproject.com/Answers/443680/Gathering-types-from-assemblies-by-its-string-repr#answer1[^].

This is pretty interesting stuff; please take a look.

—SA
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900