How does the prototype pattern get rids of subclasses? #10
kanmaytacker
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Asked by
@faiz
.What?
Why?
Tightly coupling of any piece of code Ek to implementation classes Do adds a maintenance overhead.
When Do changes, class Ek is open for modification.
Tight coupling of client code and implementation (concrete) classes causes further maintenance nightmares.
A dependency on a frequently changing class could potentially cause errors (read: Backward Incompatible).
Also, if you are using an external library, you might not even know the concrete class.
How?
If you don't know prototype
If you know prototype:
Common utility can be client code or ours.
If client, at least Child is not riddled through out their code base.
If you really know prototype:
Beta Was this translation helpful? Give feedback.
All reactions