lundi 11 mars 2019

Use Adapter Pattern rather than refactor code from Enumeration to Iterator

I read Head First Design Patterns 2004 on page 248 about Adapter Pattern in real world.
It talks about an old Java application using Enumerator but now it becomes a legacy code, which Java no longer maintains it anymore.
The resolution is by using Adapter pattern to adapts Enumeration with Iterator (new Java release).

Why don't they just refactor(edit) the code from Enumeration to Iterator instead of using the pattern?

Aucun commentaire:

Enregistrer un commentaire