An open API service indexing awesome lists of open source software.

https://github.com/josestg/poc-validate


https://github.com/josestg/poc-validate

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Proof of Concept: Builder Pattern using Functional Programming Style

The Builder Pattern is a design pattern that allows the construction of complex objects step by step, through a flexible and customizable process. In object-oriented programming (OOP), the Builder pattern typically uses setters to modify the object's state. However, in functional programming (FP), we do not have object state, so we need to use a different approach. One approach is to use function composition (just like function composition in math), which involves using a function that returns a function. This returned function acts as the builder, allowing us to customize the construction of the complex object through a series of functions. This approach is inspired by the lambda calculus (a little, that why you will find function name like Indentity 😆), which is a formal system for defining functions and evaluating expressions.