"Amit Sethi" <amit.pureene...@gmail.com> wrote

Well I want to implement plug-in like mechanism for an application . I want
to define some minimum functions that any body writing a plugin has to
implement. For that i thought an interface would be best because in a
scenario where the function is not implemented some kind of error would
occur. I would love to hear if you think their is a better way to achieve
this

Well you could define a real default plugin class that actually does something.
Then anyone who wants to create a plugin can inherit from that and either
extend the default functions or override them with something different.

That will reduce the code that plug-in writers need to create and prevent
any error messages appearing for the user.

It also means the default plug in acts as sample code for the interface too.

HTH,

Alan G.

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to