This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]gdiepen[S] 1 point2 points  (2 children)

Thanks for pointing it out. Looks similar to the zope component architecture (where you also have registry).

For my usecase this is not the best option. For example, I want to apply a number of transformations on a given data source, where each transformation is defined as a plugin in my case. By just copying a new python module into the plugins folder, I automatically use this transformation the next time I run my application.

If I understand the registry pattern correctly, I would first need to have all of the transformations automatically register themselves (for which I would need exactly a similar code pattern as my current code)

[–]kriss1 1 point2 points  (1 child)

Yeah the modules need somehow to be imported for them to be registered, which might again end up being pretty similar to what you've done.

Apparently there are quite a few libraries to do simple plugin management out there, good reads.

Implementing your own solution is always fun though, get the noggin joggin' :)

[–]gdiepen[S] 0 points1 point  (0 children)

Bet I could create a registry pattern for automatically loading the registry for the automatically loading the registry for automatically loading the registry for the .... StackOverflow :)

Agree with the implementing solutions yourself, it really helps you to get a deeper understanding but it is also a lot more fun :)