Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] From Swing to SWT

> Separation of concerns is a sermon to the choir, Scott.  I'm a NeXT
> head.  I've been doing MVC since before people called it a "Pattern".

Yea -- funny thing was when I "reinvented" MVC a while back. I was
writing a tree component for Java (pre Swing) and thought it would be
cool to separate the data from the visualization. Set up a nifty little
demo to show the same data and selections across several trees (how
unique ;). I even sent a note to a guy I knew at Sun recommended that
approach for Swing, and he basically said "well, duh..." It was at that
point that I realized I wasn't doing enough reading ;)


> What I'm saying does not betray it, it's that the theoretical V in MVC
> is not always truly reusable outside of a specific user context.
>
> More accurately, I look at MVC at many levels of detail, but many GUI
> systems (Struts+JSP for example) see the V as the whole page.  In a
> fully articulated, and usable system, you end up with some
> objects being
> V in one relationship, and M in others, and the relationships are more
> fine-grained.

I think the Controller is really the trick. It's the part in MVC that
people tend to think is just the event handlers. I hope to set up and
publish a thin framework for what I'm thinking of soon. I think it could
really demonstrate that we really can get high reuse/maintainability as
well as very different types of UIs.

> [...]
probably best answered by a prototype of the framework I have in mind


> P.S.  MVC is not a UI paradigm (sorry about that word).  It's a
> partitioning of roles in the code, with the advantages of plugability,
> manageability, and (often) reusability. It is well-used in a UI, but
> that's a very limited area of application.  -cg.

Sounds like 20 cents to me (paradigm, get it? <ducking/>)

Actually, I really agree (and often preach) that the MVC concept can go
much farther than UIs. I gave a talk at JavaOne a few years back on MVC
(the slides are at my website, http://javadude.com) and stressed at the
end that the point is merely indirection/abstraction.

A friend of mine, Tom Pennello, lives by the phrase "maximally
indirect". He used to joke with me that if something isn't maximally
indirect, it's not indirect enough. Sounds like an endless battle, eh?

[Side Note: For those of you into compilers, you may recognize Tom's
name -- he and Frank DeRemer are the guys responsible for LALR parsing,
the strategy employed by yacc. I used to work for them at MetaWare in
Santa Cruz, CA...]

Later,
-- Scott




Back to the top