Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plug In Design for .NET App

Tags:

I’m looking at rewriting a portion of our application in C# (currently legacy VB6 code). The module I am starting with is responsible for importing data from a variety of systems into our database. About 5-6 times a year, a new client asks us to write a new import for the system that they use. Presently, this requires us to release a new version of our software for each new import option we add to the application.

One of the goals of the rewrite is to make the application support plug-ins. Every new import can become a separate assembly which the host application will recognize and allow the end user to interact with. This will hopefully simplify life to some degree as we can simply drop a new assembly into the directory and have it be recognized and used by the main (host) application.

One of the items I am struggling with relates to the differences between the import options we currently support. In some cases we actually let the user point to a directory and read all of the files within the directory into our system. In other cases we allow them to point to a single file and import its contents. Additionally, some imports have a date range restriction that the user applies while others do not.

My question is, how can I design the application in a manner that allows for some flexibility among the imports we build and support while at the same time implementing a common interface that will allow the host application to easily recognize the plug-ins and the options that each one exposes to the user?

like image 715
Tim Lentine Avatar asked Sep 05 '08 16:09

Tim Lentine


People also ask

What are .NET plugins?

The plugin framework is a NuGet package that allows you to customise and extend a . NET application at runtime. Code examples are provided for ASP.NET Core, Blazor, Console Apps and WPF & WinForms. The plugin framework package can be installed from NuGet and also supports the delivery of plugins from NuGet.

What are plugins in C#?

Introduction. In today's article, we will take a look at using the plugin pattern in C#. The plugin pattern allows us to drop assemblies into a particular location and use their implementation in our applications. This is one way we can create loosely coupled applications.

Which software is used for .NET programming?

Microsoft Visual Studio Not only can you use the Microsoft . NET Framework in Visual Studio, but Visual Studio is built with . NET. The program achieves many innovations using programs like Windows API, Windows Forms, Windows Presentation Foundation, Windows Store, and Microsoft Silverlight.

Is Visual Basic .NET free?

NET platform are all free. There are no licensing costs, including for commercial use. The latest versions of . NET are all open-source and maintained by Microsoft and the .


2 Answers

I would recommend you take a look at the Managed Add-In Framework that shipped with .NET 3.5. The Add-In team has posted some samples and tools at CodePlex site as well..

like image 103
David Mohundro Avatar answered Oct 12 '22 10:10

David Mohundro


.Net 3.5 has the system.Addin namespace.

This thread also has some good information for older versions of the framework:
http://forums.devshed.com/net-development-87/system-plugin-532149.html

like image 26
Joel Coehoorn Avatar answered Oct 12 '22 09:10

Joel Coehoorn