The Open/Closed principle

The Open/Closed principle states, "Software entities (classes, modules, functions, and so on) should be open for extension, but closed for modification." The second of the SOLID principles doesn't sound like it is saying much, but it has a large impact.

There are many ways to honor this principle. You or your development team could put into place a rule that only allows for new development. That is, any existing functionality cannot be updated or changed, only replaced by new methods or classes. When we get to creating dividing lines in the code, you could use those dividing lines to create a place for this functionality swap to take place.

The Open/Closed principle also enables continuous integration and deployment. This is because, if your application never breaks a contract it has with the user, itself, or a third party, then it can always be deployed without fear of causing a production issue.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.242.118