IanG on Tap

Ian Griffiths in Weblog Form (RSS 2.0)

Blog Navigation

April (2018)

(1 item)

August (2014)

(1 item)

July (2014)

(5 items)

April (2014)

(1 item)

March (2014)

(1 item)

January (2014)

(2 items)

November (2013)

(2 items)

July (2013)

(4 items)

April (2013)

(1 item)

February (2013)

(6 items)

September (2011)

(2 items)

November (2010)

(4 items)

September (2010)

(1 item)

August (2010)

(4 items)

July (2010)

(2 items)

September (2009)

(1 item)

June (2009)

(1 item)

April (2009)

(1 item)

November (2008)

(1 item)

October (2008)

(1 item)

September (2008)

(1 item)

July (2008)

(1 item)

June (2008)

(1 item)

May (2008)

(2 items)

April (2008)

(2 items)

March (2008)

(5 items)

January (2008)

(3 items)

December (2007)

(1 item)

November (2007)

(1 item)

October (2007)

(1 item)

September (2007)

(3 items)

August (2007)

(1 item)

July (2007)

(1 item)

June (2007)

(2 items)

May (2007)

(8 items)

April (2007)

(2 items)

March (2007)

(7 items)

February (2007)

(2 items)

January (2007)

(2 items)

November (2006)

(1 item)

October (2006)

(2 items)

September (2006)

(1 item)

June (2006)

(2 items)

May (2006)

(4 items)

April (2006)

(1 item)

March (2006)

(5 items)

January (2006)

(1 item)

December (2005)

(3 items)

November (2005)

(2 items)

October (2005)

(2 items)

September (2005)

(8 items)

August (2005)

(7 items)

June (2005)

(3 items)

May (2005)

(7 items)

April (2005)

(6 items)

March (2005)

(1 item)

February (2005)

(2 items)

January (2005)

(5 items)

December (2004)

(5 items)

November (2004)

(7 items)

October (2004)

(3 items)

September (2004)

(7 items)

August (2004)

(16 items)

July (2004)

(10 items)

June (2004)

(27 items)

May (2004)

(15 items)

April (2004)

(15 items)

March (2004)

(13 items)

February (2004)

(16 items)

January (2004)

(15 items)

Blog Home

RSS 2.0

Writing

Programming C# 5.0

Programming WPF

Other Sites

Interact Software

A Question of Scale

Thursday 16 September, 2004, 02:34 PM

In my previous blog, I attempted to answer Ted's question: "Is an Oracle database a service?" When considering what may or may not be a service, one person's service boundary is another person's implementation detail - it all depends on your point of view. Unfortunately for Ted, this doesn't advance his quest to find a meaningful definition of SO. What use is it if I can decompose one system in two different ways to come up with different answers to the question: "Is this bit here a service?"

Then again, maybe it's not really a problem at all. In fact it's just a specific instance of a more general pattern: the role a particular piece of your system appears to fulfil may change according to the scale at which you are working.

It's not exactly unusual for a particular abstraction to be applicable at more than one scale, and for this to result in apparently inconsistent labels. I think MVC is a prime example of this. Consider a window in an application. The window presents a view onto some information, and supports various interactions that may result in things being done to the data - just the kind of scenario that MVC is useful in. But what exactly is the model? Often there are two answers.

One perfectly valid and rather obvious point of view is that the model is whatever underlying data the form lets me edit. For example, the model might be the collection of documents that make up this blog. In this world view, the form I use to create and edit blog entries is clearly the view, and the logic that handles user actions, and performs the necessary operations on the model looks like the controller.

An equally valid but frequently overlooked alternative point of view is to look at things on a smaller scale. Suppose my editing UI offers smart tag popups, spell checking, and all the other gizmos that make the whole rich client editing experience so much nicer than your basic HTML editing UI. A pop-up smart tag is a thing the user can see and interact with. So isn't it also the kind of thing to which we can apply MVC? There will be some model that defines what is in the smart tag, a view to make it visible, and a controller to work out what to do when the user interacts with the view.

According to the first perspective, the view includes the form and all its internal behaviour - smart tags and the like are an internal detail of the view. But according to the second perspective, this very same body of code is a composite entity with a model, view, and controller.

Both perspectives are valid and useful. Neither is more correct than the other despite the apparent contradiction. The one you choose will depend on the scale at which you are considering the system. I think the same applies to the two points of view that support the idea that the database is both a service in its own right, and an internal implementation detail of some other service.

Copyright © 2002-2018, Interact Software Ltd. Content by Ian Griffiths. Please direct all Web site inquiries to webmaster@interact-sw.co.uk