Materialism, Idealism, and MVC software architectures

My attention was recently directed to a discussion on the fundamental assumptions of materialist versus idealist thinkers (sound familiar?), and it got me thinking.

In case you aren’t familiar with these terms—and don’t feel like reading an entire Wikipedia article about each—here’s the basic gist: a materialist believes, essentially, that reality is what we can observe and measure with our senses. That is, it is the material world as we know it; there’s nothing beyond that (or if there is, it is of no consequence to us as we have no way of measuring it, which means it doesn’t affect us). The idealist believes that reality is something separate from what we can observe and measure. Reality, to the idealist, exists in our minds, with the material “world” with which we are all familiar amounting to merely a representation of reality which we ourselves construct.

Now, perhaps neither of these sounds quite right to you. If so, that may be because most people are, in my opinion, closer to dualists: they believe that the material world is real, but that there might also exist another “dimension” (not a rigorously defined term, by any means, there) beyond what we can see, touch, etc.—that is, measure. In other words, dualists are open to the concept that reality is multifaceted, and that the material world we can observe might be only one of its many facets.

If you will bear with my shenanigans for a short while, I want to meander away from materialism and idealism (and dualism) for a moment and talk about something seemingly unrelated: the model-view-controller pattern in software architecture.

A model-view-controller (MVC) design is one in which a data model is separate (in software we say “decoupled”) from its visual presentation (the view). The two are developed as separate components of a software system, allowing for an extremely flexible mode of developing and maintaining the system. (For the purpose of this discussion I’m actually going to leave out any mention of the controller altogether. If you’re interested, you can Google MVC and find roughly a million useful resources on the subject.) Consider the following benefits:

  • The model can be modified or reorganized in any way so long as this is invisible to the view. For example, given a sufficiently abstract model, the database back-end of an application could be completely switched (say, from MySQL to PostgreSQL) without having to make any changes to the user interface.
  • Likewise, the view can be modified, themed, and enhanced in any way; this requires no changes to the model.
  • Multiple views may be designed to present the model in different ways.

It is that last point I want to really focus on now. A model may be presented by completely different views. Here’s a standard example:

A Model-View example

One model, two views


In the diagram above, there is a single “model” comprising 5 distinct data points. These data points consist of two unlabeled columns and five rows.

In presenting this model, two views are illustrated. One—the so-called Pie view—depicts each data point in the model as a colored slice of a pie, where the size of each slice is proportional to its corresponding value within the model. The other view—the Bar view—depicts the model a bit differently: rather than a pie which is divided into slices, the model is presented in the form of bars whose heights are proportional to values in the model.

There are two points I want to make here. Actually, three. I’ll start with the most obvious.

1. Views are not authoritative.

Here’s what I mean by this. Both the “Pie” view and the “Bar” view might be conceptualized as a lens through which the model is perceived. They allow us to “see” the model in different ways, but neither one reveals what the model truly “is”; that is, it would be untrue to say that the model is a pie, or that it is a series of bars. Hopefully I don’t have to convince you of this.

Color Filters

A view only provides a perspective of a model; the model exists independently of its views.

I might compare this to what happens when you look at an object through a color filter. Doing this results in an image of the object that appears to have certain color characteristics; what is important to realize is that it is not the object itself but rather the image which possesses these specific characteristics. This brings me to my next point.

2. Views come with the baggage of connotations.

On first glance, the “Pie” and “Bar” views might seem very similar. Certainly they look a bit different, but they appear to convey basically the same concept. I consider this to be analogous to the way in which individuals may share roughly compatible ideas on a topic, though the precise details and nuances of each individual’s viewpoint might not align 100% perfectly with those of the other.

But there’s more to it than that. Look at those views again, and really ask yourself, What does this image represent? I believe the majority of people will not think of this, at least not initially: a pie chart presents parts as contributing to a whole, while a bar chart presents independent parts in relation to one another. These are actually very different! To make this more obvious, let’s update the model in the above diagram so that it represents some (potentially) real-world information.

A more "real" Model-View example

One model, two views... which one doesn't seem quite right?

In the updated model above, the value of each data point is the height of a given person. Now ask yourself this: What is wrong with one of those views?

If you think about it for a second, it should be pretty clear that the “pie” view of the above model actually makes no sense. It just looks odd because it seems to imply that each individual’s height is somehow a part of an overall “group” height. This is silly, and does not correspond to anything that we think of as real or meaningful. On the other hand, the “bar” view seems much more well-suited to this type of model. Each individual’s height is an independent value, but it may be interesting to look at the different heights in relation to one another.

This is an example of a case where the disconnect between the data in a model and the view presenting that data is obvious (or relatively so, anyway); but I think it’s reasonable to wonder how often data is presented to us (in marketing materials? or how about legitimate research publications?) with a specific choice of view that colors our perception of the underlying data—the model—in ways we don’t immediately recognize.

And now for the real zinger: That’s exactly what I’ve done, in this very post! Keep reading…

3. A model cannot be perceived without a view of some kind.

Here is a quote of myself from several paragraphs ago:

These data points consist of two unlabeled columns and five rows.

No, that is a lie. (Those of you who are especially observant may have already noticed this but forgiven me for what you felt was a small oversight. It was very intentional!) The data points do not “consist of” columns and rows; columns and rows are part of a view! In the two diagrams above, the part representing the “model” in each case might be more accurately labeled “Table View.”

