samedi 17 février 2018

How to add functionality of Java implementation which changing existing code?

Let's say I've an implementation of fund transfer. Now I want to add authentication functionality which should be done before fund transfer (considering we are already receiving username and password in existing request). Which pattern should we use and how we can achieve this without modifying calling class and existing implementation?

What I can think of at this moment is using decorator pattern after extending implementation class, but I believe still we will be required to modify the calling class.

Please can anyone help me on this?

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire