Take the 2-minute tour ×

I started to touch Petrel Ocean just now, and what to know what is the difference between the Plug-in and the Module.

At least for now, they look the same.

Can anyone please give me some ideas?

share|improve this question

migrated from stackoverflow.com Oct 2 '12 at 13:50

This question came from our site for professional and enthusiast programmers.

Despite the answers, this question is not a good fit for SO. –  High Performance Mark Oct 1 '12 at 9:06

4 Answers 4

Plugin is new, IModule is old.

Plugin Manager deals with Plugin so that is the one you should use.

share|improve this answer

The Plugin class contains properties which provide identity to the plugin and used by plug-in manager. Plugin contains all Modules in IEnumerable Modules. The IModule interface defines methods of the module lifecycle phases. During the Petrel startup, the Ocean Core will load modules as defined in a configuration file by plug-in manager based on Plugin class.

share|improve this answer

Plugin is an aggregating entity for IModule, i.e. one Ocean plug-in may consist of several modules, each of them licensed separately.

Plugin contains additional information - Author, Contact, PluginUri, which helps Petrel to inform users better, when a plug-in causes an issue (e.g. unhandled exception). By the way, Plugin is an information container only, as it does not contain any methods to override.

Plugin lets you declare Dependencies, to define the order of Ocean plug-ins loading in Petrel.

And finally, an Ocean plug-in with Plugin class defined and packaged as PIP, contains a metafile in XML format, with all the Plugin properties, letting Petrel to check for certain conditions upfront, without actually installing it. An example is AppVersion property, which define the version of host application (e.g. Petrel), that this plug-ins is compiled with.

share|improve this answer

If you plan to deploy your plug-in through the Ocean Store then you will be required to derive from the Plugin class. Of course your plug-in MUST also implement IModule since that is where the methods controlling the lifecycle reside.

share|improve this answer

Your Answer

