OCP
-
Open-Closed Principle (OCP)Modeling/DesignPattern 2020. 2. 26. 01:46
1. Overview Software entities such as Classes, Modules, Methods, and etc, should be open for extension but closed for modification. 2. Intuition Open for Extension: Extend existing behavior Closed for Modification: Existing code remains unchanged 3. Example 3.1 Violate OCP abstract class Subscriber {} class CallHistory { public static class Call { private LocalDateTime begin; private long durati..