BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

Object Oriented Design Principles and Functional Programming

| by Jan Stenberg on Mar 20, 2014. Estimated reading time: 1 minute |

Object-oriented programming has a lot of well-established design principles, such as the SOLID principles, but when moving towards functional programming many developers don’t know how to use their existing design skills, Richard Warburton recently stated in a presentation.
On the same subject, Mark Seemann in a recent blog post writes that if you take the SOLID principles to their extremes, you arrive at something that makes functional programming look quite attractive.

Richard, a member of the London JCP Committee, in his presentation describes the SOLID principles as one example of well-established object oriented programming design principles, identified by Robert C. Martin in the early 2000s, and looks at each of the five principles trying to find a functional equivalent or at least something related on the function side.
Richards experience is that although many developers don’t know how to use their existing design skills in functional design, functional programming can often help in implementing the SOLID principles and also that a functional mindset can actually help in achieving one important aspect of object-orientation, encapsulation.
Richard’s conclusion is that all the solid principles have a functional equivalent. Existing design patterns don’t need to be thrown away; instead they can be improved by making them simpler or cleaner, or by utilizing existing knowledge in a simplified way.

Mark, a software architect and independent advisor, in his experience has found that the SOLID principles can lead to a style of design that makes functional programming quite attractive.
When applying two of the SOLID principles, Single Responsibility Principle (SRP) and Interface Segregation Principle (ISP), you often end up having a code base with many fine-grained interfaces and classes each having a single method.
Mark’s conclusion is that if applying SOLID principles repeatedly leads to these small classes with a single method, then the functionality can be modelled as behaviour with data, at which point it may be time to move to a functional programming language like F#.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and dont miss out on content that matters to you

BT