Quantcast
Channel: Control-F5 - C#
Viewing all articles
Browse latest Browse all 13

Plugin Architecture in .NET

$
0
0

Why build a plugin Architecture?

The answer here is.. it depends...

You don't want to do it for a small application, the overhead would make no sense.

Instead, let's use this scenario, client wants 3 big applications with common functionality. Now as programmers we don't want to implement the common thingy in all 3 apps! 

So let's be smart and have the common functionality in the foundation of the application, that we call the Framework, mkay..?

All particular implementations of the individual apps will come in the form of plugins. We will also have a middle layer that is the API between Framework and plugins: 



Wait, so why not just use libraries, Bob?

First, my name is not Bob. And second, why isn't our Framework composed by a set of libraries?

Well, it is a set of libraries to some extent. But, the Framework will be the engine of our application. It handles all the important decisions in how the application works. 

So a few advantages to build a Plug-in Architecture:
  • Have a common engine for multiple apps
  • Make lives of developers who will build plug-ins much easier, having a good API layer and abstract complicated implementations in the FW away from them
  • Modularity
  • Constrain plug-ins to some extent to be consistent in their implementation (by example to work with the Framework a BusinessModule class in a Plugin should always implement a certain Interface that is checked in the FW)
  • If a new common feature is needed for all projects, it is just implemented in the FW, with instant benefit

And now some drawbacks:
  • Very hard to make FW flexible enough to satisfy all plug-in applications
  • Changes/ Features/ Bug Fixing in FW can lead to multiple errors in how Plug-ins behave - Imagine that one change in one class in FW could cause bugs in hundreds of plugins (now that's painful)
  • Workarounds in Plug-ins due to inflexibility
  • Managers will not let developers touch the FW without talking to the Saints in the sky first

Article of the week

You can find a very nice article about the technical parts involved in implementing a Plug-In Architecture in .NET/C# by clicking here.

Viewing all articles
Browse latest Browse all 13

Trending Articles