iliveinapark
iliveinapark

Reputation: 327

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.

Upvotes: 10

Views: 5735

Answers (4)

Ning
Ning

Reputation: 2880

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.

Upvotes: 4

new7877
new7877

Reputation: 87

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..)

Upvotes: 2

Adi
Adi

Reputation: 2394

Lift framework(written in Scala) uses pattern called 'view first'.

follow link https://www.assembla.com/wiki/show/liftweb/View_First

Upvotes: 1

Danil Onishchenko
Danil Onishchenko

Reputation: 2040

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

Upvotes: 5

Related Questions