tags:

views:

522

answers:

4

I want to do the architectural design for a software that can be used integrate various third party software’s (executable) under one platform.

Standard project types will be added to the platform by default. The project type defines the way in which the different software will be executed and their input and output files.

The user can customize the available standard project type and that will be added to the platform as new project type which defines new custom execution flow.

Also it should support easy extension and customization of the features. I read that plug-in based architecture supports both.

What are the advantages and disadvantages of plug-in based architecture? Do we have any better architecture which can be used for this kind of scenario?

Thanks in advance:)

+1  A: 

You can find the advantages and a small plug-in framework you can leverage at link text

Pangea
+4  A: 

The advantages of a plug-in architecture is obviously the increase in flexibility. This allows other developers to extend your application in ways that did not expect in the first place. Note that there are various plug-in architecture ranging from flexible to extreme flexible. The most flexible one is called a Full Plug-in architecture, which is used in eclipse.

The disadvantage is that to be really flexible you have to develop a solid framework that incorporates loading, unloading and communication between plugins. There will also be a slight performance overhead in communication between plug-ins.

For a discussing on how to create a plug-in architecture take a look at this question.

kalkie
+1 Good answer, though I would argue for more than just slight performance overhead.
Chris O
+1 for eclipse link.Thanks!
RP
Eclipse is in my opinion a great example. Once you start developing your own plugins and plugin based apps you really appreciate how reusable and modularized the features of the IDE are. It's worth also mentioning that Eclipse is based on the OSGI architecture - Eclipse plugins are basically OSGI bundles.
Alb
+19  A: 

The benefits of a pluggable system are

  • extensibility: the application can be dynamically extended to include new features.
  • parallel development: since features can be implemented as separate components, they can be developed in parallel by different teams.
  • clear development direction: since the plugin framework ideally provides a well-defined interface and documentation for plugin writers, developers have a clear roadmap for development.
  • simplicity: a plugin typically has one function, and so developers have a single focus

But some of these strengths are also weaknesses:

  • extensibility: does the plugin interface anticipate the ways plugin writers what to extend the app, or does it restrict extension. Designing extensibility to meet all use cases often takes several iterations, or extremely good requirements analysis.
  • maintainability: the provider of the plugin framework not only has to make sure the plugin interface satisfies indented use cases, is clear and well documented, but also that it can evolve. Managing versions and backwards compatibility with existing plugins can be very hard. Hard enough that many practical implementations don't bother, and push the onus on plugin writers to update their plugins with each version.
  • complexity: although each plugin works when tested alone, interactions between plugins can cause new problems, with bugs appearing only with certain combinations of plugins.
  • testing: testing plugins can be difficult if the plugin system does not provide some form of mock plugin runner for testing, which is sometimes not possible, and testing is only available by running the plugin for real, which slows down development.
  • artifical separation: a plugin typically has a single focus, but what constitues a single focus is set by the plugin api provider. If a plugin writer finds he needs a plugin that can reasonably do 2 things (as defined by the plugin api) in close tandem, he may end up having to implement two plugins and find ways of providing communication between them that is not presently provided by the api. He's then having to work around or against the plugin framework.

Designing a good plugin environment has many of the same challenges as designing a good library. If you are producing both the environment and the plugins yourself, then it's not so bad since you can update all the plugins as the environment evolves, but if the plugin api is open to all, then it requires careful planning and execution to get the design right to avoid too many plugin rewrites as the environment evolves.

"Second-system syndrome" described by Fred Brooks advocates that the second system developed is often excessively generic, aiming for ultimate flexibility, sometimes producing a "platform within a platform"/"inner platform effect". A pluggable design is often seen as a way out when requirements are non-existent or underspecified. To compensate, the software is made as flexible as possible to try to handle "whatever comes along".

Appologies if this paints a dreary picture - pluggable systems can be fantastic and offer a lot of strengths, but they come at a high price. Before diving into a pluggable system, it's prudent to draw up requirements for all the plugins that you will need to cover the functionality required. This will then help you decide if the pluggable design is worth the effort, or some simpler approach would serve equally well.

mdma
Very nice overview. Bravo.
JUST MY correct OPINION
Good list of advantages and disadvantages of a plug-in architecture!When reading it, I also though about the issues that you could have when updating the plug-in framework itself. How to make sure that all the developed plug-ins keep working?
kalkie
@kalkie - that's my intent when I say "maintianing backwards compatibility...forcing plugin writers to update ... with each version". I've added "[maintain ... backwards compatibility] with older plugins" to make this explicit.
mdma
Good answer! @mdma, Thanks!
RP
This is my accepted answer. Why can't I undo my accepted answer? I tried to accept this answer many times and the site was trying to connect some gravathar.com and used to hang there for a long time. After so many attempt, I mistakenly accepted the other answer. It's really strange, I don't have freedom to change my accepted answer.
RP
Not to worry, mistakes happen. (Although the bounty would have been nice to have!) I've asked a question on meta to see if this can be resolved, http://meta.stackoverflow.com/questions/50745/op-accepted-wrong-answer-by-mistake-in-featured-question
mdma
ok, I fixed the bounty accept. Sorry it took so long, this takes some fairly involved manual SQL changes that have to be done by hand.
Jeff Atwood
Thank you so much - I wasn't really expecting anything to happen - I'm sure you guys are really busy, so knowing that, I'm very grateful! Thanks again!
mdma
Thank you Jeff , mdma :)
RP
+2  A: 

Though its not easy to maintain plugin based architecture, why people develop in such a way then? Because still its better then other "fixed" approaches. Say if your requirements are changing one after another and design needs to be fixed, then think what will do with other approaches?

Best thing about it is parallel development. When client wants some features ASAP, developers can work in parallel and plug their code as Plugins/Components. Basically Plug-n-Play architecture provides flexibility with complexity, but complexity is for the first time. Once your team is comfortable with it, its easy for them to handle code, bugs etc...

When you want to integrate different 3rd party applications, as you mentioned, it will be better to develop it as plugin OR component/Service based. (I don' want to confuse you but SOA might be of interest.) So that you can on/off the service/plugin when its not needed. Even you can get benefit from this when you want to do SAAS (Software As A Service) model, where you get revenue for each different service/feature :).

For reference, you can check following JAVA frameworks. There are many ESBs available which provides component/service based plug-n-play architecture.

I hope this helps.

thanks.

Paarth
Paarth,Thanks for your feedback:)
RP