Fog Creek Software
Discussion Board




King of Patterns = MVC ?

I am asking this question from discussions on Aspect-Oriented Programming....

I have read a little about Aspect-Oriented-Programming and have certainly found it interesting.  I think that it will eventually have more and more of a precense in software design and development. 

However, another part of me sees it as a method of implementing the MVC (Model View Controller) pattern using external tools or language constructs.

Please have a look at the MVC pattern, which I think is the understated king of patterns.  Yes, it is typically associated with GUI development, but it is far more reaching than that.

Have you used the MVC pattern ?

What patterns have you used and which was most usefull ?

James Ladd
Tuesday, March 05, 2002

You should really think about not using assignments in your conditionals. Better is King of Patterns == MVC ? In Python that wouldn't even compile ;-)

davekersh
Tuesday, March 05, 2002

"Think before you code" is my favorite pattern.

B
Tuesday, March 05, 2002

Your so right, I should never have used assignment in a conditional.  But then again, if I really wanted to use my fav language I would have written:

( MVC KingOfPatterns ) ifTrue: [ comments printString. ].

And yes, I think that "thinking" is a great pattern to use, god knows some people here need to learn that.

James Ladd
Tuesday, March 05, 2002

Patterns is such a strange community.  If you want a fun perspective, you should take a look at the comp.lang.lisp newsgroup.  Lispers form a pretty old community, and have nice insights into others.

Back ontopic, Java is a language whose library is completely permeated with design patterns.  MVC shows up everywhere in its Swing GUI libs, and Apache's java projects also use it:
http://jakarta.apache.org/struts/

Sun is definitely a fan of "Design," and I think design patterns are a very overlooked feature of Java.

Of course, many point out that some of these patterns are simply features taken for granted in higher-level languages.  FWIW, XP'ers like Beck & Gamma tend to write things like JUnit and JHotDraw in Java, probably because Sun is so receptive.

Keith Reiter
Tuesday, March 05, 2002

Keith,

Struts is cool, but have you used MVC for non-output based work ?

Try it, and you too might find MVC king of patterns. And thanks for the other comments you made.

James Ladd
Tuesday, March 05, 2002

Hmm, I have not, but that is because I've always viewed MVC as a collection of other patterns.  So whenever I've needed what they call the Observer pattern, I've just used that.  Or if I wanted to treat containers just like any other object, I'd use the Composite pattern.  Mix & match.

I don't quite understand MVC outside of the context of data "views," and controllers which update the other two.  To me it reduces to things like Observer, losing the notion of "model-view-controller." 

In fact, GUIs are where you're least likely to suffer a big impact from the downsides to MVC, which are memory leaks under garbage-collected languages. 

But maybe I am not seeing well into this.  Would you care to offer examples?

Keith Reiter
Wednesday, March 06, 2002

Actually, what am I saying?  Most garbage-compiled languages allow you to interact with the collector, so this memleak problem doesn't need to occur, if you use weak references.

Keith Reiter
Wednesday, March 06, 2002

I have been using MVC for the last 4 years and this is the single most important thing that has happened in my programming career. MVC is a god-send. So simple yet so subtle. I'm still seeing benefits and reuse from code that was not intended to be reused but written in the MVC pattern years ago. Takes a bit longer to implement and write at the beginning but pays of big dividends in the future.

cheapo
Wednesday, March 06, 2002

Keith and Cheapo,

Keith: A lot of people today have broken up the MVC pattern into seperate patterns, but I think that using it as a whole is somethig that should be tried, before settling for the sub-pattern.  I will try and get a good example together an send it through.

Cheapo: Excellent news for me that you have had great success with MVC. Did you use it for non-gui work as well ?

Thankyou both for responding.

James Ladd
Wednesday, March 06, 2002

Cheapo,

Would you like to work together on the development of some java interfaces that implement the MVC pattern and, some examples that make use of the pattern ?

If you do, then please email me directly.

Again, thanks for the response.

James Ladd
Wednesday, March 06, 2002

Maybe it's splitting hairs, but I'd say that MVC is an architecture, not a pattern.

Timothy Falconer
Wednesday, March 13, 2002

*  Recent Topics

*  Fog Creek Home