This is such a crucial point that I’m going to explore it a bit further. When we speak of data, we are describing an abstract idea. Data is just quantitative information; and information, in turn, goes in your head. It does not “exist” in any physical form, any more than the number 5 “exists” or the concept of justice “exists” in a physical form.

Here’s another illustration that might help you internalize this concept. Let me ask you a question: what is Moby Dick? If your answer is “a book,” you’re not quite right; if your answer is “a work of literature,” you’re a bit closer.

Cover of Moby Dick

Is this Moby Dick?

Here’s what I mean: imagine you sit down with a copy of Moby Dick, ready to lose yourself in its literary splendor. Are you holding the story of Moby Dick? No, you’re holding a book. OK, so where is the story? Inside the book, right? So you open up to the first page of chapter one and start reading. Are you now looking at the story of Moby Dick? Well, you’re looking at… text. Ink on paper—is that the story?

Imagine you drop the book by accident, it spontaneously combusts into flame and disappears into a miserable pile of ashes. Is Moby Dick now gone?

Of course not! There are millions of copies all over the world. Now imagine that those copies all spontaneously combust, leaving millions of little piles of ashes all over the planet where people had just moments ago been enjoying the story of Moby Dick (or, more realistically, where these millions of books had been sitting unread on lonely bookshelves). Now is Moby Dick gone? Has the story disappeared forever?

Moby Dick movie poster

Is this Moby Dick?

I suspect that your instinct tells you that no, it isn’t truly “gone.” The words were never just the ink on the paper in all of those books, anyway. The information of Moby Dick is not gone, because it was never “there” to begin with: it was never a physical thing.

Moby Dick is a model, and there are millions (or at least hundreds of thousands, I would imagine?) of views of this model floating around all over the world. The most common view, of course, takes the form of a book; but others exist as well, ranging from the obvious—electronic editions of the book—to the not-so-obvious—the 1956 film starring Gregory Peck, for example. In every case, the view is a material thing that can be perceived, which provides a representation of the underlying model.

By now I have beaten this point to death, so hopefully you get it: models do not “exist” in the real world. They are abstract.

So where was I going with all this? Ah yes, materialism and idealism.

The model of Materialism

At this point it might seem as though I am fully endorsing Idealism while declaring Materialism to be false. This isn’t the case—nor do I suspect that an argument rooted in a software concept would find much traction among the philosophy community, anyway! Here’s my actual point. (Wow, what a long-winded path I took to get here, huh? This final part will actually be brief.)

Imagine you are looking at a cherry tree. When you utter a phrase like “I see a cherry tree”—and I am plagiarizing here, from I believe a fairly well-known philosopher, whose name is simply not coming to me at the moment (if any readers know whose basic idea I am regurgitating here, please let me know so that I can cite the appropriate source!)—what you really mean is, “It seems to me that I see a cherry tree.” What you think you see might be an illusion, or even a painting. You cannot know for a fact that there is a cherry tree in front of you. You might even be hallucinating, and there is nothing at all in front of you!

Three perceptions of a cherry trees

In the illustration above, I am suggesting that there is a reality (there is a cherry tree there, or there is a picture of a cherry tree, or there is nothing at all—or anyway, nothing resembling a cherry tree), but leaving open the question of how far removed we are from that reality. It could be that what we perceive (our view) is very close to the “model” we are trying to understand (reality); or it could be that our view is hopelessly unrepresentative of that model. Or the truth could lie somewhere in the middle.

The materialist view, I believe, is basically like the leftmost cherry tree. Materialists believe that what we perceive is so close to reality, they are effectively the same thing. (Based on my understanding of human cognition, I cannot believe they would argue that they are literally the same thing; but if any materialist readers take issue with that, it’ll have to be an issue for a future debate.) The idealist view, on the other hand, is more like the middle or perhaps even the rightmost cherry tree. Idealists believe that reality is not necessarily well represented by our perception.

Of course I am oversimplifying here, but this is what occurred to me as I pondered the Materialism-Idealism debate: essentially the disagreement between these two schools of thought amounts to a disagreement in how closely our view of the world (our perception) matches the model we want to understand (reality itself).

Advertisements

3 thoughts on “Materialism, Idealism, and MVC software architectures

  1. Raina says:

    Dude, look at you, the next Hofstrader over here. I enjoyed this post man, very well written. But why don’t you put the comment link towards the end of your posts rather then below the title is my question?

    • Daniel says:

      Oh Raina, so young and innocent. I have no control over where the comment link appears; that’s completely up to the whim of the theme designer. OK, well, I guess I could always look for a new theme. If it’s that much of a big deal to you, that is. (Also, I think that I could change the positioning myself if I enabled a “Custom CSS” option on my blog, which actually costs money; but… let’s be serious.) Anyway, thanks for reading! I think you’re the only person who read this one.

  2. Bragaadeesh says:

    Amazing write up!! Since it was a bit lengthy, I had put this in a queue to read it in a weekend, and today is a weekend!!
    I have a doubt here and its one of the questions which I recently asked in SOF (http://stackoverflow.com/questions/4826650/confused-on-mvc-in-rails) for which I did not get a convincing answer.
    I feel there are two types of models (I may be gravely wrong). One of the models is the data model that is directly coupled to a view. Perhaps the example you’ve shown, I can assume it as a data model. But the ‘M’ in MVC often relates to the Model where ‘business-logic’ is written (or so I think). I have been confused for quite some time and was waiting that someone could solve this doubt of mine.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: