You are not logged in.

#1 2010-02-17 09:30:43

Peasantoid
Member
Registered: 2009-04-26
Posts: 928
Website

Taking MVC to application front/back-end design

I was recently reminded of this thread, in which we discussed a quasi-DE based around small, distinct components communicating with one another to form entire applications. In that vein, I submit to you the following concept: separating applications into loosely coupled back-end and front-end processes, such that either can be arbitrarily replaced.

For purposes of clarification, here is how a hypothetical calculator application might work:
1. User runs application. Perhaps the executable would be a wrapper script that performs the necessary setup.
2. Based on an environment variable, the back-end forks off a separate (graphical?) front-end process and sets up a channel of communication between the two, f.e. a unix domain socket and an env var pointing to it.
3. Back-end waits for input from the front-end.
4. When the user does something in the front-end window, f.e. enters an expression and then hits 'evaluate', the front sends the expression to the back, which processes it and then returns the result. Front updates the display accordingly.
5. When one process dies, the other detects it and self-terminates.

Normally a calculator would be simple to implement without this additional complexity, but say you were writing something like a graphical Lisp REPL instead: you don't want to tie the Lisp evaluator functionality into the front-end. Rather, you delegate it to the back-end, because that is where it belongs.

Because the front-end is solely responsible for presenting data and processing user input, it would be trivial to write different ones for different widget toolkits. Then there is no need to duplicate the back-end's functionality.

So, what do you all think? Is this a good idea?

Last edited by Peasantoid (2010-02-17 09:31:47)

Offline

#2 2010-02-25 04:25:31

xelados
Member
Registered: 2007-06-02
Posts: 314
Website

Re: Taking MVC to application front/back-end design

It seems like too much of a fad to me. The MVC design pattern works well for medium and large projects, but the level of effort and complexity it takes to implement initially can kill momentum on starting a project. I'm not a believer that MVC is _the_ design pattern. Especially for something as small as a calculator.

Not everything needs the front/backend or server/client model. It's way too complex.

Offline

Board footer

Powered by FluxBB