On Wed, 21 Apr 2010, Michael Allman wrote:
On Wed, 21 Apr 2010, Greg Brown wrote:
I am also not a fan of MVC frameworks for GUI applications. Basically, I
think their fundamental premise (that MVC is a valid approach to global
application design) is crap, but I'll save it for another time or never.
I used to agree with this, but now I see some value in the concept of a
macro-level MVC design. I don't know that using a framework is necessarily
the right way to accomplish it, but I do think the design pattern is valid.
I also think it works well with the load/store model, since load()/store()
is basically a higher-level get/set, and the event support can be provided
by Pivot's new pub/sub messaging API.
I have no beef with macro components, as long as they're well-encapsulated
with well-defined, minimal interfaces.
On the other hand, I've seen designs where basically all of the high-level
state is stored on a single class. Major yuck-o. I've seen "model" classes
that are on the order of hundreds or thousands of lines of code. Then there
are the global event dispatchers that everything is tied to. Kinda makes it
hard to understand a class's interface and behavior when it's calling back to
global objects.
When every object is tied back to some application global data-structure or
other object somewhere on high (usually through a reference to a static
variable or method), I get nervous. It looks fragile.
I gave a 20 minute preso on my thoughts on rich GUI application design
earlier this year to my local flex user group. You might take a look if you
feel like it. It's small. It's on my home page:
https://www.allman.ms/
Oh yeah. I'll just add that I also link to a simple flex app I wrote for
the preso on my page. If you look at the source code you will get a
better idea for how I use data binding and where I'm coming from.
Michael