<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-595651711960625596</id><updated>2011-08-30T06:50:24.201-07:00</updated><category term='modelling'/><category term='uml'/><category term='NakedAgilists'/><category term='webDSL'/><category term='Eelco Visser'/><category term='Chasm'/><category term='Moore'/><category term='tiefenbrun'/><category term='code generation'/><title type='text'>random cognition</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>12</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-7873862906730888187</id><published>2010-01-28T13:36:00.000-08:00</published><updated>2010-06-04T14:51:07.004-07:00</updated><title type='text'>A modelling language focused on Relationships?</title><content type='html'>As with all things, interest in modelling languages is cyclic.  In the 90s object orientation was big, leading to the creation of UML.  Interest then tailed off, but recently modelling languages have come back in to focus with the rise (again) of domain specific languages.&lt;br /&gt;&lt;br /&gt;With each renewed interest comes a renewed search for the one true modelling language - 'one language to rule them all'.  It's not as if we're short of candidates: there's &lt;a href="http://www.omg.org/mof/"&gt;MOF&lt;/a&gt; (the foundation of &lt;a href="http://www.uml.org/"&gt;UML&lt;/a&gt;) and myriad offshoots such as eclipse &lt;a href="http://www.eclipse.org/modeling/emf/"&gt;EMF&lt;/a&gt;.  Then there are less mainstream alternatives like &lt;a href="http://www.metacase.com/support/45/manuals/mwb/Mw-1_1_1.html"&gt;GOPPRR&lt;/a&gt;. More recently there's &lt;a href="http://industrialized-software.wdfiles.com/local--files/kiss-aswec-2009/Bettin.pdf"&gt;GModel&lt;/a&gt; and a proposal by &lt;a href="http://www.computer.org/portal/web/csdl/doi/10.1109/TSE.2009.31"&gt;Atkinson et al&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Each has strengths and weaknesses.  UML cemented concepts like classes, objects, binary relationships and subtyping in the mainstream vocabulary, and provided a default graphical syntax.  However it's an extremely complex language, not self-consistent and too imprecise for direct interpretation.&lt;br /&gt;&lt;br /&gt;GOPPRR provides a much smaller language: easy to understand yet one that's proven useful and workable at the coal face.  GModel and Atkinson bring some novel concepts to the space, such as multi-level instantiation.&lt;br /&gt;&lt;br /&gt;Though different - significantly so in some respects - all seem to share a common, implicit philosophy.  They all appear to arise from first asking the question "what are the useful concepts we need to express?" then secondarily "and how do they relate to each other?".&lt;br /&gt;&lt;br /&gt;That's understandable.  It's what every book on OO modelling tells us: find the interesting abstractions, and figure out how they fit together.  Yet experience says the key to unlocking a problem domain lies in understanding the relationships.&lt;br /&gt;&lt;br /&gt;That gives rise to a question: what happens if we focus first on the relationships instead of the things being related?  Is there some minimal set of useful relationship types?  What would a resultant modelling language look like?  And would it actually be any use in practice?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-7873862906730888187?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/7873862906730888187/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=7873862906730888187' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/7873862906730888187'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/7873862906730888187'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2010/01/instance-of-relation.html' title='A modelling language focused on Relationships?'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-6104104678719484476</id><published>2009-03-27T14:57:00.000-07:00</published><updated>2009-04-01T14:39:58.293-07:00</updated><title type='text'>Lifted... and let down</title><content type='html'>Alternative languages on the JVM are very 'in' at the moment, &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt; in particular.  Almost inevitably, there's a web framework for Scala - &lt;a href="http://liftweb.net/"&gt;Lift&lt;/a&gt;.  I looked at it briefly a while ago when embarking on a new web application.  The '&lt;a href="http://wiki.liftweb.net/index.php?title=Main_Page"&gt;sales pitch&lt;/a&gt;' was compelling, pulling together the best aspects of other frameworks whilst exploiting the power, scalability and safety provided by Scala.  However, it was very early in its development with little documentation and few plugins.  I decided in the end to use &lt;a href="http://www.grails.org/"&gt;Grails&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Lift has matured somewhat since then so I took another look.  I'm still very much taken by the pitch; the framework has matured significantly and the documentation has improved beyond all recognition (i.e. there is now some - including an incomplete but nevertheless good &lt;a href="http://liftweb.net/docs/getting_started/mod_master.html"&gt;online book&lt;/a&gt;.  There are also &lt;a href="http://www.ibm.com/developerworks/ajax/tutorials/wa-aj-comet/index.html"&gt;tutorials&lt;/a&gt; starting to pop up, so I thought I'd take another look.&lt;br /&gt;&lt;br /&gt;Setup is easy, making extensive use of &lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt;.  Next up is creating domain classes - and I'm afraid the first disappointment.  Per all web frameworks, Lift comes complete with its own Object Relational Mapping capabilty - named, appropriately, Mapper.  The tutorial uses a "ToDo" class as an example, with each item having the following properties: a "done" flag (boolean), a priority value (Integer), a description (String) and a relationship to the Owner of this particular item.&lt;br /&gt;&lt;br /&gt;Very simple.  In Grails, I'd code this as:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;class ToDo {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    Boolean done&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    Integer priority&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;           String description&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;           User owner&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Pretty intuitive, intentional and economic.&lt;br /&gt;&lt;br /&gt;Here's the Lift equivalent from the Tutorial:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;class ToDo extends LongKeyedMapper[ToDo] with IdPK { &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;  def getSingleton = ToDo &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;  object done extends MappedBoolean(this) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;  object owner extends MappedLongForeignKey(this, User) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;  object priority extends MappedInt(this) { &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;      override def defaultValue = 5 &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;  } &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;  object desc extends MappedPoliteString(this, 128) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;" &gt;} &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:85%;"  &gt;object ToDo extends ToDo with LongKeyedMetaMapper[ToDo]&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Wow!  Now granted, this is my first introduction to Scala and Lift.  But there seems to be an awful lot going on there:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;    a class and an object with the same name;&lt;/li&gt;&lt;li&gt;the main ToDo class extends a parameterised type - which is parameterised with ToDo itself&lt;/li&gt;&lt;li&gt;a singleton ToDo which extends the ToDo class with another type parameterised with ToDo (the object or class? Not sure...)&lt;/li&gt;&lt;li&gt;    a slew of names evidently drawn from the world of relational databases (PK, ForeignKey, MappedXX types).&lt;/li&gt;&lt;/ul&gt;Lets deal with the last point first.  It's a philosophical discussion over whether the domain classes should provide a "clean" Object view of the concepts and hide the Relational mapping - or expose the Relational concepts explicitly.  Grails takes the former approach, Rails the latter. Django is somewhere in between.  My personal preference is the former - but its personal preference, so let's put that aside.&lt;br /&gt;&lt;br /&gt;But even allowing for that, why does it have to be so complicated?  From my perspective as a Scala and Lift newbie, it almost looks like a case of "we have all this cool stuff at our disposal, lets use it".  Hence objects, classes, extension, traits and generics all make it in there.&lt;br /&gt;&lt;br /&gt;Now I'm all for using the power of the language.  But surely it should be used to both make things more intuitive and improve economy of expression?  That certainly doesn't seem to be the case above.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Concept vs. Representation&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Scala has some powerful XML handling capabilities, and Lift exploits these to enable tailoring of the way in which elements will be presented.  Here's a snippet from one of the tutorials:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;override def _toForm: Can[NodeSeq] = {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   val funcName = S.mapFunc({s: List[String] =&gt; this.setFromAny(s)})&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; &lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Full(&amp;lt;/span&amp;gt;&amp;lt;textarea style="font-family: courier new;" name="{funcName}" rows="{textareaRows.toString}" cols="{textareaCols.toString}" id="{fieldId}"&amp;gt;{is.toString}&amp;lt;/textarea&amp;gt;&amp;lt;span style="font-family:courier new;"&amp;gt;)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Powerful indeed.  But wise? First off, it's mixing representation information with the domain class.  Or, in MVC terms, mixing part of the View in with the Model.  MVC says they should be separate, based on the principles of low coupling and high cohesion.  It also complicates the workflow if a graphic designer is doing the UI / layout and a programmer doing the logic.  As above, it seems like another case of wilful rather than judicious use of power.&lt;br /&gt;&lt;br /&gt;And I'm afraid that's as far as I got.  Maybe I should have persevered; Scala's Actor support holds significant promise for efficient scaling.  But for now I'm not sold.  Grails (and Groovy) may not have some of Scala's power features but the 'user interface' is significantly cleaner.  So I'll continue grooving for now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-6104104678719484476?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/6104104678719484476/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=6104104678719484476' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/6104104678719484476'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/6104104678719484476'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2009/03/lifted-and-let-down.html' title='Lifted... and let down'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-7018819602650085801</id><published>2009-03-24T15:33:00.000-07:00</published><updated>2009-04-05T13:47:17.872-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='modelling'/><title type='text'>Relationships are more fun - part II</title><content type='html'>Trygve Reenskaug and James Coplien have just posted an &lt;a href="http://www.artima.com/articles/dci_vision.html"&gt;article&lt;/a&gt; questioning the fundamentals of Object Orientation and the Model-View-Controller pattern.&lt;br /&gt;&lt;br /&gt;It's interesting (if perhaps a little more wordy than necessary).  And I don't agree with all of it (more of that later).  But their characterisation of the relationship between the User's mental model and the Object model represented in software is spot on.  But perhaps more interesting is their questioning of one of OO's central tenets: that all behaviour belongs in Objects (or Classes in programme language terms).&lt;br /&gt;&lt;br /&gt;They assert that, whilst some behaviour does belong within the Object, much doesn't.  To use their example: responsibility for increasing or decreasing an Account's balance properly lies with the Account.  External parties can ask the Account to perform those operations, but it's up to the Account to do it.  That's fully in line with the principles of Abstract Data Types on which OO is founded.&lt;br /&gt;&lt;br /&gt;But what about performing a Transfer of funds from one Account to another?  Where does that belong?  Reenskaug and Coplien assert this doesn't belong with the Account Object - I agree.  But that's how it would typically be handled in today's OO languages; so the Account class would typically have a method named "transferTo()", used as follows:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-family:courier new;font-size:85%;"  &gt;Account src;&lt;br /&gt;Account dest;&lt;br /&gt;src.transferTo(dest, 20.00); &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;What's wrong with that?  From a mental model perspective, it doesn't work.  When I think about transferring funds, I don't think about the responsibility lying with either the source or destination account.  Sure they're both involved, but neither is responsible.&lt;br /&gt;&lt;br /&gt;So where does it belong?  In OOP terms we have nowhere else to put it other than in a Class. Reenskaug and Coplien suggest the notion of Interactions as first class entities; however their model still portrays an asymetric pattern (i.e. the responsibility for executing the transfer still lies with either the source or destination objects).&lt;br /&gt;&lt;br /&gt;I prefer to think about it lying outside of either.   But that doesn't mean the OO model is broken.  Maybe it's just the way we use it today.  Coming back again to the code example above:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;src.transferTo(dest);&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now what happens if we look at this from a relationship perspective?  What's the nature of the relationship?  It's pretty obvious there's some link between the source and destination accounts - even if it's only transient.  Here's an initial view as a UML class diagram?&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-ehS1ZbM41M/Scq1_Ke1V0I/AAAAAAAAAAw/qwIxC-obP7k/s1600-h/Funds+transfer+-+recursive.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 114px; height: 100px;" src="http://2.bp.blogspot.com/_-ehS1ZbM41M/Scq1_Ke1V0I/AAAAAAAAAAw/qwIxC-obP7k/s320/Funds+transfer+-+recursive.jpg" alt="" id="BLOGGER_PHOTO_ID_5317262406814357314" border="0" /&gt;&lt;/a&gt;Both source and destination are instances of Account, so the relationship would have to be recursive on Account.  OK.  Naming the ends?  Easy; one is source, the other destination.  Cardinality?  Hmm, that's a bit more difficult.  A given transfer has exactly one source and one destination account; and any account can be the source and/or target for many transfers.  But we can't represent that on our relationship:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;1:1 would only allow each account to be related to a single other: i.e. at most one transfer.&lt;/li&gt;&lt;li&gt;many:many would only allow each account to be related to every other; but for every pair there could only be one transfer.  Again, not what we need.&lt;/li&gt;&lt;/ul&gt;Let's revisit naming the relationship ends.  I used "source" and "destination" above, which are role-based names.  As I've stated previously, I prefer verb-based names because they bring out the "why" of the relationship.  So how would we name the relationship ends using verb phrases?&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_-ehS1ZbM41M/Scq2yWHsRoI/AAAAAAAAAA4/9kkq8SV4WcE/s1600-h/Funds+transfer+-+recursive+-+verb+based.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 302px; height: 100px;" src="http://2.bp.blogspot.com/_-ehS1ZbM41M/Scq2yWHsRoI/AAAAAAAAAA4/9kkq8SV4WcE/s320/Funds+transfer+-+recursive+-+verb+based.jpg" alt="" id="BLOGGER_PHOTO_ID_5317263286111848066" border="0" /&gt;&lt;/a&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;Each Account may be the transfer source of one or more other Accounts&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;&lt;br /&gt;Each Account may be the transfer destination of one or more other Accounts&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Kinda works, but it looks clumsy; it smells bad.  So the cardinality doesn't work and the relationship naming is ugly.  What does that tell us?  Maybe there's no relationship?  Well that's not true.  It may be transient but both accounts are undeniably involved in something - otherwise there's no transfer.&lt;br /&gt;&lt;br /&gt;Transfer.  Hmm.  What if, rather than looking at transfer as a verb, we treat it as a noun?  What would that mean?  Let's rework the model:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_-ehS1ZbM41M/Scq4WonOggI/AAAAAAAAABA/IGoTGAAbVv0/s1600-h/Transfer+Class.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 307px; height: 90px;" src="http://1.bp.blogspot.com/_-ehS1ZbM41M/Scq4WonOggI/AAAAAAAAABA/IGoTGAAbVv0/s320/Transfer+Class.jpg" alt="" id="BLOGGER_PHOTO_ID_5317265009062871554" border="0" /&gt;&lt;/a&gt;Let's examine the relationships again:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;Each Transfer must debit exactly one Account&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;Each Account may be debited in one or more Transfers&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;An Account need not be debited in any Transfers&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Each Transfer must credit exactly one Account&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;Each Account may be credited in one or more Transfers&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;An Account need not be credited in any Transfers&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;That's much better.  The cardinality and phrasing capture exactly what we're trying to express - so the relationships look OK.  But what about that "Transfer" class?  Is it a proper class?  Well, what does it mean to be a "proper" class? &lt;quote an="" abstraction="" of="" data="" and="" state=""&gt;It's definitely an abstraction of behaviour - the transfer behaviour.  What's more, it's a well encapsulated abstraction of behaviour.  We are not loading the Account class with the responsibility for executing transfers; it need only respond to "credit" and "debit" requests: appropriate since it maintains the account balance.&lt;br /&gt;&lt;br /&gt;What about state?  That's OK too.  The transfer value again properly belongs with the Transfer.  We could also, if required, capture details of the time and success/failure of each transaction.  Finally, we could, if required, track the state of each Transfer as it executes ("debiting source account", "crediting destination account", "completed successfully", ...).&lt;br /&gt;&lt;br /&gt;There are critics of this approach who disagree with the idea of reification - treating behaviour as things.  Rather, objects should be tangible things: Accounts, Customers, Chairs, Telephones, whatever - the things that are things in the real world.&lt;br /&gt;&lt;br /&gt;The trouble is that doing so causes the situation that leads to &lt;span style="color: rgb(0, 102, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;a.transferTo(b)&lt;/span&gt;&lt;/span&gt;.  In fact, most of the interesting behaviour doesn't happen in the tangible objects.  Transfer is an example of an Interaction object; one that coordinates a protocol amongst other objects.  Interaction objects are useful and interesting precisely because they enable clean abstraction of behaviour amongst a number of other objects.&lt;br /&gt;&lt;br /&gt;So is the OO model broken?  No, not really.  We just need to learn to use it properly.  Going back to Coplien and Reenskaug, maybe it would help to promote Interactions to first class status, and hence increase focus on collaborations.  Key to that is learning to love relationships - they're where all the fun happens.&lt;br /&gt;&lt;br /&gt;&lt;/quote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-7018819602650085801?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/7018819602650085801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=7018819602650085801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/7018819602650085801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/7018819602650085801'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2009/03/relationships-are-more-fun-part-ii.html' title='Relationships are more fun - part II'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_-ehS1ZbM41M/Scq1_Ke1V0I/AAAAAAAAAAw/qwIxC-obP7k/s72-c/Funds+transfer+-+recursive.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-1148475868786344235</id><published>2009-03-24T14:27:00.000-07:00</published><updated>2009-03-25T16:13:42.504-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='uml'/><category scheme='http://www.blogger.com/atom/ns#' term='modelling'/><title type='text'>Relationships are more fun</title><content type='html'>A number of years ago, I was fortunate enough to work for &lt;a href="http://en.wikipedia.org/wiki/Steve_Mellor"&gt;Steve Mellor's&lt;/a&gt; company.  I remember vividly the first time I met him; I was very nervous.  He was reviewing a domain model that I'd built, and I was amazed at how quickly he found a couple of logical flaws.  One thing he said during the review has stuck with me ever since: "the fun is always in the relationships".  It struck me as strange at the time; as someone schooled in OO, I had come to view Objects as the things that mattered.  Relationships? Just pointers between Objects, right?&lt;br /&gt;&lt;br /&gt;Wrong.  Very wrong.  Experience has fully vindicated Steve's assertion that the interesting stuff really does lie in the relationships, not the objects.  In fact, the key to understanding any domain always comes down to formalising the relationships among the domain concepts.  So I'm constantly frustrated by models in which relationships are second class citizens, demoted to pointers between objects with perhaps a role name.  Something like this:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_-ehS1ZbM41M/SclWmhk21KI/AAAAAAAAAAY/bh853z2MEAg/s1600-h/pointer-based+naming.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 316px; height: 62px;" src="http://4.bp.blogspot.com/_-ehS1ZbM41M/SclWmhk21KI/AAAAAAAAAAY/bh853z2MEAg/s320/pointer-based+naming.jpg" alt="" id="BLOGGER_PHOTO_ID_5316876054935557282" border="0" /&gt;&lt;/a&gt;Why?  Because it says nothing about the semantics of the relationship. &lt;span style="font-style: italic;"&gt;Why&lt;/span&gt; does a Customer have a list of Accounts?  Moreover, it says little about the domain - and doesn't prompt discussion or questions about the relationship.  Can a customer really have more than one Account?  How many Customers is each Account related to?  What does the relationship &lt;span style="font-style: italic;"&gt;mean&lt;/span&gt; when viewed from the Account's perspective anyway?&lt;br /&gt;&lt;br /&gt;Steve (and my colleague, close friend and boss at the time Alistair Blair) instilled in me the importance of naming relationships using verb phrases.  I've found it extremely valuable, more recently adopting the style recommended in &lt;a href="http://books.elsevier.com/uk/mk/uk/subindex.asp?isbn=9780126445510&amp;amp;country=United+Kingdom&amp;amp;community=mk&amp;amp;ref=&amp;amp;mscssid=QUG4F5JCWGGA8GNB7EUKF3U7RAGND9G7"&gt;Simsion and Witt's excellent book on Data Modelling&lt;/a&gt;.  So the model above becomes:&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_-ehS1ZbM41M/SclZaLGFmJI/AAAAAAAAAAg/CUHgizDh4WY/s1600-h/Verb+Phrase+based+naming.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 281px; height: 60px;" src="http://1.bp.blogspot.com/_-ehS1ZbM41M/SclZaLGFmJI/AAAAAAAAAAg/CUHgizDh4WY/s320/Verb+Phrase+based+naming.jpg" alt="" id="BLOGGER_PHOTO_ID_5316879141277374610" border="0" /&gt;&lt;/a&gt;With very little extra effort this provides much more information.  We now know the relationship represents "Account Ownership".  It doesn't cover being an authorised signatory, or a benefactor, or anything else.  Are those things necessary?  They may be.  The point is the model now prompts that question.&lt;br /&gt;&lt;br /&gt;The model also makes assertions about the relationship.  An Account must be owned by exactly one Customer.  Is that right?  What about joint Accounts?  Again, the model prompts the question.  And so on. We can also generate textual facts (or "business rules") directly and algorithmically from the model, according to &lt;a href="http://freespace.virgin.net/scott.finnie/adventures1_en.htm"&gt;the technique described by Simsion and Witt&lt;/a&gt;.  So we'd get:&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(0, 153, 0);font-size:85%;" &gt;&lt;span style="font-family: arial;"&gt;Each Person may own one or more Accounts&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;     Each Account must be owned by just one Customer&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Furthermore, it tells us something about the behaviour, or interaction between Customer and Account.  On first glance it's pretty simple: create a new account, assign it to the owner.  Job done.  But what happens if the Customer goes away?  In typical OO programming terms, that responsibility would lie with the customer:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-size:85%;" &gt;&lt;span style="font-family: arial;"&gt;foreach a in self.accounts:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;        a.delete()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;But why should it belong with the Customer?  The required behaviour arises because of the Relationship: it's not intrinsic to the Customer.  Another case in point is transfer of ownership.  Where does that belong? The Customer?  The Account? No.  It belongs in the relationship.&lt;br /&gt;&lt;br /&gt;So the fun does really happen in the Relationships - thanks Steve and Alistair for enlightening me.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-1148475868786344235?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/1148475868786344235/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=1148475868786344235' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/1148475868786344235'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/1148475868786344235'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2009/03/relationships-are-more-fun.html' title='Relationships are more fun'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_-ehS1ZbM41M/SclWmhk21KI/AAAAAAAAAAY/bh853z2MEAg/s72-c/pointer-based+naming.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-1381690419645268102</id><published>2009-02-23T13:02:00.000-08:00</published><updated>2009-02-23T14:00:23.206-08:00</updated><title type='text'>grails property conundrums</title><content type='html'>Been writing an application using &lt;a href="http://grails.org/"&gt;grails&lt;/a&gt;.  Very nice framework, but as always there's the usual slew of learning curve conundrums.  One in particular had me perplexed (and obsessed) for days.&lt;br /&gt;&lt;br /&gt;I needed a class to hold plans; here it is:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;------------Plan.groovy--------------------- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;class Plan {&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;String name &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;Date startDate &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;Date endDate &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;static hasMany = [tasks : Task] &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;Integer numDays &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;public void setNumDays(Integer numDays) { &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;this.numDays=numDays &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;this.endDate = this.startDate.plus(this.numDays) &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Simple really; only thing remotely out of the ordinary is the setNumDays() method which automatically calculates the end date from the start date and duration.  And here's the corresponding test class:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;import java.text.SimpleDateFormat &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;class PlanTests extends GroovyTestCase { &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;void testDates() { &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def sdf = new SimpleDateFormat("yyyy-MM-dd") &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;def plan = new Plan(name:"test1", &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;startDate: sdf.parse("2009-02-22"), &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;numDays: 7 ) &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//this shouldn't be necessary!?! &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;             &lt;span style="font-weight: bold;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;plan.setNumDays(7)&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;plan.save() &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;assert plan.name == "test1" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;assert plan.startDate == sdf.parse("2009-02-22") &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;assert plan.numDays == 7 &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//Fails without call to setNumDays() above &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="font-weight: bold;"&gt;assert plan.endDate == sdf.parse("2009-03-01")&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;&amp;nbsp;&amp;nbsp;} &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;} &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The strange thing is that without the explicit call to &lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;plan.setNumDays()&lt;/span&gt; the final assertion fails.  This was perplexing.  I tried testing as a native groovy class with accompanying test script; contents exactly as above (minus the &lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;hasMany&lt;/span&gt; in the class and call to &lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;plan.save()&lt;/span&gt; in the test script). This worked without the explicit &lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;setNumDays()&lt;/span&gt; call.&lt;br /&gt;&lt;br /&gt;I tried various things but couldn't get to the bottom of it - until finally I initialised the &lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;startDate&lt;/span&gt; field:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;------------Plan.groovy--------------------- &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;class Plan { &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;  //... &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;  Date startDate &lt;span style="font-weight: bold;"&gt;= new Date()&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;  //...&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt; &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;With that in place the test works without the explicit &lt;span style="color: rgb(51, 51, 255);"&gt;setNumDays()&lt;/span&gt; call. Initial theory was that &lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;numDays&lt;/span&gt; was being set before &lt;span style="color: rgb(51, 51, 255);font-family:courier new;"&gt;startDate&lt;/span&gt; (I had assumed groovy would initialse in the order defined in the &lt;span style="color: rgb(51, 51, 255);font-family:courier new;" &gt;new()&lt;/span&gt; method call - but maybe not).&lt;br /&gt;&lt;br /&gt;However, that doesn't seem to be the case.  It doesn't matter which of the date fields is initialised, as long as at least one of them is.  But it fails if neither is.  Explanation?  I'm really not sure...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-1381690419645268102?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/1381690419645268102/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=1381690419645268102' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/1381690419645268102'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/1381690419645268102'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2009/02/grails-property-conundrums.html' title='grails property conundrums'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-3928092018817801586</id><published>2008-10-09T12:46:00.000-07:00</published><updated>2009-02-03T15:17:27.745-08:00</updated><title type='text'>Good service = profitable customers</title><content type='html'>&lt;a href="http://www.lean-service.com/home.asp"&gt;John Seddon&lt;/a&gt; has &lt;a href="http://www.lean-service.com/6.asp"&gt;written some wonderful stuff &lt;/a&gt;on the application of Lean principles to service organisations.  Of particular note is the link among efficient process, customer experience and cost of operation.  It's a "cake and eat it" situation: efficient processes make for a good customer experience and low operational costs.  Good service also contributes to top line performance: i.e. good service makes for profitable customers.&lt;br /&gt;&lt;br /&gt;I had a perfect counter-example with my ISP this week.  I'm with Virgin, who are generally OK as long as the system is running.  Email has been intermittent recently, and went down again 2 days ago.  I checked the online status page - which informed me everything was OK.  I called the freephone status line which told the same story.  My internet access was up, I could still access gmail, just couldn't get my virgin mail.  So, I thought I'd let them know they had a problem.  I called the reporting line, navigated the IVR forest, eventually arriving at the usual musical entertainment.  After 5 minutes I gave that up and decided to look for electronic submission instead.  Sure enough there's a form to submit, &lt;a href="https://help2.virginmedia.com/assets/customer_zone/emailformCZ.html"&gt;the contents of which are mind-numbing&lt;/a&gt;.  Nevertheless, I persevered.&lt;br /&gt;&lt;br /&gt;I got the usual immediate, automated response telling me they'd look in to my query.  2 days later I got the following message:&lt;br /&gt;&lt;br /&gt;&lt;p  style="margin-bottom: 0pt; margin-top: 0pt; color: rgb(51, 102, 255);font-family:arial;"&gt;&lt;span style="font-size:85%;"&gt;       Thanks for getting in touch with the Virgin Media Support team.     &lt;/span&gt;&lt;/p&gt;     &lt;p  style="margin-bottom: 0pt; margin-top: 0pt; color: rgb(51, 102, 255);font-family:arial;"&gt;            &lt;/p&gt;     &lt;p style="margin-bottom: 0pt; margin-top: 0pt; color: rgb(51, 102, 255); font-family: arial;"&gt;&lt;span style="font-size:85%;"&gt; We're sorry that you are having problems with your e-mails. To help with this we need to get your issue resolved by our colleagues at Virgin.net &lt;/span&gt;&lt;/p&gt;     &lt;p face="arial" style="margin-bottom: 0pt; margin-top: 0pt; color: rgb(51, 102, 255);"&gt;&lt;span style="font-size:85%;"&gt;       In order for your support query to be dealt with efficiently, could you please click on the following link:     &lt;/span&gt;&lt;/p&gt;     &lt;p face="arial" style="margin-bottom: 0pt; margin-top: 0pt; color: rgb(51, 102, 255);"&gt;            &lt;/p&gt;     &lt;p style="margin-bottom: 0pt; margin-top: 0pt; font-family: arial; color: rgb(51, 102, 255);"&gt;       &lt;span style="font-size:85%;"&gt;&lt;a href="http://www.virgin.net/customers/contactus/"&gt;http://www.virgin.net/customers/contactus/&lt;/a&gt;&lt;/span&gt;     &lt;/p&gt;     &lt;p style="margin-bottom: 0pt; margin-top: 0pt; font-family: arial; color: rgb(51, 102, 255);"&gt;            &lt;/p&gt;     &lt;span style="color: rgb(51, 102, 255);font-family:arial;font-size:85%;"  &gt;       This will ensure that the correct team will receive your form.       &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The link points to another page from whence one may submit a query (quite how virgin.net and virgin media differ I have no idea - and to be frank, don't really care).  So it took 2 days to register my complaint, generate a unique ID in their tracking system, and invite me to re-submit my issue.  Why?  I can't say for sure, but I'd stake the combined value of the UK banking system (or the loose change in my pocket, whichever is greater) on the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Virgin's customer service team have targets for responding to customer queries (the website states 48 hours)&lt;/li&gt;&lt;li&gt;My query was edging towards the target, so someone (or something) decided a response was needed.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;So they sent me another stock email that didn't solve my problem, but hey it met the target - so that's good, right?&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;Well, no. It's not actually.  At the start of the debacle I was mildly inconvenienced by the service outage.  Not a major problem.  But now I'm  really irritated.  Not only was the submission form ridiculously over-complicated, I've had 2 pointless, valueless emails from which the only message is "we haven't looked at your mail, but please feel free to re-submit again".&lt;br /&gt;&lt;br /&gt;In other words: "this is a service call.  There's no money to be made from service, so we won't really give it much priority".&lt;br /&gt;&lt;br /&gt;Of course, had I wanted to upgrade my package, I could have called any of the numbers emblazoned on the web site and spoken to someone instantly (I tried, just to make sure).  What Virgin don't seem to get - and they're by no means in a minority - is the influence of service on the customer relationship.  Sales are key: cold calling, outbound marketing, lead generation systems, the list goes on.  Service?  That's a necessary inconvenience.&lt;br /&gt;&lt;br /&gt;How wrong they are.  Good service is a - maybe even &lt;span style="font-style: italic;"&gt;the&lt;/span&gt; - key factor in a customer's propensity to terminate a relationship.  Companies would save a lot more money by keeping their existing customers instead of spending vast resources attracting new ones.   I was reasonably happy with Virgin before this debacle.  I'm now researching alternative ISPs.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Update 3/2/09&lt;/span&gt;: I'm no longer with Virgin.  I found &lt;a href="http://www.ukfsn.org/"&gt;another ISP&lt;/a&gt; who responded quickly and personally to my initial inquiries and were knowledgeable and professional.  They managed the swap without fuss or problem and have been similarly responsive with a couple of service-related queries since.  So good in fact, I recommended them to a friend who has similarly just moved there - from Virgin.  Enough said.  What's more, they're more expensive than Virgin were - considerably more than the reduced rate the Virgin adviser promised me if I stayed put.&lt;br /&gt;&lt;br /&gt;(And final joy of joys: BBC iPlayer now works flawlessly.  Wall to wall Top Gear!)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-3928092018817801586?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/3928092018817801586/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=3928092018817801586' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/3928092018817801586'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/3928092018817801586'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2008/10/good-service-profitable-customers.html' title='Good service = profitable customers'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-800929538576484723</id><published>2008-09-06T13:51:00.000-07:00</published><updated>2008-09-06T14:41:27.080-07:00</updated><title type='text'>Erlang</title><content type='html'>Just bought &lt;a href="http://www.pragprog.com/titles/jaerlang/programming-erlang"&gt;Joe Armstrong's book&lt;/a&gt; on &lt;a href="http://www.erlang.org/"&gt;Erlang&lt;/a&gt; and have started working through it. Erlang's an interesting language: although it's been around for years it's recently seen a sudden rise in popularity.  Why the sudden interest?  Concurrent programming.  Moore's law is disintegrating for single core processors, and multi core/multi-processor machines are seen as the way forward.  For those used to programming in traditional imperative languages (C, C#, Java, ...) multi-threading has always been difficult and error prone.  Erlang was conceived from the beginning to support hundreds, thousands, even millions of concurrent processes, communicating with each other by passing messages.  Armstrong contends this makes concurrency much, much simpler than trying to force it on top of the inherently sequential, shared memory model underpinning imperative languages.&lt;br /&gt;&lt;br /&gt;Erlang is a functional language which, among other things, means it doesn't support mutable state.  'Variables' aren't; once assigned a value, it's not possible to re-assign a variable to a new value.  So variables would be more accurately described as 'immutable single assignment references', although that's admittedly a bit less catchy.&lt;br /&gt;&lt;br /&gt;As someone schooled in mutable state since Amstrad CPC464 basic, that's a violent, disruptive change to the mental model.  In fact, it's a disruptive change for anyone used to observing the world around them as entities with properties that change over time: bank account balances that vary from day to day, people whose age increases every birthday.&lt;br /&gt;&lt;br /&gt;It's a practical problem for functional languages too, since for most any program to be useful it needs to persist or change the state of the world around it.  (That's why Haskell has its monad system).&lt;br /&gt;&lt;br /&gt;Erlang supports programs that need to store, update and use mutable state; it has its own relational database system (Mnesia) which - since it's written in Erlang - is fully ditributable, concurrent and fault tolerant.  Oh, and it doesn't need an object-relational mapping layer either since it's built to work natively with Erlang's type system.&lt;br /&gt;&lt;br /&gt;I'm looking forward to getting into Erlang.  The concurrent, message passing model is very appealing conceptually and offers lots of possibilities in the new multi-core world.  But more than anything else in the book, I'm looking forward to getting my head around marrying the functional model with mutable state.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-800929538576484723?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/800929538576484723/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=800929538576484723' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/800929538576484723'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/800929538576484723'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2008/09/erlang.html' title='Erlang'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-7306143811180321722</id><published>2008-08-22T13:42:00.000-07:00</published><updated>2008-08-22T13:50:41.108-07:00</updated><title type='text'>Textual Input / Graphical Output - the best of both worlds?</title><content type='html'>Textual vs. Graphical representation was a recurring theme at this years &lt;a href="http://www.codegeneration.net/conference/"&gt;Code Generation Conference&lt;/a&gt;.  Thankfully, we seem to have moved beyond the “models are graphical, code is textual” misconception. The discussions were more focused on the relative strengths and weaknesses of each.&lt;br /&gt;&lt;br /&gt;Arno Hasse and Sven Efftinge categorised it really nicely: graphics are best for visualisation, text is best for editing. There's been some work to integrate the two; for example, it's now possible in Eclipse to generate both graphical and textual editors that act on the same underlying model simultaneously. Marcus Volter has also demonstrated generating graphical visualisations automatically from models using a couple of auto-generation tools (graphviz and prefuse).&lt;br /&gt;&lt;br /&gt;Outside of software development tools, this is nothing new: &lt;a href="http://www.autodesk.com/autocad"&gt;Autocad&lt;/a&gt; has for years allowed designers to create drawings with textual commands.  Whilst users can draw directly on the canvas, they can also use a textual dsl enter commands - such as &lt;span style="font-family: courier new;"&gt;lineto(20,100)&lt;/span&gt; - with the results rendered graphically.&lt;br /&gt;&lt;br /&gt;It would be good to think software tooling will catch on to these possibilities - and it looks like &lt;a href="http://www.openarchitectureware.org/"&gt;Openarchitectureware&lt;/a&gt; may be in the vanguard.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-7306143811180321722?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/7306143811180321722/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=7306143811180321722' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/7306143811180321722'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/7306143811180321722'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2008/08/textual-input-graphical-output-best-of.html' title='Textual Input / Graphical Output - the best of both worlds?'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-5748865936469614757</id><published>2008-08-22T13:34:00.000-07:00</published><updated>2008-08-22T13:41:56.906-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='webDSL'/><category scheme='http://www.blogger.com/atom/ns#' term='code generation'/><category scheme='http://www.blogger.com/atom/ns#' term='Eelco Visser'/><title type='text'>WebDSL and the missing abstractions</title><content type='html'>“drinking from the firehose” must be on everyone's buzzword bingo all-time greats list. Nevertheless, it's a very apt description of how I felt in &lt;a href="http://swerl.tudelft.nl/bin/view/EelcoVisser"&gt;Eelco Visser's&lt;/a&gt; talk on &lt;a href="http://webdsl.org/webdslorg/home"&gt;WebDSL&lt;/a&gt; during the &lt;a href="http://www.codegeneration.net/conference/"&gt;code generation 2008 conference&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The core subject matter has been occupying my thoughts in the last few months; there are myriad lightweight web frameworks around now, all of which offer easy definition of the core domain objects and most of which will generate a standard CRUD GUI. All good stuff. But move beyond the auto-generated GUI into something custom and you're on your own. It's down to hacking some form of web template language (JSP/RHTML/Django templates/...) and patching up the link to the domain model through controllers.&lt;br /&gt;&lt;br /&gt;I'd been thinking there must be a better, higher level set of abstractions for describing the UI – which could in turn be mapped onto the underlying technology. WebDSL addresses exactly that problem. At least I think it does. There was so much good stuff in Eelco's talk that I couldn't take it all in. I'll need to dig deeper – but right now it looks promising.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-5748865936469614757?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/5748865936469614757/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=5748865936469614757' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/5748865936469614757'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/5748865936469614757'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2008/08/webdsl-and-missing-abstractions.html' title='WebDSL and the missing abstractions'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-4515579180125069635</id><published>2008-06-27T00:33:00.001-07:00</published><updated>2008-08-22T13:31:31.659-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tiefenbrun'/><category scheme='http://www.blogger.com/atom/ns#' term='code generation'/><title type='text'>Editing Generated code - an anti-pattern?</title><content type='html'>In the 1970s, &lt;a href="http://en.wikipedia.org/wiki/Ivor_Tiefenbrun"&gt;Ivor Tiefenbrun&lt;/a&gt; revolutionised the hi-fi world.  Perceived wisdom held that, since the loudspeakers produced the sound, they were the most important part of the system.  So, for a given budget, the largest portion should be assigned to the speakers.&lt;br /&gt;&lt;br /&gt;Tiefenbrun disagreed.  He believed the most important part was the input.  Since the sound originated from the record (vinyl in those days), the most important component was therefore the turntable.  So he invented the &lt;a href="http://en.wikipedia.org/wiki/Linn_Sondek_LP12"&gt;Linn Sondek&lt;/a&gt;, revolutionising the industry with a product that is still for sale today.&lt;br /&gt;&lt;br /&gt;Tiefenbrun's lesson came to mind at the &lt;a href="http://www.codegeneration.net/conference/"&gt;code generation 2008&lt;/a&gt; conference in Cambridge – stimulating content in a fantastic setting. &lt;br /&gt;&lt;br /&gt;During a discussion in Anneke Kleppe's session, a delegate asked about good practice for editing / modifying / augmenting generated code. The usual solutions came up (&lt;a href="http://www.research.ibm.com/designpatterns/pubs/gg.html"&gt;Generation Gap pattern&lt;/a&gt;, protected blocks) but for me the answer is clear: any kind of modification to the generated code is bad.  It's an anti-pattern, there only because of deficiencies in the input and/or lack of customisation in the generator.  It's often necessary, in many cases simply because the input language doesn't allow the full model to be expressed (this is true for most mainstream UML tools).   But we should be striving to fix the real problem – insufficient or incorrect input – instead of trying to fix the symptom.  We need to apply the 'Tiefenbrun principle'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-4515579180125069635?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/4515579180125069635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=4515579180125069635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/4515579180125069635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/4515579180125069635'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2008/06/editing-generated-code-anti-pattern.html' title='Editing Generated code - an anti-pattern?'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-1270545572130771323</id><published>2008-01-28T12:42:00.000-08:00</published><updated>2008-01-28T13:14:44.220-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Moore'/><category scheme='http://www.blogger.com/atom/ns#' term='Chasm'/><category scheme='http://www.blogger.com/atom/ns#' term='NakedAgilists'/><title type='text'>Agile and the pragmatists</title><content type='html'>I listened to the &lt;a href="http://www.nakedagilists.com/"&gt;Naked Agilists&lt;/a&gt; latest &lt;a href="http://www.nakedagilists.com/node/19"&gt;podcast&lt;/a&gt; the other day.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.nakedagilists.com/jan-08/let-them-eat-cake"&gt;Brian Marick's pitch&lt;/a&gt; in particular sparked my interest.  He compares agile adoption against &lt;a href="http://en.wikipedia.org/wiki/Crossing_the_Chasm"&gt;Geoffrey Moore's technology adoption curve&lt;/a&gt; and observes a discrepancy; namely the seeming &lt;a href="http://www.nakedagilists.com/node/16"&gt;dearth of pragmatists&lt;/a&gt;.   As I listened, a fundamental question immediately sprung to mind:&lt;br /&gt;&lt;br /&gt;- Do we really have a case where the standard curve doesn't fit, or&lt;br /&gt;- Are we looking at the data incorrectly?&lt;br /&gt;&lt;br /&gt;Moore's curve is of course statistical and hence variation is to be expected.  Nevertheless, I can't help wonder if there's something else going on.&lt;br /&gt;&lt;br /&gt;Software projects can be viewed in terms of 4 dimensions: cost, time, quality and function (per e.g. Kent Beck in "Extreme Programming").  The software industry can also be split roughly into IT and Product Development (PD) - the difference being that IT delivers solutions for use within a business; product development builds products that are sold to the market.&lt;br /&gt;&lt;br /&gt;I've worked in and/or experienced a variety of both IT and PD companies.  Despite both being ostensibly focused on software delivery, there are some notable differences.   In particular, there seems to a different bias on the 4 project dimensions:&lt;br /&gt;&lt;br /&gt;- IT seems to focus more on cost and schedule;&lt;br /&gt;- PD tends to focus more on function and quality.&lt;br /&gt;&lt;br /&gt;I've some theories about why that might be, but will save for later - it's not relevant here.  The interesting question is whether this difference in any way explains Brian's observation.&lt;br /&gt;&lt;br /&gt;Here's my thoughts:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; Agile primarily manages delivery of working software --&gt; focuses on function &amp;amp; quality over cost &amp;amp; schedule&lt;/li&gt;&lt;li&gt;IT projects are often implementations of purchased products&lt;/li&gt;&lt;li&gt;The majority of Agile use is associated with building systems rather than implementing products&lt;/li&gt;&lt;li&gt; IT is generally more conservative than PD&lt;/li&gt;&lt;/ul&gt;Therefore:&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;span style="font-weight: bold;"&gt;Agile's lack of penetration into the pragmatist market is a consequence of the increased &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;IT &lt;/span&gt;&lt;span style="font-weight: bold;"&gt;representation in that segment.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;Some observations arising from that assertion:&lt;br /&gt;&lt;ul&gt;&lt;li&gt; What would the curves look like if we separated IT &amp;amp; PD?  My gut feeling is each would more or less follow Moore's model.  Agile probably has crossed the chasm for PD; and the size of the segment is probably in line with Moore's curve.  Agile in IT is however much earlier in the lifecycle, and crucially hasn't crossed the chasm yet.&lt;/li&gt;&lt;li&gt;For agile to cross the IT chasm, two things are required:&lt;/li&gt;&lt;ol&gt;&lt;li&gt;    There needs to be much more support for agile product implementation to complement that for agile system building&lt;/li&gt;&lt;li&gt;It needs to be presented in a way that resonates with people whose primary focus is cost and schedule over function and quality.  That means IT project/programme managers brought up on a diet of MS Project and interpreting PRINCE2 as a waterfall process.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/ul&gt;I'm aware the assertions above are based on a very narrow - and therefore statistically insufficient - sample.  I know, for example, of at least two IT organisations locally who've embraced agile principles. Thoughts and comments welcome.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-1270545572130771323?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/1270545572130771323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=1270545572130771323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/1270545572130771323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/1270545572130771323'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2008/01/agile-and-pragmatists.html' title='Agile and the pragmatists'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-595651711960625596.post-2420921032843887812</id><published>2007-07-21T12:39:00.000-07:00</published><updated>2007-07-21T15:01:19.818-07:00</updated><title type='text'>UML vs. Domain-Specific Languages - a false dichotomy?</title><content type='html'>I have just listened to the &lt;a href="http://www.codegeneration.net/audio/cgn-episode1.mp3"&gt;panel discussion&lt;/a&gt; at &lt;a href="http://www.codegeneration.net/cg2007/index.php"&gt;code generation 2007&lt;/a&gt; entitled   &lt;a href="http://www.codegeneration.net/cg2007/sessioninfo.php?session=watson"&gt;UML vs. Domain-Specific Languages - a false dichotomy?&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It's very interesting.  The panel includes some very well known luminaries from the modelling world (e.g &lt;a href="http://blogs.msdn.com/stevecook/"&gt;Steve Cook&lt;/a&gt;) and some less well know but equally capable (such as Tony Clarke of &lt;a href="http://www.xactium.com/"&gt;xactium&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;Perhaps the heart of the discussion is given over to the subject of modelling versus programming languages.  This is something I've come across in various contexts, where the following views are not uncommon:&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;ul&gt;&lt;li&gt;"Modelling languages are for drawing pictures, you build software with programming languages"&lt;/li&gt;&lt;li&gt;"If it's graphical, it's a modelling language; programming languages are textual"&lt;/li&gt;&lt;/ul&gt;Both views are as understandable as they are wrong.  Promulgating them is perhaps the most heinous crime of the uml juggernaut.  Even today, &lt;a href="http://www.booch.com/"&gt;Grady Booch&lt;/a&gt; - one of the uml's originators - maintains it should be used for sketching things out; clarifying your thoughts before writing code.  There are plenty of others who also support the view (e.g. &lt;a href="http://www.ambysoft.com/scottAmbler.html"&gt;Scott Ambler&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;As a result the majority body of opinion equates uml - and therefore graphical notation - with sketches.  Something that precedes the real work (coding).&lt;br /&gt;&lt;br /&gt;That's a great shame - and baseless.  In other industries (mechanical engineering and construction for example) graphical notations are standard.  Not for sketching, but as the normative specification.  The code if you like.&lt;br /&gt;&lt;br /&gt;Graphical notations can be used in software too.  Some &lt;a href="http://www.projtech.com"&gt;companies&lt;/a&gt; have formalised a subset of the uml into a language that is precise, executable and graphical.  Conversely this post is textual - but definitely not executable.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;Abstract Syntax, Concrete Syntax and Semantics&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;UML 2.0 wasn't all bad.  One of the good things it popularised was a way to look at languages as consisting of three parts: abstract syntax, concrete syntax and semantics.  (I prefer to name them concepts, representations and meanings, but that's personal preference):&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Concepts&lt;/span&gt; (or Abstract Syntax) are the things we want to talk about: 'Cars', 'Accounts', 'Dogs', 'Equations', whatever.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Representations&lt;/span&gt; (or Concrete Syntax) are how we depict those concepts; textual, graphical, aural, olfactory...&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Meanings&lt;/span&gt; (Semantics) are, well, what we mean when we discuss concepts.&lt;/li&gt;&lt;/ul&gt;It's often difficult to separate representation from concept, since we can only communicate concepts by giving them representation.  Using different representations for the same concepts is so intrinsic to our way of life we don't even notice it.  (Imagine the confusion if we didn't know the sound 'car' referred to the same concept as the word 'car'). &lt;br /&gt;&lt;br /&gt;But analysing languages in terms of their concepts, representations and meaning provides a useful framework for classifying languages.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;So is UML vs DSLs a false dichotomy?&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Let's consider it from the 3 perspectives.&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Concepts&lt;/span&gt;.  At its (most useful) core, the uml is intended for describing concepts, their relationships and behaviour.  So &lt;span style="font-style: italic;"&gt;its&lt;/span&gt; concepts - classes, relationships, states, events, etc. - are those useful for describing &lt;span style="font-style: italic;"&gt;other&lt;/span&gt; concepts.  The concepts in a DSL are, by definition, specific to the domain in question.  So perhaps Dogs, Breeds and Owners in the domain of pedigree competition.  Is that a dichotomy?  No.  Just a different focus.  In fact the raison d'etre of UML's core is to &lt;span style="font-style: italic;"&gt;enable&lt;/span&gt; description of other domains.  The uml is, in effect, a DSL for describing other domains.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Representations&lt;/span&gt;.  UML ascribes a graphical notation to many of its concepts - perhaps most obviously the boxes and lines in class diagrams or state charts.  Many would argue - and with good cause - this is in fact the most useful thing about UML.  DSLs usually enable a representation appropriate for the domain.  It might be graphical (perhaps  an image for each dog appropriate to its breed), symbolic (the extended alphabet used in mathematical equations) - whatever suits the problem.  Is that a dichotomy?  Again, no.   However it does expose a limitation in UML, in that it doesn't explicitly allow for representations to be ascribed to concepts described in a UML model.&lt;/li&gt;&lt;li&gt;&lt;span style="font-weight: bold;"&gt;Meaning&lt;/span&gt;.  The semantics of UML is a subject of life study, not a paragraph in a blog.  Despite its supposed formalisation, UML does not have a precise semantics in any useful meaning of the term.  That belies its origins as a sketching tool.   While some have divined a precise subset it's been done despite the language rather than because of it.  DSLs, by comparison, assume that the results of modelling will be machine processed: translated into some other executable form or interpreted directly.  Is that a dichotomy?  Fundamentally yes.  Those are two very different philosophies.&lt;/li&gt;&lt;/ul&gt;So UML and DSLs do share significant properties.  DSLs extend UML in their support for domain specific representation, but it's an extension rather than a conflict.  Were UML to allow the assignment of domain-specific notation to the models this difference would disappear.&lt;br /&gt;&lt;br /&gt;Where the two fundamentally differ is on semantics.  As long as the majority influence on UML supports the standpoint of a sketching toolkit, the dichotomy will remain.  There will continue to be those who provide a formal semantics for some subset of uml and in such cases there is no real dichotomy; however those are the exception and not the rule.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/595651711960625596-2420921032843887812?l=randomcognition.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://randomcognition.blogspot.com/feeds/2420921032843887812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=595651711960625596&amp;postID=2420921032843887812' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/2420921032843887812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/595651711960625596/posts/default/2420921032843887812'/><link rel='alternate' type='text/html' href='http://randomcognition.blogspot.com/2007/07/uml-vs-domain-specific-languages-false.html' title='UML vs. Domain-Specific Languages - a false dichotomy?'/><author><name>Scoot</name><uri>http://www.blogger.com/profile/06206423293021083794</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
