java-design-patterns
java-design-patterns copied to clipboard
Refactor Prototype pattern (Closes #584)
This PR refactors the Prototype pattern by making it Cloneable
and thus inheriting the clone()
method to its subclasses which removes code duplications.
This is a good refactoring that reduces the amount of boilerplate code. The code coverage is on a good level (75% on new code) even though Sonar is complaining.
Thank you for the prototype pattern refactoring! 🎉
@all-contributors please add @yonatankarp for code