Functional SOLID, Part 2
by Matt Stine
In this issue we continue our short series on the intersection of the SOLID principles of object-oriented design and programming with the functional programming paradigm. First we'll focus on the Open-Closed Principle, which tells us that modules should be open for extension, but closed for modification. We achieve open-closed designs through the use of abstraction, which in object-oriented languages is typically achieved through the use of inheritance. While inheritance can be a very powerful tool, it can also be a very dangerous one if used inappropriately. We'll learn some of the characteristics of good inheritance hierarchies from the OCP's sister principle, the Liskov Substitution Principle. Finally, we’ll examine how the use of functional composition will allow us to create modules which comply with the OCP without flirting with the dangers of inheritance hierarchies and violations of the Liskov Substitution Principle.
About Matt Stine
Enterprise Java/Cloud Consultant
Matt Stine is an Enterprise Java/Cloud consultant based in Memphis, TN. He is a twelve year veteran of the enterprise software and web development industries, with experience spanning the healthcare, biomedical research, e-commerce, and retail store domains.
Matt has spoken at conferences ranging from JavaOne to CodeMash and has published several articles for Agile Zone, GroovyMag and NFJS the Magazine, as well as the Selenium 2.0 DZone Refcard. Matt is also the founder of the Memphis/Mid-South Java User Group.
His current areas of interest include lean/agile software development, software architecture, mobile application development and functional languages.