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.
4 Answers 4
There are MVC frameworks for Erlang. It's ChicagoBoss for example.
2 Comments
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.
Comments
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..)
Comments
Lift framework(written in Scala) uses pattern called 'view first'.
follow link https://www.assembla.com/wiki/show/liftweb/View_First
Comments
Explore related questions
See similar questions with these tags.
Scala.React
.