lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Feb 8, 2011 at 10:05 AM, Patrick Mc(avery
<spell_gooder_now@spellingbeewinnars.org> wrote:
>> don't mix the original GUI MVC (a modular OOP design 'pattern') and
>> today's more popular Web MVC (a layered architecture).  they're _very_
>> different things.
>>
>
> Hi Javier
>
> At the risk of pulling this off topic.. could you expand on that a bit, I
> don't know enough to see the difference-Patrick

a long, long time ago, one of Alan Kay innovations on SmallTalk was a
GUI framework (on one of the very first GUI systems), and with it the
MVC concept to make it simpler to create GUI applications with high
code reuse.  The idea was that every module of the application (as
seen from the user) was split in three categories of objects: models,
views and controllers.  a deep inheritance hierarchy allowed easy
interchanging of objects: most views could show most models, and most
controllers didn't care what kind of data the other two were about.

other frameworks on other languages/platforms keep some of this
principles, although it's not uncommon to see a group of three objects
specialized to work only between them.

On the web, for a long time, the 'enterprisey' buzzword was "three
tiers": presentation, business logic (also called application) and
data.  The J2EE framework encouraged implementing each tier on a
different machine (or a collection of machines), allowing the
sysadmins to tune and optimize each tier separately.  it's a strictly
layered architecture, where the presentation never touched the data
tier.  the business logic mediated every interaction.

when i wasn't looking, there started appearing some articles,
proposals and frameworks that championed what they called MVC, but
without any relation to the original one.  it seems to have evolved
from the three tiered, since each part is still a layer, and not a
subhierarchy of objects: there's a single 'data layer', a single 'view
layer' and the controllers.  on different frameworks, the exact
definition of controller varies a lot.  sometimes it's  the whole
'business logic' with a new name; on the other extreme, it's just the
URL/template mapping (like on the lightest PHP frameworks).  in most
cases, the business logic is included in the model layer, and the
presentation layer is mostly templates.

(no, i wan't referring to the asp.net.mvc, which is a newcomer (and
name usurper) to this space)

to get it closer to Lua.... in Xavante (as i knew it, don't know if
it's still the same), i never wanted to see any MVC; just a
URL/function mapping, a template to make it easier to emit HTML, and
yo get data from anywhere you want :-)   (usually LuaSQL)

Andre might remember how i argued that MVC didn't make any sense in
the web, since there's no real user interaction (like on a GUI); each
request/response is done as requested, so it was easier to model as an
RPC.  that was before i found that nowadays when you say MVC, you're
talking about a different thing.  then it all made sense.

(but still i prefer Django's MTV slight variation)

-- 
Javier