Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What replaces the MVC pattern in functional programming?

I'm a MVC web developer who's become very interested in functional programming to write web apps (specifically, I'm captivated by Erlang and Cowboy.)

What I'm having trouble finding an answer to/resources on is what pattern is used to replace MVC in FP.

Obviously the idea of an ORM is ludicrous in FP, since it's not object oriented, so what is used to replace it for persistence logic? Is it usual to just build a module that uses a library to create functions that interface with the datastore, or are there tools similar to ORMs?

Both advice and links to resources would be greatly appreciated. Bonus points for Erlang/Cowboy specific help. Thanks.

like image 838
iliveinapark Avatar asked Jun 05 '13 01:06

iliveinapark


3 Answers

There are MVC frameworks for Erlang. It's ChicagoBoss for example.

like image 52
Danil Onishchenko Avatar answered Oct 14 '22 02:10

Danil Onishchenko


Quoting from an article by @yarivs:

Erlang does carry its weight in all letters of the MVC. For the Model, forget database abstraction layers: you have a pure Erlang distributed database called Mnesia. For the view, Yaws has ehtml. For the controller, Yaws has appmods and Erlang's pattern matching.

I hope this helps.

like image 4
Ning Avatar answered Oct 14 '22 02:10

Ning


im a coder for erlang. i use erlang for my web-game server... so...there is no View..and in function luangues this is no Model... so from my point of view, function luangues there is no need of MVC (just like no class or subclasses in function luangues..)

like image 2
new7877 Avatar answered Oct 14 '22 03:10

new7877