Loading and Enabling of Dynamic Plug-ins

python language

Introduction of Loading and Enabling of Dynamic Plug-ins

Python has made all dynamic code loading compellingly easy, letting you compose and scale any desired application by exploring as well as loading various plugins, and extensions during run time. Several applications use the import or import lib feature to invoke their own libraries.

You can also employ the use of Stevedore, the dynamically loaded plug-ins manager to help easily manage the plug-ins. With Stevedore you refrain from building a separate extension mechanism since it builds atop the entry points of setup tools.

The codes used for managing entry points however are prone to repetitiveness. Stevedore aids users in working with extensions which were dynamically loaded by providing them with manager classes for the implementation of routine patterns.


Three loading patterns – Driver, Hooks and Extensions

dynamic plug-inThe most familiar use of dynamically loaded libraries is specifying a driver which would establish communication with peripheral sources – any remote application, external database or device.

This Driver pattern is characterized by one name and one single entry point. The second pattern, characterized by multiple entry points corresponding to a single name is the Hooks pattern. In this pattern, based on events taking place inside an application, callbacks, signals or hooks are called upon.

You can call upon several hooks for a single event since in this pattern the same name can be shared by multiple entry points. The third pattern for loading is the Extensions pattern; characterized by multiple names as well as multiple entry points.

This is the most common way in which applications are scaled. These extensions provide additional functionality and may even replace the central function. They add themselves during run time and facilitate it by using very little Application Program Interface.

The enabling patterns

For many apps, you’ll find that merely installing them on your system activates them and you do not need to do anything separately for the same.

Then you have the self enabling type extensions like PIL and Anybody which function themselves when asked by the application. You’ll also come across extensions like the Trac Plug-ins which need explicit enabling, done by the user through a specific configuration step.

Reasons for using plugins

Given here is the review of how useful these dynamic plugins can be in your applications. Plugins provide a useful method of extending your applications without complicating them. You can use the extension points to add new codes separately as and when required. This provides for an improved architecture of your application.

Since you have extension codes which are separate from the code added you can concentrate more on abstraction features of your design. They also provide for easy and more manageable deployment of dependencies.


As You Know In This Post I have told That How Important plugins Are in the Python , Is There any things Else Please Discuss with me Via Comments Section Or You Contact My email Id. I hope You Might Have enjoyed Having Read This Article, Also You Can Share This Article.


Please enter your comment!
Please enter your name here