This week's book giveaway is in the Testing forum.
We're giving away four copies of Data Structures the Fun Way: An Amusing Adventure with Coffee-Filled Examples and have Jeremy Kubica on-line!
See this thread for details.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Why MVC is not one of the 23 GOF patterns?

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Originally I thought the reason was that MVC is a composition of some more basic patterns, such as the observer pattern. But when it is used in web (Model2), observer pattern is not used for the relationship between the model and the view, then which of the 23 GOF patterns do MVC contain?
[ September 18, 2002: Message edited by: Da Zhu ]
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Couldn't the controller in MVC be interpreted as the command pattern from GOF. Views could be based on Composite- but it varies. Your model- if it uses business delegates- might use Proxy as a basis. I'm just giving some examples here of what MVC could be structured as- I guess it seems to me, that you can structure MVC with a variety of patterns built from GOF.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There's nothing magical about the GOF book. The patterns in it (while extremely useful) are not the ONLY patterns in the world. FAR FROM IT! They are only a few common patterns that the authors happened to decide to document first.
There are many, many other patterns just as fundamental as the GOF patterns. In many cases, it's just that the patterns are at a different level. For example, Order-LineItem is a fundamental pattern to doing many types of business systems, but it's not in GOF either (it was, however, discussed in Martin Fowler's "Analysis Patterns").
Likewise, MVC is a fundamental pattern, but it's not of the same level as the GOF patterns -- it's more of an architectural pattern. As such, it was documented in Buschmann's "Pattern Oriented Software Architectures: A System of Patterns" book, which was released at nearly the same time the GOF book was released.
Kyle
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Matthew Brown:
Couldn't the controller in MVC be interpreted as the command pattern from GOF. Views could be based on Composite- but it varies. Your model- if it uses business delegates- might use Proxy as a basis. I'm just giving some examples here of what MVC could be structured as- I guess it seems to me, that you can structure MVC with a variety of patterns built from GOF.


In some implementations (like Struts) Controller objects are, in fact, Commands, but the controller does not have to be implemented with commands. While lots of different implementations of MVC use different GOF patterns, the reason that you can't say "MVC is just X GOF pattern + Y GOF pattern" is that it's not a design pattern -- it's an architectural pattern. You can choose to implement an architecture with an almost infinite number of possible designs. That's where the creativity of software development comes into play.
Kyle
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The reason being MVC is an architectural pattern rahter than a design pattern. so difference is of level of abstraction. you can divide pattern into three categories
1- Architectrual patterns
2- Design patterns
3- Idioms (code level)
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, you can divide patterns into about a million different categories. The three levels above are a start, but not the end by far. You can have patterns of Software configuration management (for instance in Steve Berczuk's upcoming book), J2EE patterns (John Crupi's book), Analysis patterns (Martin Fowler's book), and nearly anything else you can imagine.
Any human endeavor could engender patterns.
Kyle
 
Can you hear that? That's my theme music. I don't know where it comes from. Check under this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic