Through proper modular design and abstractions you should
construct your object hierarchy in such a way that when you need to implement a
new feature that you should not have to make changes to the existing classes
but rather extend them.
"Open Close Principle can be ensured by use of Abstract Classes and concrete classes for implementing their behavior. This will enforce having Concrete Classes extending Abstract Classes instead of changing them. Gang of Four Pattern examples include the Template Pattern and Strategy Pattern."
No comments:
Post a Comment