apoorv-2204
Functional programming patterns IN elixir As opposed to Object Oriented design
How a simple problem like of inheritance or any other problems are mapped to functionalD and in OOD , what are their differences in their design model.?
If we been given a problem let say x to design and model it.How it would differ for the OOD and FD?
Lets say for entities like Person, Man, Woman , Father ,Mother, lawyer student?
How we design a future proof software? How we deal differently , with maybe upcoming future complexity in software? for both the designs?
Like in more complex situation like designing of vending machine , parking lot ,etc.How those OOD maps to functional. In functional there are just transformation of data.
Most Liked
D4no0
What if we build elixir in minecraft? ![]()
adw632
Some essential rules:
- Let data be data.
- Use CRC (Create, Reduce, Convert) pipelines. Most things in elixir and FP is essentially reducing over some state.
- Use modules to organise related functions that operate on some state.
- If you wish to compose use import or delegate to other functions in other modules.
- If you want polymorphic behaviour use protocols
- If you want to derive functional behaviour with your own overrides use behaviors
Look at the Enum module, it can work on data elements of any type, so think in terms of steps or an algorithm and really let the data be just data.
For true OO semantics look at Elixir process modules such as genservers or liveviews which are objects as per the Alan Kay definition, they accept messages as the only means of interacting with them and manage private state in their own process context.
adamu
Program maintenance is an entropy-increasing process, and even its most skilful execution only delays the subsistence of the system into unfixable obsolescence
![]()
Popular in Discussions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #code-sync
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








