vendredi 6 juillet 2018

The plugin design pattern explained

I am trying to understand and exercise the plugin pattern, as explained by Martin Fowler.

I can understand in which way it makes use of the separated interface pattern, and that it requires a factory to provide the right implementation of the interface, based on the currently used environment (test, prod, dev, etc).

But what exactly does the factory in this case? Should the factory be a dependency of the domain object?

Unfortunately I can't find any correct resource on the web in this regard. It would be great if you could help me with some explanatory steps, maybe followed by a little code example (in PHP, Java, pseudocode, etc).

Thank you very much.

Aucun commentaire:

Enregistrer un commentaire