Principles Desing in functional perspective

Post on 02-Jul-2015

121 views 0 download

transcript

Leonardo Amarilho

Design Functional

Fail...

Difficult to find material

Design Principles from Functional Perspective

SOLID Principles

Single-responsablity Principle

A class should have one, and

only one, reason to

change. The

fundamental unit

of abstraction is the function

Open/closed Principle

You should be able to extend

a classes bahavior,

without modify

it

The

functions can

be substituted at will.

Don’t need to thinking about it

Liskov substituiton Principle

Derived clases must be

substitutable for their

base classes

Most

ambitions of the

Liskov substitution are

effectively trivial in FP

Interface Segregation Principle

Make fine grained interfaces

that are client

specific Functions

are segregated

by default definition

Dependency Inversion Principle

Depend on abstractions,

not on concretions The

side-effect free

nature of FP provide for

dependency inversion

Conclusion

The principles are absorved by functional

language in a natural way. The OO Patterns

still exists in the function paradigm,

but the implementation details differ.

Functional programming is more a mindset than a particular set of tools or language.

“Functional Thinking” Neal Ford - IBM Developer Work Series