tag:blogger.com,1999:blog-8712770457197348465.post8173257287594489205..comments2024-03-28T02:47:19.159-07:00Comments on Javarevisited: Open Closed Design Principle in Java - Benefits and Example javin paulhttp://www.blogger.com/profile/15028902221295732276noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8712770457197348465.post-54509121069359788972016-02-14T15:18:20.984-08:002016-02-14T15:18:20.984-08:00Software entities (classes, modules, functions, et...Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. We should be able to extend software entities without actually modifying them. This is a crucial principle of SOLID and continuous integration. We usually apply this principle to OOP and we should apply it in every day javascript programming as well. The following video starting from Anonymoushttps://www.blogger.com/profile/06776548501702839786noreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-54995133881556476562013-05-14T20:34:07.623-07:002013-05-14T20:34:07.623-07:00Strategy Design Pattern is another example of Open...Strategy Design Pattern is another example of Open Closed design Principle. By using Strategy to perform certain task, we keep Service Class, which uses this strategy closed, but same time, System is open for extension, by introducing new Strategy, by implementing Strategy interface. At runtime, you can compose Service Class with any new Strategy, based upon your need.Rajnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-31624972941839643642013-04-15T01:47:41.212-07:002013-04-15T01:47:41.212-07:00I think key to understand Open Closed principle or...I think key to understand Open Closed principle or OCP is creating better abstraction. If you have better abstraction, you will more likely to confirm open closed design principle. At the same time, you should be careful of creating too many abstraction, which will result in lots of vapor classes, Instead you can delay creation of Abstraction related to Open Closed principle, till requirement Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-8712770457197348465.post-8074308547692617862013-03-22T00:55:52.181-07:002013-03-22T00:55:52.181-07:00I think best example of Open Closed Principle is a...I think best example of Open Closed Principle is alphabets and words, you have just got 26 alphabets but you can make any number of words. 26 Alphabets are close for modification but open to made any words, what do you say?OOODnoreply@blogger.com