apoorv-2204

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

D4no0

What if we build elixir in minecraft? :joy:

adw632

adw632

Some essential rules:

  1. Let data be data.
  2. Use CRC (Create, Reduce, Convert) pipelines. Most things in elixir and FP is essentially reducing over some state.
  3. Use modules to organise related functions that operate on some state.
  4. If you wish to compose use import or delegate to other functions in other modules.
  5. If you want polymorphic behaviour use protocols
  6. 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

adamu

Program maintenance is an entropy-increasing process, and even its most skilful execution only delays the subsistence of the system into unfixable obsolescence

Fred Brooks

:slight_smile:

Where Next?

Popular in Discussions Top

andre1sk
A big advantage to Elixir is all the distributed goodness but for many applications running on multiple nodes having integrated Etcd, Zoo...
New
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
Fl4m3Ph03n1x
Background This question comes mainly from my ignorance. Today is Black Friday, one of my favorite days of the year to buy books. One boo...
New
mmmrrr
Just saw that dhh announced https://hotwire.dev/ Is it just me or is this essentially live view? :smiley: Although I like the “iFrame-e...
New
lorenzo
Hey everone! I created a prototype for my app using Nodejs for the api. But the framework I chose wasnt great (in general theresnt any g...
New
jer
I’ve been using umbrellas for a while, and generally started off (on greenfield projects at least) by isolating subapps based on clearly ...
New
und0ck3d
Hello everyone! A few days ago I’ve created a topic here about how people were creating CMSs with Elixir and Phoenix. I’ve been studying...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
slashdotdash
Phoenix Live View is now publicly available on GitHub. Here’s Chris McCord’s tweet announcing making it public.
New

Other popular topics Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
chrismccord
Phoenix 1.4.0 released Phoenix 1.4 is out! This release ships with exciting new features, most notably with HTTP2 support, improved deve...
688 30877 112
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New

We're in Beta

About us Mission Statement