On Saturday, December 29, 2001, at 11:48 PM, Guyren G Howe wrote:
I'm inclined to mostly agree with this (but see below):
Subject: Re: MVC
From: "Charles Yeomans" <yeomans at desuetude dot com>
Date: Fri, 28 Dec 2001 17:57:21 -0500
Actually, MVC doesn't make a lot of sense for RB users; it's really
more
appropriate for lower-level design, like an application framework. In
RB, it's usually enough to implement variations of the Observer pattern
for this sort of thing.
Charles Yeomans
On Friday, December 28, 2001, at 04:07 PM, Guyren G Howe wrote:
There has been some discussion on here about the Model-View-Controller
application structuring paradigm.
Something I like to emphasise is that economics is a big factor in
programming. By "economics" I mean the allocation of scarce resources.
Scarce resources include the programmer's time, the end user's time, the
computer's time, the computer's memory, bandwidth and so on.
In most projects, it is the programmer's time that is the scarce
resource.
You should build an underlying framework for your application
proportional
in complexity to the application you want to produce, the lifetime you
expect it to have, and the frequency and extent with which you think you
will need to make changes to it. The point being that you should only
put in
that time up front if it will save at least the same amount of time
later
on.
You *can* do MVC in REALbasic, and in a sufficently complex
application, it
would be worth the extra effort. But in most RB apps I've seen, it
probably
wouldn't be worth it. Heck, in a lot of RB apps, it probably isn't worth
even defining many classes at all; writing code straight into controls
in
windows is just fine, if you're doing something simple.
I just wanted to point out, contrary to what was being stated on the
list,
that MVC *can* be done in RB just fine.
I suppose it depends on what you mean by "do MVC". Separation of model
and view is of course a useful and widely applicable concept; I make
heavy use of it in my applications. The View-Controller stuff is
already built in to RB; it's what you're using when you make use of the
focus and user-generated-event handlers. For program design in
REALbasic, I claim that it is more appropriate to think in terms of a
model-view pattern in which one distinguishes between immutable and
mutable views. Immutable views register as observers of a model;
mutable views register as, oh, call them editors, and perhaps also as
observers in an optimistic object-locking scheme.
Ultimately, patterns are guidelines, or rules of thumb, nothing more
than codified experience.
Charles Yeomans
|