I have used some variation of MVC in every system I have worked on, and have learned much in the past few years as I became more interested in the historical roots of OO, MVC, and of course DCI. But even after all of that, I still do not have a completely clear picture of how MVC was used by Trygve and others when he originally invented it. Among Trygve's articles, the most helpful was his MVC pattern language:
http://folk.uio.no/trygver/2003/javazone-jaoo/MVC_pattern.pdf
One thing I had not read until just now was Trygve's original
article (I think this was the first?) about MVC:
http://folk.uio.no/trygver/1979/mvc-1/1979-05-MVC.pdf
That article is definitely informative, but it doesn't contain
any code examples and it still leaves me with some questions.
For example, as originally conceived, how should the MVC programmer organize Controllers? Some developers apply MVC at the level of individual components - each UI component (for example a drop-down list or calendar component) has its own view and controller. Other developers create a Controller for each screen or page, and that controller takes care of all communication from the Model to each of the Views for that screen. And of course it's also common to have both controllers for individual components and a supervising controller for the screen as a whole. My current opinion is that each of these approaches has its place, depending on the specifics of the environment and how much functionality is provided by the UI library being used. But I would like to know how Trygve originally conceived it and whether there are any published materials where I can learn more about the specifics.
Trygve's DCI Prokon
example is of course a great example of MVC in action, so
perhaps I should just use that as my model (lower case "m"), but I
thought it would be worth raising the above points here to
hopefully get some clarification.
~~~
Andreas's Article
Last December Andreas posted a link to a nice article he wrote
discussing the history of MVC:
https://github.com/ciscoheat/mithril-hx/wiki/Rediscovering-MVC
That article actually goes a long way toward answering some of my
questions, and I thank Andreas for writing it. It also prompts me
to ask some additional questions...
While the article is a great survey of the original MVC concepts it also seems to add an additional principle of its own: that a View must be a user-defined object. The article suggests that a DOM element in a web page constructed from a template that generates HTML doesn't count as a View. The article states that the View should be an object, and I agree with that, but that still seems pretty open-ended to me. I think most web frameworks provide some sort of object for each View; they just have different approaches to how those view objects get created (including different approaches to templating) and how many additional methods they provide beyond what the DOM itself provides (if any). The Mithril framework provides a clear place to define a view and its HTML programmatically, which has certain advantages, but the article sort of implies that Mithril is one of the few web frameworks that implements true MVC which I don't think is really true.
Also, the article makes some valid criticisms of unnecessarily
introducing a "View Model", but I think a View Model can also be
quite useful in cases where translation from the Model to the data
properties needed by the Views is more complex (i.e. additional
view-specific properties that don't belong in the real Model).
Andreas, I suspect you might agree that View Models still have
their place. I'm just looking to confirm that, and I'd also be
interested in hearing anyone else's opinions on View Models.
~~~
Thanks in advance for suggestions for further learning about MVC.
On 4/23/16 6:19 AM, Hai Quang Kim wrote:
The MVC is not a design pattern, it is a solution for an organization.
I obviously still have a lot to learn about patterns, but I don't think this is true. I get what you're saying - Trygve's original MVC solution was very much focused on the needs of a particular organization - but I think all patterns start out as a solution for a specific problem, and then people discover that the same approach can be successfully used elsewhere, and over time it becomes a pattern. I read somewhere (I think on this list) that MVC actually meets the definition of a pattern where many so-called design patterns do not, in part because of its focus on organizations and people, which has shown to be generalizable to many organizations.
The idea is focus on people and how they want to interact with machine not the other way.
This is a very important point. My post was mostly asking about
technical details, but this is what most interests me about MVC
and should be the backdrop to any conversation about it - thank
you for stating it. And thanks for the reminder that programmers
are users too :)
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composition+unsub...@googlegroups.com.
Den 23/04/2016 kl. 12.54 skrev Matthew Browne <mbro...@gmail.com>:I obviously still have a lot to learn about patterns, but I don't think this is true. I get what you're saying - Trygve's original MVC solution was very much focused on the needs of a particular organization - but I think all patterns start out as a solution for a specific problem, and then people discover that the same approach can be successfully used elsewhere, and over time it becomes a pattern. I read somewhere (I think on this list) that MVC actually meets the definition of a pattern where many so-called design patterns do not, in part because of its focus on organizations and people, which has shown to be generalizable to many organizations.
Cope, I just found an old
post by Risto saying that you once wrote "DCI is a pattern
language". Would you still say that today, and if so, do you think
it might be helpful to document some of the specific patterns we
view as essential to DCI? Perhaps that would be more helpful for
explaining DCI than attempting to write a set of DCI axioms as we
did earlier.
Cope, I just found an old post by Risto saying that you once wrote "DCI is a pattern language". Would you still say that today, and if so, do you think it might be helpful to document some of the specific patterns we view as essential to DCI? Perhaps that would be more helpful for explaining DCI than attempting to write a set of DCI axioms as we did earlier.
Den 23/04/2016 kl. 14.15 skrev Matthew Browne <mbro...@gmail.com>:Cope, I just found an old post by Risto saying that you once wrote "DCI is a pattern language". Would you still say that today, and if so, do you think it might be helpful to document some of the specific patterns we view as essential to DCI? Perhaps that would be more helpful for explaining DCI than attempting to write a set of DCI axioms as we did earlier.
People talk about the technical part of the MVC a lot (really a lot) but not many have the chance to hear the story and the original inspiration.
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To post to this group, send email to object-co...@googlegroups.com.
Visit this group at https://groups.google.com/group/object-composition.
For more options, visit https://groups.google.com/d/optout.
The essence of object orientation is
that objects collaborate to achieve a
goal.
Trygve Reenskaug mailto: try...@ifi.uio.no
Morgedalsvn.
5A http://folk.uio.no/trygver/
N-0378
Oslo http://fullOO.info
Norway Tel:
(+47) 22 49 57 27
Den 24/04/2016 kl. 03.59 skrev Matthew Browne <mbro...@gmail.com>:to it, so I think it may be largely a matter of exposing people to the ideas and history in a way that allows them to see their true value and relevance..
Den 24/04/2016 kl. 10.36 skrev Trygve Reenskaug <try...@ifi.uio.no>:I'm just looking to confirm that, and I'd also be interested in hearing anyone else's opinions on View Models.
To me, it’s a way to break the loop between the end-user mental model and the interface, which leads to surprises. These kinds of surprises aren’t nice. It seems to violate the Direct Manipulation Metaphor. See Laurel’s Computers as Theatre.
I wonder if it would make sense for view-specific properties to
be implemented as role methods on the Model objects. Given the
current access restrictions of roles, that would of course require
that those role methods and all the Views for a given screen are
defined within the same Context. In any case, such properties,
whether implemented as role methods or not, should of course only
be accessible to the UI.
Den 24/04/2016 kl. 13.17 skrev Matthew Browne <mbro...@gmail.com>:That leaves the question of how else to deal with additional or derived properties needed for the View that aren't part of the Model.
Den 24/04/2016 kl. 13.17 skrev Matthew Browne <mbro...@gmail.com>:
The "Tool as a Composite" and "Synchronize Selection" patterns offer one approach: store the view-specific data in the Controller; the Controller updates all the relevant Views when changes occur. A downside is that that seems to preclude the use of the "Synchronize Model and View" pattern for such view data.
Den 24/04/2016 kl. 13.17 skrev Matthew Browne <mbro...@gmail.com>:
But I do think it makes sense to group data properties/functions needed for the UI in a logical way, and without a View Model you can't add view-specific properties to a data object without polluting your Model and would instead need to store them somewhere else in your hierarchy of view data. For example:
Den 24/04/2016 kl. 13.49 skrev Matthew Browne <mbro...@gmail.com>:That works if you only need to show that data in one view, but not multiple views.
--Just to confuse the issue: There might be a Model of the IO in addition to another Model of the substance.
Den 24/04/2016 kl. 14.46 skrev Trygve Reenskaug <try...@ifi.uio.no>:Just to confuse the issue: There might be a Model of the IO in addition to another Model of the substance.
Den 24/04/2016 kl. 14.45 skrev Matthew Browne <mbro...@gmail.com>:The markForDeletion example was just a quick example off the top of my head, and I now realize it wasn't a very good one. I should have thought of an example where there would be an actual need to synchronize the property across multiple views. In the case of deleting items, I agree; I wouldn't want to have multiple views showing pending deletion as that would be confusing, and while I think marking multiple items for deletion can sometimes make sense, I wouldn't want to do it in a long scrollable list where the user couldn't visually see all the selected items in one place.
Den 24/04/2016 kl. 15.05 skrev Trygve Reenskaug <try...@ifi.uio.no>:Of course not. I'm just a simple software designer. What I want to suggest is the the MVC space is a very large space and that each problem has to be solved on its own premisses.I’ve never seen anything like this mentioned in Raskin, Kay, Laurel, or any of the other HCI literature I’ve come across. Is there any published cognitive research on this?
Hi Trygve,
Thank you for your helpful explanation of some important context
and background.
- MVC is an idea, not a recipe. So what should I answer? It is very fuzzy.
Almost all of them use the GOF Observer Pattern to link the model with the I/O. In my big MVC/DCI planning example, the Subject is the Model. It is implemented as a fuzzy kind of simulated database. Whenever this Model is changed, it sends an update-message to all its observers. In this case the Controller object is the only observer. The Controller knows all the Views and can do "the right thing" with its Views.
Hi Trygve,
Thank you for your helpful explanation of some important context and background.
On 4/24/16 8:57 AM, Trygve Reenskaug wrote:
Would it be valid to say that even a very different approach like an immediate mode GUI might still qualify as MVC as long as it focuses on the end user and facilitates the direct manipulation metaphor and separation of concerns? Or would that be confusing matters too much?
- MVC is an idea, not a recipe. So what should I answer? It is very fuzzy.
if(dobutton(counter)){counter.increment();}
if(dobutton(counter)){counter++;}
if(dobutton(counter)){controller.countClick()}
dobutton(counter, func(){ counter.increment() })
dobutton(counter, func(){ counter++ })
dobutton(counter, controller.countClick)
dobutton(&counter)
Den 25/04/2016 kl. 09.08 skrev Egon Elbre <egon...@gmail.com>:It will depend on how you write your code.
IMGUIs are very direct in its purpose.
"I now want to a button with this information and if it's pressed do this.”
This can have a lot of variations:v1.1.if(dobutton(counter)){counter.increment();}
v1.2.if(dobutton(counter)){counter++;}v1.3if(dobutton(counter)){controller.countClick()}v2.1.dobutton(counter, func(){ counter.increment() })v2.2.dobutton(counter, func(){ counter++ })v2.3.dobutton(counter, controller.countClick)v3.dobutton(&counter)
+ a ton of combinations with ID, position, styling, layouting…
Den 24/04/2016 kl. 20.11 skrev Matthew Browne <mbro...@gmail.com>:But as you wisely pointed out, every project should be evaluated on its own terms, and the benefits and necessity of particular techniques vary.
Den 25/04/2016 kl. 09.08 skrev Egon Elbre <egon...@gmail.com>:It will depend on how you write your code.Again, I think that’s a nerd-centric perspective. (And, again, this mail has no picture.) Let’s bring the user into this. It is, after all, a user interface.
IMGUIs are very direct in its purpose."I now want to a button with this information and if it's pressed do this.”A user never says, “I want to press a button.” A user says: “I want to achieve business goal or step X.” There are scores of ergonomic and design concerns that lead to a button. And there are scores of alternatives to buttons.
Speaking of separation of stuff ...This can have a lot of variations:v1.1.if(dobutton(counter)){counter.increment();}Is this in the View, the Model, or the Controller? Given its access to counter I would guess it’s in the Model.
Why does it assume that the interface element is a button? It could be a switch, or a latched slider, or any one of a host of other elements that have the behaviour of having two states and of sending a state change notification. Calling it a button here suggests accidental coupling between the actual interface, and the code.
Den 25/04/2016 kl. 09.08 skrev Egon Elbre <egon...@gmail.com>:It will depend on how you write your code.Again, I think that’s a nerd-centric perspective. (And, again, this mail has no picture.) Let’s bring the user into this. It is, after all, a user interface.
Den 25/04/2016 kl. 10.30 skrev Egon Elbre <egon...@gmail.com>:
I probably should write the Prokon example to make it more obvious how the code will look.
BTW Cope, as you may be aware, immediate mode vs. retained mode
is very relevant to the discussion about time and state (as I just
learned at this
link Egon suggested), because immediate mode is basically
stateless.
As an aside, I also just read (here) about how React (the JS UI library by Facebook) implements immediate mode using a virtual DOM that transparently updates the real (and retained mode) DOM. This might serve as inspiration for how to implement a less stateful UI on top of other existing UI libraries including AWT.
It may sound like I've totally "drunk the kool-aid" of immediate
mode GUIs at this point but really I just find the idea
interesting and am still exploring it (as Egon said, it's "not a
silver bullet").
check if an immediate mode GUI is an instance of my pattern language. Very
BTW Cope, as you may be aware, immediate mode vs. retained mode is very relevant to the discussion about time and state (as I just learned at this link Egon suggested), because immediate mode is basically stateless.
As an aside, I also just read (here) about how React (the JS UI library by Facebook) implements immediate mode using a virtual DOM that transparently updates the real (and retained mode) DOM. This might serve as inspiration for how to implement a less stateful UI on top of other existing UI libraries including AWT.
It may sound like I've totally "drunk the kool-aid" of immediate mode GUIs at this point but really I just find the idea interesting and am still exploring it (as Egon said, it's "not a silver bullet").
I don’t get it. What would be the difference if the example were not using immediate mode?
The user interface, from the point of view of the client application, most often looks like a collection of objects, typically one per "widget", which encapsulate state that needs to be frequently synchronized with that of the application. Such synchronization goes both ways; state moves from the application to the user interface in order for that state to become visible to the user, and state moves from the user interface back to the application when the user interacts with the interface in order to change the state of the application.When the user interacts with the user interface, the client application must explicitly move state from the widgets back into application data structures. Sometimes, depending on the toolkit used, a level of automation is provided by the user interface toolkit for such "data exchange", but the synchronization itself (not to mention the duplicated state) is still a fact of life.Additionally, the manner in which the application is notified of user interactions with the interface (which in turn signals a need for re-syncing of state) often takes the form of callbacks. This requires the application to implement "event handlers" for any low-level interaction that is of interest, often by subclassing some toolkit baseclass either manually or via various code generation tricks; in either case further complicating the life of the client application.IMGUI does away with this type of state synchronization by requiring the application to explicitly pass all state required for visualization and interaction with any given "widget" in real-time. The user interface only retains the minimal amount of state required to facilitate the functionality required by each type of widget supported by the system.With IMGUI, a conceptual shift occurs. Widgets are no longer objects at all, and can't really be said to "exist". They take instead the form of procedural method calls, and the user interface itself goes from being as stateful collection of objects to being a real time sequence of method calls.
Den 01 May 2016 kl. 17:04 skrev Egon Elbre <egon...@gmail.com>:Additionally, the manner in which the application is notified of user interactions with the interface (which in turn signals a need for re-syncing of state) often takes the form of callbacks.
Yes!
> We need UX for application (easy to use), for code (easy to understand), UX for library (easy to use), UX for domain services (easy to integrate)....
Den 01 May 2016 kl. 17:04 skrev Egon Elbre <egon...@gmail.com>:Additionally, the manner in which the application is notified of user interactions with the interface (which in turn signals a need for re-syncing of state) often takes the form of callbacks.Hmm. Anything follows from a fallacy.
So if a momentary contact button should be illuminated when pressed, and it’s one of several options for sending an event to the model, then 1. the model has to know the difference between this and the others
and 2. the model (or maybe the controller) has to know how to manage the colouring when the button is in a pressed *state*. Am I right?
On 24 Apr 2016, at 14.57, Trygve Reenskaug <try...@ifi.uio.no> wrote:
I never know what to answer when I get questions about MVC.I think I once wrote a long mail about the MVC background. There's no way I could find it now. I started the Prokon project around 1980. Its goal was to support a business organization with distributed authority and responsibility. Each manager should be given their personal (virtual) computer with programs they could understand and possibly write. The first example was a distributed planning system where each manager could shape their planning program to fit their particular needs. The overall plan was distributed among these computers and integrated through communication between them. (The Prokon project stopped abruptly when our sponsor's main customer went bankrupt.) At PARC, I concentrated on the part-problem of a manger working with a plan that could potentially consist of several hundred activities. The novel direct manipulation interfaces that were possible through the Alto computer and Smalltalk programming environment made for a fun project.
- MVC is more than a class library because it can give rise to several, different class libraries.
- MVC is more than a role model, because several, different role models could describe MVC. I've had MVC implementations where M, V, and C where all played by the same object.
- MVC is more than a pattern language because it could give rise to several, different languages.
- MVC is an idea, not a recipe. So what should I answer? It is very fuzzy.
The current thoughts in Alan Kay's group was that objects should be visible and tangible. I faced the problem that there an activity should be made visible in many different ways. There was also the problem of making structures of related activities visible on the screen. I had always been a fan of separation of concerns. In particular, I advocated that there should be a separation between the UI part of the program and the part with the actual subject matter (a Plan, a Ledger, an Inventory...) With this separation, programs could be run by other programs as well as by humans. The first MVC implementation was a concrete program design I made at at PARC. It had an elaborate separation of concerns. People got exited about it, possibly because they saw it was more fundamental than I realized at the time.
I have written many programs through the years that are based on MVC. They no longer exist and can't be used as illustrations. Almost all of them use the GOF Observer Pattern to link the model with the I/O. In my big MVC/DCI planning example, the Subject is the Model. It is implemented as a fuzzy kind of simulated database. Whenever this Model is changed, it sends an update-message to all its observers. In this case the Controller object is the only observer. The Controller knows all the Views and can do "the right thing" with its Views. The separation of concerns is pretty deep: The Model doesn't know the I/O objects apart from its list of observers and only the Controller knows the Model.(In this example, the I/O and Model parts are further decomposed separately according to the DCI paradigm.)
On 23 Apr 2016, at 12.54, Matthew Browne <mbro...@gmail.com> wrote:I obviously still have a lot to learn about patterns, but I don't think this is true.
To view this discussion visit https://groups.google.com/d/msgid/object-composition/E1221BC7-AA52-46FA-8012-271879AAFC6D%40scrumplop.org.
Hi Cope,
I think you're saying that MVC is a design pattern, is
that right?
Here's my original quote from back in 2016:
On 4/23/16 6:19 AM, Hai Quang Kim wrote:
The MVC is not a design pattern, it is a solution for an organization.I obviously still have a lot to learn about patterns, but I don't think this is true. I get what you're saying - Trygve's original MVC solution was very much focused on the needs of a particular organization - but I think all patterns start out as a solution for a specific problem, and then people discover that the same approach can be successfully used elsewhere, and over time it becomes a pattern.
Matt Browne (he/him)
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/object-composition/9BE68528-343D-45E1-8B71-59A1E98175E6%40yahoo.com.
On 21 Mar 2026, at 22.38, Matthew Browne <mbro...@gmail.com> wrote:I think you're saying that MVC is a design pattern, is that right?
--
You received this message because you are subscribed to the Google Groups "object-composition" group.
To unsubscribe from this group and stop receiving emails from it, send an email to object-composit...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/object-composition/DF6C9A62-8A4D-4F4F-B468-13AA13B0D04F%40yahoo.com.