Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building An App With Plug-in Support

Tags:

c#

.net

plugins

I'm starting a new project which would greatly benefit from program add-ons. The program in its most basic form reads data from a serial port and parses it into database records. Examples of add-ons that could be written would be an auto-archive add-on, an add-on to filter records, etc. I'm writing both the program and the add-ons, but some customers need custom solutions, so instead of branching off and making a completely separate program, add-ons would be great. The simplest add-on would probably be a form who's constructor takes an object reference, manipulates the object in some way, then closes.

Unfortunately, I have absolutely no idea where to start coding, and almost as little idea where to search. Everything I search for turns up browser add-ons. From what I have gathered, I need to look into dynamic loading DLLs. Besides that, I'm clueless. Does anyone have any good resources or examples I that they know of?

I'm happy to provide more details, but this project is in its inception, so I don't have a ton of specific details (specifics kind of defeats the point of add-ons, too.)

like image 931
dlras2 Avatar asked Jul 15 '10 17:07

dlras2


People also ask

What are plugins in app development?

A plugin is a package of injected code that allows the Cordova webview within which the app renders to communicate with the native platform on which it runs. Plugins provide access to device and platform functionality that is ordinarily unavailable to web-based apps.

What is an example of a plug-in application?

Examples include the Adobe Flash Player, a Java virtual machine (for Java applets), QuickTime, Microsoft Silverlight and the Unity Web Player.

What is plugin Power app?

A plug-in is a class within an assembly created using a . NET Framework Class library project using . NET Framework 4.6.

What is the best platform to build a mobile app?

Appery.io Appery.io is an established app development provider, offering its app builder platform for enterprises to create their own apps. Creating an app is as easy as using a drag-and-drop interface, and selecting data sources as well as using HTML 5 and Javascript as required.


2 Answers

You should seriously consider using the Managed Extensibility Framework (MEF) to handle your plugin architecture. It requires thinking about things a little differently, but it is well worth the mind-stretch.

like image 117
dthorpe Avatar answered Oct 01 '22 11:10

dthorpe


This is a simple example to illustrate the basic technique.

codeproject.com - Plugin Architecture using C#

This article demonstrates to you how to incorporate ... as a plugin for another application or use it as a standalone application.

in .NET 4 you now have the Managed Extensibility Framework (MEF) to do much of the plumbing.

In .NET 3.5 you had the System.AddIn but it was deemed by many to be far too complex.

codeproject.com - AddIn Enabled Applications with System.AddIn

AddIns (sometimes called Plugins) are seperately compiled components that an application can locate, load and make use of at runtime (dynamically). An application that has been designed to use AddIns can be enhanced (by developing more AddIns) without the need for the orginal application to be modified or recompiled and tested

like image 43
Ryan Avatar answered Oct 01 '22 13:10

Ryan