<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0">
  <channel>
    <title>Rockford Lhotka - Programming</title>
    <link>http://www.lhotka.net/weblog/</link>
    <description>Creator of the CSLA .NET framework</description>
    <language>en-us</language>
    <copyright>Marimer LLC</copyright>
    <lastBuildDate>Wed, 10 Apr 2013 18:04:39 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>rocky@lhotka.net</managingEditor>
    <webMaster>rocky@lhotka.net</webMaster>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=9c521269-1f6d-4944-8957-dc56a7d7b2ce</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,9c521269-1f6d-4944-8957-dc56a7d7b2ce.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,9c521269-1f6d-4944-8957-dc56a7d7b2ce.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=9c521269-1f6d-4944-8957-dc56a7d7b2ce</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was recently confronted by an odd bit of reality, about which I thought I’d vent
a little.
</p>
        <p>
I am the creator and owner of a widely used open source project (CSLA .NET) that has
(in one form or another) been around since 1996. If you want an example of an open
source project with longevity, CSLA .NET ranks right up there.
</p>
        <p>
And CSLA is “true” open source, in that it uses a liberal and non-viral license, and
there’s no commercial option (a lot of OSS projects use a viral license as a “poison
pill” to drive any real use of the project to a paid commercial license that <em>isn’t</em> free
as in beer or speech).
</p>
        <p>
Recently at a conference I and some colleagues were presenting on some development
techniques and patterns, and the code makes use of several open source projects –
including CSLA.
</p>
        <p>
Oddly this was a source of blow-back from some in the audience, who thought the talk
was “overly commercial”.
</p>
        <p>
Apparently talking about <em>other people’s</em> free open source products are fine,
but if you talk about your own then that’s commercial?
</p>
        <p>
And for that matter, how can it be commercial if you are talking about software that
is free as in beer and speech? If anything, FOSS is <em>anti-commercial</em> by its
very definition…
</p>
        <p>
It would seem, by this ‘logic’, that the primary experts on any given OSS project
should not talk about their project, but should instead talk about tools they might
use, but don’t actually create or build.
</p>
        <p>
In other words, people attending conferences should never get the best or most direct
insight into <em>any</em> OSS product, because presentations by the people who create
that product would be somehow “too commercial” if they talk about the stuff they’ve
built.
</p>
        <p>
So much for learning about Linux from Linux developers, or jquery from jquery developers,
etc.
</p>
        <p>
Obviously that’s all pretty dumb, and similarly I suspect the majority of the people
at this conference (or any conference) don’t feel this way and do want the highest
quality information they can get.
</p>
        <p>
I think the <em>real</em> issue here is that some reasonable number of people just
don’t understand open source.
</p>
        <p>
A lot of people (especially in the Microsoft dev space) have never knowingly used
open source – living entirely within the realm of products provided by Microsoft and
component vendors.
</p>
        <p>
(whether these people have <em>actually</em> used open source is another matter –
and odds are they have unwittingly used things like jquery, ASP.NET, Entity Framework,
MVVM Light, Subversion, git, etc.)
</p>
        <p>
I only bother blogging about this because over the past couple years it has become
virtually impossible to create any modern app without the use of some open source
products.
</p>
        <p>
I can’t imagine anyone building a modern web site or page without some OSS products.
Much less a <em>web app</em> that’ll be based almost entirely on OSS products.
</p>
        <p>
Similarly, it is hard to imagine building a XAML app without the use of at least one
OSS MVVM framework.
</p>
        <p>
And the same is true with unit testing, mocking, etc.
</p>
        <p>
In short, the best tools available today are probably open source, and if you aren’t
using them then you are depriving yourself and your employer of the best options out
there.
</p>
        <p>
What this means imo, is that people who think talking about your own open source product
is “too commercial” had better grow up and get a clue pretty fast, or they’ll be finding <em>everything</em> to
be too commercial…
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=9c521269-1f6d-4944-8957-dc56a7d7b2ce" />
      </body>
      <title>Talking about your own open source project</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,9c521269-1f6d-4944-8957-dc56a7d7b2ce.aspx</guid>
      <link>http://www.lhotka.net/weblog/TalkingAboutYourOwnOpenSourceProject.aspx</link>
      <pubDate>Wed, 10 Apr 2013 18:04:39 GMT</pubDate>
      <description>&lt;p&gt;
I was recently confronted by an odd bit of reality, about which I thought I’d vent
a little.
&lt;/p&gt;
&lt;p&gt;
I am the creator and owner of a widely used open source project (CSLA .NET) that has
(in one form or another) been around since 1996. If you want an example of an open
source project with longevity, CSLA .NET ranks right up there.
&lt;/p&gt;
&lt;p&gt;
And CSLA is “true” open source, in that it uses a liberal and non-viral license, and
there’s no commercial option (a lot of OSS projects use a viral license as a “poison
pill” to drive any real use of the project to a paid commercial license that &lt;em&gt;isn’t&lt;/em&gt; free
as in beer or speech).
&lt;/p&gt;
&lt;p&gt;
Recently at a conference I and some colleagues were presenting on some development
techniques and patterns, and the code makes use of several open source projects –
including CSLA.
&lt;/p&gt;
&lt;p&gt;
Oddly this was a source of blow-back from some in the audience, who thought the talk
was “overly commercial”.
&lt;/p&gt;
&lt;p&gt;
Apparently talking about &lt;em&gt;other people’s&lt;/em&gt; free open source products are fine,
but if you talk about your own then that’s commercial?
&lt;/p&gt;
&lt;p&gt;
And for that matter, how can it be commercial if you are talking about software that
is free as in beer and speech? If anything, FOSS is &lt;em&gt;anti-commercial&lt;/em&gt; by its
very definition…
&lt;/p&gt;
&lt;p&gt;
It would seem, by this ‘logic’, that the primary experts on any given OSS project
should not talk about their project, but should instead talk about tools they might
use, but don’t actually create or build.
&lt;/p&gt;
&lt;p&gt;
In other words, people attending conferences should never get the best or most direct
insight into &lt;em&gt;any&lt;/em&gt; OSS product, because presentations by the people who create
that product would be somehow “too commercial” if they talk about the stuff they’ve
built.
&lt;/p&gt;
&lt;p&gt;
So much for learning about Linux from Linux developers, or jquery from jquery developers,
etc.
&lt;/p&gt;
&lt;p&gt;
Obviously that’s all pretty dumb, and similarly I suspect the majority of the people
at this conference (or any conference) don’t feel this way and do want the highest
quality information they can get.
&lt;/p&gt;
&lt;p&gt;
I think the &lt;em&gt;real&lt;/em&gt; issue here is that some reasonable number of people just
don’t understand open source.
&lt;/p&gt;
&lt;p&gt;
A lot of people (especially in the Microsoft dev space) have never knowingly used
open source – living entirely within the realm of products provided by Microsoft and
component vendors.
&lt;/p&gt;
&lt;p&gt;
(whether these people have &lt;em&gt;actually&lt;/em&gt; used open source is another matter –
and odds are they have unwittingly used things like jquery, ASP.NET, Entity Framework,
MVVM Light, Subversion, git, etc.)
&lt;/p&gt;
&lt;p&gt;
I only bother blogging about this because over the past couple years it has become
virtually impossible to create any modern app without the use of some open source
products.
&lt;/p&gt;
&lt;p&gt;
I can’t imagine anyone building a modern web site or page without some OSS products.
Much less a &lt;em&gt;web app&lt;/em&gt; that’ll be based almost entirely on OSS products.
&lt;/p&gt;
&lt;p&gt;
Similarly, it is hard to imagine building a XAML app without the use of at least one
OSS MVVM framework.
&lt;/p&gt;
&lt;p&gt;
And the same is true with unit testing, mocking, etc.
&lt;/p&gt;
&lt;p&gt;
In short, the best tools available today are probably open source, and if you aren’t
using them then you are depriving yourself and your employer of the best options out
there.
&lt;/p&gt;
&lt;p&gt;
What this means imo, is that people who think talking about your own open source product
is “too commercial” had better grow up and get a clue pretty fast, or they’ll be finding &lt;em&gt;everything&lt;/em&gt; to
be too commercial…
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=9c521269-1f6d-4944-8957-dc56a7d7b2ce" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,9c521269-1f6d-4944-8957-dc56a7d7b2ce.aspx</comments>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=6347a28f-bd78-4299-9f7b-1f946edcd747</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,6347a28f-bd78-4299-9f7b-1f946edcd747.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,6347a28f-bd78-4299-9f7b-1f946edcd747.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=6347a28f-bd78-4299-9f7b-1f946edcd747</wfw:commentRss>
      <slash:comments>10</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In 1991 I was a DEC VAX programmer. A very happy one, because OpenVMS was a wonderful
operating system and I knew it inside and out. The only problem was that the “clients”
were dumb VT terminals, and it was terribly easy to become resource constrained by
having all the CPU, memory, and IO processing in a central location.
</p>
        <p>
This was the time when Windows NT came along (this new OS created by the same person
who created OpenVMS btw) and demonstrated that PCs were more than toys – that they
could be considered real computers. (yes, this is my editorial view <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/Future-of-the-smart-client_8098/wlEmoticon-smile_2.png" /> )
</p>
        <p>
From that time forward my personal interest in software has been expressed entirely
via distributed computing. Sure, I’ve built some server-only and some client-only
software over the past 22 years, but that was just to pay the bills. What is <em>interesting</em> is
building software systems where various parts of the system run on different computers,
working together toward a common goal. That’s fun!!
</p>
        <p>
This type of software system implies a smart client. I suppose a smart client isn’t
strictly <em>necessary</em>, but it is surely ideal. Because most software interacts
with humans at some point, a smart client is ideal because that’s how you provide
the human with the best possible experience. Obviously you can use a VT terminal or
a basic HTML browser experience to provide this human interface, but that’s not <em>nearly</em> as
rich or powerful as a smart client experience.
</p>
        <p>
For the past couple decades the default and dominant smart client experience has been
expressed through Windows. With smart client software written primarily in VB, PowerBuilder,
and .NET (C#/VB).
</p>
        <p>
The thing is, I am entirely convinced that our industry is at a major inflection point.
At least as big as the one in the mid-1990’s when we shifted from mainframe/minicomputer
to PC, and when n-tier became viable, and when the infant web became mainstream.
</p>
        <p>
Prior to the mid-1990’s computing was chaos. There were many types of mainframe and
minicomputer, and none were compatible with each other. Even the various flavors of
Unix weren’t really compatible with each other… Software developers tended to specialize
in a platform, and it took non-trivial effort to retool to another platform – at least
if you wanted to be really good.
</p>
        <p>
Over the past couple decades we’ve been spoiled by having essentially one platform:
Windows. Regardless of whether you use VB, PowerBuilder, .NET, or Java, almost everyone
knows Windows and how to build software for this one nearly-universal platform.
</p>
        <p>
Now we’ve chosen to return to chaos. Windows is still sort of dominant, but it shares
a lot of mindshare with iOS, OS X, Android, and ChromeOS. We appear to be heading
rapidly into an environment more like the late 1980’s. An environment composed of
numerous incompatible platforms, all of which are viable, none of which are truly
dominant.
</p>
        <p>
There is one difference this time though: JavaScript.
</p>
        <p>
Please don’t get me wrong, I’m not a rah-rah supporter of js. I am <em>extremely</em> skeptical
of cross-platform technologies, having seen countless such technologies crash and
burn over the past 25+ years.
</p>
        <p>
But there’s an <em>economic</em> factor that comes to bear as well as technical factors.
Unlike in the late 1980’s when computing was important but not critical to the world
at large, today computing <em>is critical to the world at large</em>. Individuals
and organizations can not function at the levels of productivity we’re used to without
computing and automation.
</p>
        <p>
In other words, in the late 1980’s we could afford to be highly inefficient. We could
afford to have a fragmented developer space, split by myriad incompatible platforms.
</p>
        <p>
Today the cost of such inefficiency is much higher. I suspect it is too high to be
acceptable. Think about your organization. Can you afford to build every client app
3-6 times? Will your board of directors or company owner accept that kind of increase
in the IT budget?
</p>
        <p>
Or can you afford to pick just one platform (iOS, Windows, whatever) and tell all
your employees and partners that you only work with that one type of device/OS?
</p>
        <p>
(btw, that’s what we’ve done for the past 20 years – we just tell everyone it is Windows
or nothing, and that’s been working well – so such a move isn’t out of the question)
</p>
        <p>
Let’s assume your organization can’t afford a massive increase in its IT budget to
hire the dev/support staff to build and maintain every app 3-6 times. And let’s assume
we collectively decide to embrace every random device/OS that comes along (BYOD).
What then?
</p>
        <p>
I suggest there are two options:
</p>
        <ol>
          <li>
Return to a terminal-based model where the client device is a dumb as possible, probably
using basic HTML – to which I say BORING! (and awful!)</li>
          <li>
Find a common technology for building smart client apps that works reasonably well
on most device/OS combinations</li>
        </ol>
        <p>
Personally I am entirely uninterested in option 1. As I said, I spent the early part
of my career in the minicomputer-terminal world, so I’ve been there and done that.
Boring.
</p>
        <p>
The only technology that looks even remotely capable of supporting option 2 is JavaScript.
</p>
        <p>
Is that a silver bullet? Is it painless? Clearly not. Even if you ignore all the bad
bits of js and stick with <a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/">JavaScript:
The Good Parts</a> it is still pretty messy.
</p>
        <p>
However, VB 1, 2, and 3 were also pretty immature and messy. But a lot of us stuck
with those products, pushing for (and getting) improvements that ultimately made VB6
the most popular development tool of its time – for apps small and big (enterprise).
</p>
        <p>
So sure, js is (by modern standards) immature and messy. But if the broader business
development community sees it as the only viable technology going forward that’ll
bring a lot of attention and money into the js world. That attention and money will
drive maturity, probably quite rapidly.
</p>
        <p>
OK, so probably not maturity of js itself, because it is controlled by a standards
body and so it changes at a glacial pace.
</p>
        <p>
But maturity of tooling (look at the amazing stuff Microsoft is doing in VS for js
tooling, as well as TypeScript), and libraries, and standards. That’ll be the avenue
by which js becomes viable for smart client development.
</p>
        <p>
If it isn’t clear btw, I am increasingly convinced that (like it or not) this is where
we’re headed. We have a few more years of Windows as the dominant enterprise client
OS, but given what Microsoft is doing with Windows 8 it is really hard to see how
Windows will remain dominant in that space. Not that any one single device/OS will
displace Windows – but rather that <em>chaos</em> will displace Windows.
</p>
        <p>
As a result, barring someone inventing a better cross-platform technology (and I’d
love to see that happen!!), js is about to get hit by a lot of professional business
developers who’ll demand more maturity, stability, and productivity than exists today.
</p>
        <p>
This is going to be a fun ride!
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=6347a28f-bd78-4299-9f7b-1f946edcd747" />
      </body>
      <title>Future of the smart client</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,6347a28f-bd78-4299-9f7b-1f946edcd747.aspx</guid>
      <link>http://www.lhotka.net/weblog/FutureOfTheSmartClient.aspx</link>
      <pubDate>Thu, 04 Apr 2013 14:44:57 GMT</pubDate>
      <description>&lt;p&gt;
In 1991 I was a DEC VAX programmer. A very happy one, because OpenVMS was a wonderful
operating system and I knew it inside and out. The only problem was that the “clients”
were dumb VT terminals, and it was terribly easy to become resource constrained by
having all the CPU, memory, and IO processing in a central location.
&lt;/p&gt;
&lt;p&gt;
This was the time when Windows NT came along (this new OS created by the same person
who created OpenVMS btw) and demonstrated that PCs were more than toys – that they
could be considered real computers. (yes, this is my editorial view &lt;img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/Future-of-the-smart-client_8098/wlEmoticon-smile_2.png" /&gt; )
&lt;/p&gt;
&lt;p&gt;
From that time forward my personal interest in software has been expressed entirely
via distributed computing. Sure, I’ve built some server-only and some client-only
software over the past 22 years, but that was just to pay the bills. What is &lt;em&gt;interesting&lt;/em&gt; is
building software systems where various parts of the system run on different computers,
working together toward a common goal. That’s fun!!
&lt;/p&gt;
&lt;p&gt;
This type of software system implies a smart client. I suppose a smart client isn’t
strictly &lt;em&gt;necessary&lt;/em&gt;, but it is surely ideal. Because most software interacts
with humans at some point, a smart client is ideal because that’s how you provide
the human with the best possible experience. Obviously you can use a VT terminal or
a basic HTML browser experience to provide this human interface, but that’s not &lt;em&gt;nearly&lt;/em&gt; as
rich or powerful as a smart client experience.
&lt;/p&gt;
&lt;p&gt;
For the past couple decades the default and dominant smart client experience has been
expressed through Windows. With smart client software written primarily in VB, PowerBuilder,
and .NET (C#/VB).
&lt;/p&gt;
&lt;p&gt;
The thing is, I am entirely convinced that our industry is at a major inflection point.
At least as big as the one in the mid-1990’s when we shifted from mainframe/minicomputer
to PC, and when n-tier became viable, and when the infant web became mainstream.
&lt;/p&gt;
&lt;p&gt;
Prior to the mid-1990’s computing was chaos. There were many types of mainframe and
minicomputer, and none were compatible with each other. Even the various flavors of
Unix weren’t really compatible with each other… Software developers tended to specialize
in a platform, and it took non-trivial effort to retool to another platform – at least
if you wanted to be really good.
&lt;/p&gt;
&lt;p&gt;
Over the past couple decades we’ve been spoiled by having essentially one platform:
Windows. Regardless of whether you use VB, PowerBuilder, .NET, or Java, almost everyone
knows Windows and how to build software for this one nearly-universal platform.
&lt;/p&gt;
&lt;p&gt;
Now we’ve chosen to return to chaos. Windows is still sort of dominant, but it shares
a lot of mindshare with iOS, OS X, Android, and ChromeOS. We appear to be heading
rapidly into an environment more like the late 1980’s. An environment composed of
numerous incompatible platforms, all of which are viable, none of which are truly
dominant.
&lt;/p&gt;
&lt;p&gt;
There is one difference this time though: JavaScript.
&lt;/p&gt;
&lt;p&gt;
Please don’t get me wrong, I’m not a rah-rah supporter of js. I am &lt;em&gt;extremely&lt;/em&gt; skeptical
of cross-platform technologies, having seen countless such technologies crash and
burn over the past 25+ years.
&lt;/p&gt;
&lt;p&gt;
But there’s an &lt;em&gt;economic&lt;/em&gt; factor that comes to bear as well as technical factors.
Unlike in the late 1980’s when computing was important but not critical to the world
at large, today computing &lt;em&gt;is critical to the world at large&lt;/em&gt;. Individuals
and organizations can not function at the levels of productivity we’re used to without
computing and automation.
&lt;/p&gt;
&lt;p&gt;
In other words, in the late 1980’s we could afford to be highly inefficient. We could
afford to have a fragmented developer space, split by myriad incompatible platforms.
&lt;/p&gt;
&lt;p&gt;
Today the cost of such inefficiency is much higher. I suspect it is too high to be
acceptable. Think about your organization. Can you afford to build every client app
3-6 times? Will your board of directors or company owner accept that kind of increase
in the IT budget?
&lt;/p&gt;
&lt;p&gt;
Or can you afford to pick just one platform (iOS, Windows, whatever) and tell all
your employees and partners that you only work with that one type of device/OS?
&lt;/p&gt;
&lt;p&gt;
(btw, that’s what we’ve done for the past 20 years – we just tell everyone it is Windows
or nothing, and that’s been working well – so such a move isn’t out of the question)
&lt;/p&gt;
&lt;p&gt;
Let’s assume your organization can’t afford a massive increase in its IT budget to
hire the dev/support staff to build and maintain every app 3-6 times. And let’s assume
we collectively decide to embrace every random device/OS that comes along (BYOD).
What then?
&lt;/p&gt;
&lt;p&gt;
I suggest there are two options:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Return to a terminal-based model where the client device is a dumb as possible, probably
using basic HTML – to which I say BORING! (and awful!)&lt;/li&gt;
&lt;li&gt;
Find a common technology for building smart client apps that works reasonably well
on most device/OS combinations&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Personally I am entirely uninterested in option 1. As I said, I spent the early part
of my career in the minicomputer-terminal world, so I’ve been there and done that.
Boring.
&lt;/p&gt;
&lt;p&gt;
The only technology that looks even remotely capable of supporting option 2 is JavaScript.
&lt;/p&gt;
&lt;p&gt;
Is that a silver bullet? Is it painless? Clearly not. Even if you ignore all the bad
bits of js and stick with &lt;a href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/"&gt;JavaScript:
The Good Parts&lt;/a&gt; it is still pretty messy.
&lt;/p&gt;
&lt;p&gt;
However, VB 1, 2, and 3 were also pretty immature and messy. But a lot of us stuck
with those products, pushing for (and getting) improvements that ultimately made VB6
the most popular development tool of its time – for apps small and big (enterprise).
&lt;/p&gt;
&lt;p&gt;
So sure, js is (by modern standards) immature and messy. But if the broader business
development community sees it as the only viable technology going forward that’ll
bring a lot of attention and money into the js world. That attention and money will
drive maturity, probably quite rapidly.
&lt;/p&gt;
&lt;p&gt;
OK, so probably not maturity of js itself, because it is controlled by a standards
body and so it changes at a glacial pace.
&lt;/p&gt;
&lt;p&gt;
But maturity of tooling (look at the amazing stuff Microsoft is doing in VS for js
tooling, as well as TypeScript), and libraries, and standards. That’ll be the avenue
by which js becomes viable for smart client development.
&lt;/p&gt;
&lt;p&gt;
If it isn’t clear btw, I am increasingly convinced that (like it or not) this is where
we’re headed. We have a few more years of Windows as the dominant enterprise client
OS, but given what Microsoft is doing with Windows 8 it is really hard to see how
Windows will remain dominant in that space. Not that any one single device/OS will
displace Windows – but rather that &lt;em&gt;chaos&lt;/em&gt; will displace Windows.
&lt;/p&gt;
&lt;p&gt;
As a result, barring someone inventing a better cross-platform technology (and I’d
love to see that happen!!), js is about to get hit by a lot of professional business
developers who’ll demand more maturity, stability, and productivity than exists today.
&lt;/p&gt;
&lt;p&gt;
This is going to be a fun ride!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=6347a28f-bd78-4299-9f7b-1f946edcd747" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,6347a28f-bd78-4299-9f7b-1f946edcd747.aspx</comments>
      <category>h5js</category>
      <category>JavaScript</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=c61fd797-16f7-4f5f-a6fc-226f235b132a</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,c61fd797-16f7-4f5f-a6fc-226f235b132a.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,c61fd797-16f7-4f5f-a6fc-226f235b132a.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=c61fd797-16f7-4f5f-a6fc-226f235b132a</wfw:commentRss>
      <slash:comments>9</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
There are three fairly popular presentation layer design patterns that I collectively
call the “M” patterns: MVC, MVP, and MVVM. This is because they all have an “M” standing
for “Model”, plus some other constructs.
</p>
        <p>
The thing with all of these “M” patterns is that for typical developers the patterns
are useless without a framework. Using the patterns without a framework almost always
leads to confusion, complication, high costs, frustration, and ultimately despair.
</p>
        <p>
These are just patterns after all, not implementations. And they are big, complex
patterns that include quite a few concepts that must work together correctly to enable
success.
</p>
        <p>
You can’t sew a fancy dress just because you have a pattern. You need appropriate
tools, knowledge, and experience. The same is true with these complex “M” patterns. 
</p>
        <p>
And if you want to repeat the process of sewing a fancy dress over and over again
(efficiently), you need specialized tooling for this purpose. In software terms this
is a framework.
</p>
        <p>
Trying to do something like MVVM without a framework is a huge amount of work. Tons
of duplicate code, reinventing the wheel, and retraining people to think differently.
</p>
        <p>
At least with a framework you avoid the duplicate code and hopefully don’t have to
reinvent the wheel – allowing you to focus on retraining people. The retraining part
is generally unavoidable, but a framework provides plumbing code and structure, making
the process easier.
</p>
        <p>
You might ask yourself why the MVC pattern only became popular in ASP.NET a few short
years ago. The pattern has existed since (at least) the mid-1990’s, and yet few people
used it, and even fewer used it successfully. This includes people on other platforms
too, at least up to the point that those platforms included well-implemented MVC frameworks.
</p>
        <p>
Strangely, MVC only started to become mainstream in the Microsoft world when ASP.NET
MVC showed up. This is a comprehensive framework with tooling integrated into Visual
Studio. As a result. typical developers can just build models, views, and controllers.
Prior to that point they also had to build everything the MVC framework does – which
is a lot of code. And not just a lot of code, but code that has absolutely nothing
to do with business value, and only relates to implementation of the pattern itself.
</p>
        <p>
We’re in the same situation today with MVVM in WPF, Silverlight, Windows Phone, and
Windows Runtime (WinRT in Windows 8). If you want to do MVVM without a framework,
you will have to build everything a framework would do – which is a lot of code that
provides absolutely no direct business value.
</p>
        <p>
Typical developers really do want to focus on building models, views, and viewmodels.
They don’t want to have to build weak reference based event routers, navigation models,
view abstractions, and all the other things a framework must do. In fact, most developers
probably <em>can’t </em>build those things, because they aren’t platform/framework
wonks. It takes a special kind of passion (or craziness) to learn the deep, highly
specialized techniques and tricks necessary to build a framework like this.
</p>
        <p>
What I really <i>wish</i> would happen, is for Microsoft to build an MVVM framework
comparable to ASP.NET MVC. Embed it into the .NET/XAML support for WinRT/Metro, and
include tooling in VS so we can right-click and add views and viewmodels. Ideally
this would be an open, iterative process like ASP.NET MVC has been – so after a few
years the framework reflects the smartest thoughts from Microsoft and from the community
at large.
</p>
        <p>
In the meantime, <a href="http://caliburnmicro.codeplex.com/">Caliburn Micro</a> appears
to be the best MVVM framework out there – certainly the most widely used. Probably
followed by various implementations using PRISM, and then MVVM Light, and some others.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=c61fd797-16f7-4f5f-a6fc-226f235b132a" />
      </body>
      <title>Using the MVVM pattern requires a framework</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,c61fd797-16f7-4f5f-a6fc-226f235b132a.aspx</guid>
      <link>http://www.lhotka.net/weblog/UsingTheMVVMPatternRequiresAFramework.aspx</link>
      <pubDate>Mon, 07 May 2012 20:01:55 GMT</pubDate>
      <description>&lt;p&gt;
There are three fairly popular presentation layer design patterns that I collectively
call the “M” patterns: MVC, MVP, and MVVM. This is because they all have an “M” standing
for “Model”, plus some other constructs.
&lt;/p&gt;
&lt;p&gt;
The thing with all of these “M” patterns is that for typical developers the patterns
are useless without a framework. Using the patterns without a framework almost always
leads to confusion, complication, high costs, frustration, and ultimately despair.
&lt;/p&gt;
&lt;p&gt;
These are just patterns after all, not implementations. And they are big, complex
patterns that include quite a few concepts that must work together correctly to enable
success.
&lt;/p&gt;
&lt;p&gt;
You can’t sew a fancy dress just because you have a pattern. You need appropriate
tools, knowledge, and experience. The same is true with these complex “M” patterns. 
&lt;/p&gt;
&lt;p&gt;
And if you want to repeat the process of sewing a fancy dress over and over again
(efficiently), you need specialized tooling for this purpose. In software terms this
is a framework.
&lt;/p&gt;
&lt;p&gt;
Trying to do something like MVVM without a framework is a huge amount of work. Tons
of duplicate code, reinventing the wheel, and retraining people to think differently.
&lt;/p&gt;
&lt;p&gt;
At least with a framework you avoid the duplicate code and hopefully don’t have to
reinvent the wheel – allowing you to focus on retraining people. The retraining part
is generally unavoidable, but a framework provides plumbing code and structure, making
the process easier.
&lt;/p&gt;
&lt;p&gt;
You might ask yourself why the MVC pattern only became popular in ASP.NET a few short
years ago. The pattern has existed since (at least) the mid-1990’s, and yet few people
used it, and even fewer used it successfully. This includes people on other platforms
too, at least up to the point that those platforms included well-implemented MVC frameworks.
&lt;/p&gt;
&lt;p&gt;
Strangely, MVC only started to become mainstream in the Microsoft world when ASP.NET
MVC showed up. This is a comprehensive framework with tooling integrated into Visual
Studio. As a result. typical developers can just build models, views, and controllers.
Prior to that point they also had to build everything the MVC framework does – which
is a lot of code. And not just a lot of code, but code that has absolutely nothing
to do with business value, and only relates to implementation of the pattern itself.
&lt;/p&gt;
&lt;p&gt;
We’re in the same situation today with MVVM in WPF, Silverlight, Windows Phone, and
Windows Runtime (WinRT in Windows 8). If you want to do MVVM without a framework,
you will have to build everything a framework would do – which is a lot of code that
provides absolutely no direct business value.
&lt;/p&gt;
&lt;p&gt;
Typical developers really do want to focus on building models, views, and viewmodels.
They don’t want to have to build weak reference based event routers, navigation models,
view abstractions, and all the other things a framework must do. In fact, most developers
probably &lt;em&gt;can’t &lt;/em&gt;build those things, because they aren’t platform/framework
wonks. It takes a special kind of passion (or craziness) to learn the deep, highly
specialized techniques and tricks necessary to build a framework like this.
&lt;/p&gt;
&lt;p&gt;
What I really &lt;i&gt;wish&lt;/i&gt; would happen, is for Microsoft to build an MVVM framework
comparable to ASP.NET MVC. Embed it into the .NET/XAML support for WinRT/Metro, and
include tooling in VS so we can right-click and add views and viewmodels. Ideally
this would be an open, iterative process like ASP.NET MVC has been – so after a few
years the framework reflects the smartest thoughts from Microsoft and from the community
at large.
&lt;/p&gt;
&lt;p&gt;
In the meantime, &lt;a href="http://caliburnmicro.codeplex.com/"&gt;Caliburn Micro&lt;/a&gt; appears
to be the best MVVM framework out there – certainly the most widely used. Probably
followed by various implementations using PRISM, and then MVVM Light, and some others.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=c61fd797-16f7-4f5f-a6fc-226f235b132a" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,c61fd797-16f7-4f5f-a6fc-226f235b132a.aspx</comments>
      <category>Architecture</category>
      <category>Microsoft .NET</category>
      <category>Programming</category>
      <category>Windows 8</category>
      <category>WinRT</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=04a35ef0-345e-4c5a-bfaf-70a6b7883107</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,04a35ef0-345e-4c5a-bfaf-70a6b7883107.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,04a35ef0-345e-4c5a-bfaf-70a6b7883107.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=04a35ef0-345e-4c5a-bfaf-70a6b7883107</wfw:commentRss>
      <slash:comments>9</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I am sometimes asked for technical career advice. A common question these days is
whether it is worth learning WPF, or Silverlight – .NET and XAML in general I suppose,
or would it be better to learn HTML 5 and JavaScript, or perhaps even Objective C?
</p>
        <p>
This is a challenging question to be sure. How good is your crystal ball? <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/Should-I-learn-Silverlight-HTML-5_9026/wlEmoticon-smile_2.png" /></p>
        <p>
XAML appears to be alive and well – WPF, Silverlight, and now WinRT (Windows 8 – and
probably Windows Phone 8 and “Xbox 720” and more) all use XAML.
</p>
        <p>
I look at the WinRT usage of XAML as being essentially “Silverlight 6” – it is far
closer to Silverlight than WPF, but isn’t exactly like Silverlight either. Assuming
success with Windows 8, WinRT will become the new primary client dev target for most
smart client development (over the next few years).
</p>
        <p>
The primary competitors are Objective C (if you believe iPads will take over the client
space), and HTML 5/JavaScript (if you believe in <s>fairy tales</s> the concept of
‘one technology to rule them all’).
</p>
        <p>
This is where the crystal ball comes into play.
</p>
        <p>
Do you think Apple will displace Microsoft – iPads will replace the use of Windows
– as the monopoly client OS?
</p>
        <p>
Do you think the concept of ‘natural monopoly’ that has caused the Windows hegemony
over the past 20 years is at an end – that some fundamental economic shift has occurred
so companies are now willing to increase their IT budgets as a % of revenue to accommodate
multiple client platforms (unlike the past 20 years)? In which case business app developers
should expect to support at least iPad and Windows, if not Android, into the future?
</p>
        <p>
Do you think that Windows 8 and WinRT will be strong enough to withstand the iPad
onslaught, and that the natural monopoly economic effect remains in place, so Windows
will remain the dominant client platform for business apps into the foreseeable future?
</p>
        <p>
These are really the three options, resulting in:
</p>
        <ol>
          <li>
Objective C slowly overtakes .NET and we ultimately are Apple devs instead of Microsoft
devs</li>
          <li>
H5/js rules the world as the ‘one technology to rule them all’ and vendors like Microsoft
and Apple become entirely irrelevant because we live in a purely open-source world
where nobody makes money off any platform technologies, so probably the only hardware/OS
left is something like Android running Chrome, because it is a 100% commodity play
at that level</li>
          <li>
.NET and XAML remain entirely valid, and life generally continues like it is today,
with a mix of .NET smart client work and primarily server-based web work with h5/js
primarily used to boost the user experience, but not often used to write standalone
smart client apps</li>
        </ol>
        <p>
My crystal ball leans toward option 3 – I don’t think economic realities change much
or often, and I struggle to see where IT departments will come up with the increased
budget (% of revenue) necessary to build apps for both iPads and Windows over the
long term. It will be measurably cheaper (by many, many, many thousands of dollars)
for companies to buy employees Win8 tablets rather than building and maintaining <i>both</i> iOS
and Windows versions of every business app.
</p>
        <p>
And I don’t believe in the ‘one technology to rule them all’ idea. That hasn’t happened
in the entire history of computing, and it is hard to imagine everyone on the planet
embracing one monoculture for software development. Especially when it would be counter
to the interests of every platform vendor out there (Microsoft, Apple, Google, Oracle,
and even IBM).
</p>
        <p>
Still with me? <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/Should-I-learn-Silverlight-HTML-5_9026/wlEmoticon-winkingsmile_2.png" /></p>
        <p>
To summarize, I think learning XAML is time well spent. Today that’s WPF or Silverlight.
There is absolutely no doubt that Silverlight is closer to WinRT than WPF, and people
building SL apps today will have an easier time migrating them to WinRT later, whereas
most WPF apps will be a pretty big rewrite.
</p>
        <p>
But there’s nothing wrong with focusing yourself on h5/js. If you do so, I suggest
doing it in a way that ignores or minimizes all server-side coding. If h5/js <i>does</i> take
over the world, it will be used to create pure smart client apps, and if there’s a
“web server” involved at all, it will exist purely as a deployment server for the
client app. The ‘pure’ h5/js/jquery/etc. world isn’t linked to any vendor – not Microsoft,
Apple, or anyone. To me this represents a pretty major career shift, because to truly
embrace h5/js as a complete software development platform is so demanding (imo) it
won’t leave time to retain .NET or other vendor-specific technology expertise.
</p>
        <p>
For my part, I’m not yet ready to abandon Microsoft for h5/js, because I think Windows
8, WinRT, .NET, and XAML have a rather bright future. A year from now I think a lot
of people will be happily using Windows 8 desktops, laptops, and tablets – and hopefully
a lot of Windows Phones, and with luck we’ll be looking forward to some cool new Xbox.
I live in (I think realistic) hope that my .NET/XAML skills will apply to all these
platforms.
</p>
        <p>
What does your crystal ball say?
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=04a35ef0-345e-4c5a-bfaf-70a6b7883107" />
      </body>
      <title>Should I learn Silverlight? Objective C? HTML 5?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,04a35ef0-345e-4c5a-bfaf-70a6b7883107.aspx</guid>
      <link>http://www.lhotka.net/weblog/ShouldILearnSilverlightObjectiveCHTML5.aspx</link>
      <pubDate>Thu, 26 Apr 2012 15:32:58 GMT</pubDate>
      <description>&lt;p&gt;
I am sometimes asked for technical career advice. A common question these days is
whether it is worth learning WPF, or Silverlight – .NET and XAML in general I suppose,
or would it be better to learn HTML 5 and JavaScript, or perhaps even Objective C?
&lt;/p&gt;
&lt;p&gt;
This is a challenging question to be sure. How good is your crystal ball? &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/Should-I-learn-Silverlight-HTML-5_9026/wlEmoticon-smile_2.png" /&gt;
&lt;/p&gt;
&lt;p&gt;
XAML appears to be alive and well – WPF, Silverlight, and now WinRT (Windows 8 – and
probably Windows Phone 8 and “Xbox 720” and more) all use XAML.
&lt;/p&gt;
&lt;p&gt;
I look at the WinRT usage of XAML as being essentially “Silverlight 6” – it is far
closer to Silverlight than WPF, but isn’t exactly like Silverlight either. Assuming
success with Windows 8, WinRT will become the new primary client dev target for most
smart client development (over the next few years).
&lt;/p&gt;
&lt;p&gt;
The primary competitors are Objective C (if you believe iPads will take over the client
space), and HTML 5/JavaScript (if you believe in &lt;s&gt;fairy tales&lt;/s&gt; the concept of
‘one technology to rule them all’).
&lt;/p&gt;
&lt;p&gt;
This is where the crystal ball comes into play.
&lt;/p&gt;
&lt;p&gt;
Do you think Apple will displace Microsoft – iPads will replace the use of Windows
– as the monopoly client OS?
&lt;/p&gt;
&lt;p&gt;
Do you think the concept of ‘natural monopoly’ that has caused the Windows hegemony
over the past 20 years is at an end – that some fundamental economic shift has occurred
so companies are now willing to increase their IT budgets as a % of revenue to accommodate
multiple client platforms (unlike the past 20 years)? In which case business app developers
should expect to support at least iPad and Windows, if not Android, into the future?
&lt;/p&gt;
&lt;p&gt;
Do you think that Windows 8 and WinRT will be strong enough to withstand the iPad
onslaught, and that the natural monopoly economic effect remains in place, so Windows
will remain the dominant client platform for business apps into the foreseeable future?
&lt;/p&gt;
&lt;p&gt;
These are really the three options, resulting in:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Objective C slowly overtakes .NET and we ultimately are Apple devs instead of Microsoft
devs&lt;/li&gt;
&lt;li&gt;
H5/js rules the world as the ‘one technology to rule them all’ and vendors like Microsoft
and Apple become entirely irrelevant because we live in a purely open-source world
where nobody makes money off any platform technologies, so probably the only hardware/OS
left is something like Android running Chrome, because it is a 100% commodity play
at that level&lt;/li&gt;
&lt;li&gt;
.NET and XAML remain entirely valid, and life generally continues like it is today,
with a mix of .NET smart client work and primarily server-based web work with h5/js
primarily used to boost the user experience, but not often used to write standalone
smart client apps&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
My crystal ball leans toward option 3 – I don’t think economic realities change much
or often, and I struggle to see where IT departments will come up with the increased
budget (% of revenue) necessary to build apps for both iPads and Windows over the
long term. It will be measurably cheaper (by many, many, many thousands of dollars)
for companies to buy employees Win8 tablets rather than building and maintaining &lt;i&gt;both&lt;/i&gt; iOS
and Windows versions of every business app.
&lt;/p&gt;
&lt;p&gt;
And I don’t believe in the ‘one technology to rule them all’ idea. That hasn’t happened
in the entire history of computing, and it is hard to imagine everyone on the planet
embracing one monoculture for software development. Especially when it would be counter
to the interests of every platform vendor out there (Microsoft, Apple, Google, Oracle,
and even IBM).
&lt;/p&gt;
&lt;p&gt;
Still with me? &lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-winkingsmile" alt="Winking smile" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/Should-I-learn-Silverlight-HTML-5_9026/wlEmoticon-winkingsmile_2.png" /&gt;
&lt;/p&gt;
&lt;p&gt;
To summarize, I think learning XAML is time well spent. Today that’s WPF or Silverlight.
There is absolutely no doubt that Silverlight is closer to WinRT than WPF, and people
building SL apps today will have an easier time migrating them to WinRT later, whereas
most WPF apps will be a pretty big rewrite.
&lt;/p&gt;
&lt;p&gt;
But there’s nothing wrong with focusing yourself on h5/js. If you do so, I suggest
doing it in a way that ignores or minimizes all server-side coding. If h5/js &lt;i&gt;does&lt;/i&gt; take
over the world, it will be used to create pure smart client apps, and if there’s a
“web server” involved at all, it will exist purely as a deployment server for the
client app. The ‘pure’ h5/js/jquery/etc. world isn’t linked to any vendor – not Microsoft,
Apple, or anyone. To me this represents a pretty major career shift, because to truly
embrace h5/js as a complete software development platform is so demanding (imo) it
won’t leave time to retain .NET or other vendor-specific technology expertise.
&lt;/p&gt;
&lt;p&gt;
For my part, I’m not yet ready to abandon Microsoft for h5/js, because I think Windows
8, WinRT, .NET, and XAML have a rather bright future. A year from now I think a lot
of people will be happily using Windows 8 desktops, laptops, and tablets – and hopefully
a lot of Windows Phones, and with luck we’ll be looking forward to some cool new Xbox.
I live in (I think realistic) hope that my .NET/XAML skills will apply to all these
platforms.
&lt;/p&gt;
&lt;p&gt;
What does your crystal ball say?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=04a35ef0-345e-4c5a-bfaf-70a6b7883107" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,04a35ef0-345e-4c5a-bfaf-70a6b7883107.aspx</comments>
      <category>Programming</category>
      <category>Windows 8</category>
      <category>WinRT</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=680a932d-7e2c-4ed8-93e0-7c24e0ef3ea8</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,680a932d-7e2c-4ed8-93e0-7c24e0ef3ea8.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,680a932d-7e2c-4ed8-93e0-7c24e0ef3ea8.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=680a932d-7e2c-4ed8-93e0-7c24e0ef3ea8</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
People often ask “Why should I use MVVM? It seems like it complicates things.”
</p>
        <p>
The most common reason hard-core developers put forward for MVVM is that “it enables
unit testing of presentation code”.
</p>
        <p>
Although that can be true, I don’t think that’s the <em>primary</em> reason people
should invest in MVVM.
</p>
        <p>
I think the primary reason is that it protects your presentation code against some
level of change to the XAML. It makes your code more maintainable, and will help it
last longer.
</p>
        <p>
For example, build a WPF app with code-behind. Now try to move it to Silverlight without
changing any code (only XAML). Pretty hard huh?
</p>
        <p>
Or, build a Silverlight app with code-behind. Now have a user experience designer
rework your XAML to look beautiful. Your app won’t build anymore? They changed numerous
XAML types and there are now compiler errors? Oops…
</p>
        <p>
Looking forward, try taking any WPF or Silverlight app that has code-behind and moving
it to WinRT (Windows 8) without changing any code (only XAML – and the XAML <em>will</em> need
to change). Turns out to be nearly impossible doesn’t it?
</p>
        <p>
And yet, I have lots of CSLA .NET application code that uses MVVM to keep the presentation
code cleanly separated from the XAML. Examples where the <em>exact same code</em> runs
behind WPF and Silverlight XAML. I’m not quite yet to the point of having CSLA working
on WinRT, but I fully expect <em>the exact same code</em> to run on Windows 8, just
with a third set of XAML.
</p>
        <p>
To me, that is the power and value of MVVM. Your goal should be no code-behind, viewmodel
code that doesn’t rely on specific XAML types, and an abstract set of viewmodel methods
that can be bound to arbitrary UI events.
</p>
        <p>
Yes, MVVM is an investment. But it will almost certainly pay for itself over time,
as you maintain your app, and move it from one flavor of XAML to another.
</p>
        <p>
Does MVVM mean you can <em>completely</em> avoid changing code when the XAML changes?
No. But it is a whole lot closer than any other technique I’ve seen in my 24+ year
career.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=680a932d-7e2c-4ed8-93e0-7c24e0ef3ea8" />
      </body>
      <title>Why MVVM?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,680a932d-7e2c-4ed8-93e0-7c24e0ef3ea8.aspx</guid>
      <link>http://www.lhotka.net/weblog/WhyMVVM.aspx</link>
      <pubDate>Mon, 03 Oct 2011 15:59:08 GMT</pubDate>
      <description>&lt;p&gt;
People often ask “Why should I use MVVM? It seems like it complicates things.”
&lt;/p&gt;
&lt;p&gt;
The most common reason hard-core developers put forward for MVVM is that “it enables
unit testing of presentation code”.
&lt;/p&gt;
&lt;p&gt;
Although that can be true, I don’t think that’s the &lt;em&gt;primary&lt;/em&gt; reason people
should invest in MVVM.
&lt;/p&gt;
&lt;p&gt;
I think the primary reason is that it protects your presentation code against some
level of change to the XAML. It makes your code more maintainable, and will help it
last longer.
&lt;/p&gt;
&lt;p&gt;
For example, build a WPF app with code-behind. Now try to move it to Silverlight without
changing any code (only XAML). Pretty hard huh?
&lt;/p&gt;
&lt;p&gt;
Or, build a Silverlight app with code-behind. Now have a user experience designer
rework your XAML to look beautiful. Your app won’t build anymore? They changed numerous
XAML types and there are now compiler errors? Oops…
&lt;/p&gt;
&lt;p&gt;
Looking forward, try taking any WPF or Silverlight app that has code-behind and moving
it to WinRT (Windows 8) without changing any code (only XAML – and the XAML &lt;em&gt;will&lt;/em&gt; need
to change). Turns out to be nearly impossible doesn’t it?
&lt;/p&gt;
&lt;p&gt;
And yet, I have lots of CSLA .NET application code that uses MVVM to keep the presentation
code cleanly separated from the XAML. Examples where the &lt;em&gt;exact same code&lt;/em&gt; runs
behind WPF and Silverlight XAML. I’m not quite yet to the point of having CSLA working
on WinRT, but I fully expect &lt;em&gt;the exact same code&lt;/em&gt; to run on Windows 8, just
with a third set of XAML.
&lt;/p&gt;
&lt;p&gt;
To me, that is the power and value of MVVM. Your goal should be no code-behind, viewmodel
code that doesn’t rely on specific XAML types, and an abstract set of viewmodel methods
that can be bound to arbitrary UI events.
&lt;/p&gt;
&lt;p&gt;
Yes, MVVM is an investment. But it will almost certainly pay for itself over time,
as you maintain your app, and move it from one flavor of XAML to another.
&lt;/p&gt;
&lt;p&gt;
Does MVVM mean you can &lt;em&gt;completely&lt;/em&gt; avoid changing code when the XAML changes?
No. But it is a whole lot closer than any other technique I’ve seen in my 24+ year
career.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=680a932d-7e2c-4ed8-93e0-7c24e0ef3ea8" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,680a932d-7e2c-4ed8-93e0-7c24e0ef3ea8.aspx</comments>
      <category>Architecture</category>
      <category>Programming</category>
      <category>WinRT</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=32805477-89ee-4a76-af9f-674ce8d248ed</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,32805477-89ee-4a76-af9f-674ce8d248ed.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,32805477-89ee-4a76-af9f-674ce8d248ed.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=32805477-89ee-4a76-af9f-674ce8d248ed</wfw:commentRss>
      <slash:comments>17</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Microsoft revealed quite a lot of detail about "Windows 8" and its programming model
at the //build/ conference in September 2011. The result is a lot of excitement, and
a lot of fear and worry, on the part of Microsoft developers and customers.
</p>
        <p>
From what I've seen so far, in reading tweets and other online discussions, is that
people's fear and worry are misplaced. Not necessarily unwarranted, but misplaced.
</p>
        <p>
There's a lot of worry that ".NET has no future" or "Silverlight has no future". These
worries are, in my view, misplaced.
</p>
        <p>
First, it is important to understand that the new WinRT (Windows Runtime) model that
supports Win8 Metro style apps is accessible from .NET. Yes, you can also use C++,
but I can't imagine a whole lot of people care. And you can use JavaScript, which
is pretty cool.
</p>
        <p>
But the important thing to understand is that WinRT is fully accessible from .NET.
The model is quite similar to Silverlight for Windows Phone. You write a program using
C# or VB, and that program runs within the CLR, and has access to a set of base class
libraries (BCL) just like a .NET, Silverlight, or WP7 app today. Your program also
has access to a large new namespace where you have access to all the WinRT types. 
</p>
        <p>
These WinRT types are the same ones used by C++ or JavaScript developers in WinRT.
I think this is very cool, because it means that (for perhaps the first time ever)
we'll be able to create truly first-class Windows applications in C#, without having
to resort to C++ or p/invoke calls.
</p>
        <p>
The BCL available to your Metro/WinRT app is restricted to things that are "safe"
for a Metro app to use, and the BCL features don't duplicate what's provided by the
WinRT objects. This means that some of your existing .NET code won't just compile
in WinRT, because you might be using some .NET BCL features that are now found in
WinRT, or that aren't deemed "safe" for a Metro app.
</p>
        <p>
That is exactly like Silverlight and WP7 apps. The BCL features available in Silverlight
or WP7 are also restricted to disallow things that aren't safe, or that make no sense
in those environments.
</p>
        <p>
In fact, from what I've seen so far, it looks like the WinRT BCL features are more
comparable to Silverlight than anything else. So I strongly suspect that Silverlight
apps will migrate to WinRT far more easily than any other type of app.
</p>
        <p>
None of this gives me any real worry or concern. Yes, if you are a Windows Forms developer,
and very possibly if you are a WPF developer, you'll have some real effort to migrate
to WinRT, but it isn't like you have to learn everything new from scratch like we
did moving from VB/COM to .NET. And if you are a Silverlight developer you'll probably
have a pretty easy time, but there'll still be some real effort to migrate to WinRT.
</p>
        <p>
If nothing else, we all need to go learn the WinRT API, which Microsoft said was around
1800 types.
</p>
        <p>
So what should you worry about? In my view, the big thing about Win8 and Metro style
apps is that these apps have a different lifetime and a different user experience
model. The last time we underwent such a dramatic change in the way Windows apps worked
was when we moved from Windows 3.1 (or Windows for Workgroups) to Windows 95.
</p>
        <p>
To bring this home, let me share a story. When .NET was first coming out I was quite
excited, and I was putting a lot of time into learning .NET. As a developer my world
was turned upside down and I had to learn a whole new platform and tools and langauge
- awesome!! :)
</p>
        <p>
I was having a conversation with my mother, and she could tell I was having fun. She
asked "so when will I see some of this new .NET on my computer?"
</p>
        <p>
How do you answer that? Windows Forms, as different as it was from VB6, created apps
that looked exactly the same. My mother saw exactly zero difference as a result of
our massive move from VB/COM to .NET.
</p>
        <p>
Kind of sad when you think about it. We learned a whole new programming platform so
we could build apps that users couldn't distinguish from what we'd been doing before.
</p>
        <p>
Windows 8 and Metro are the inverse. We don't really need to learn any new major platform
or tools or languages. From a developer perspective this is exciting, but evolutionary.
But from a user perspective everything is changing. When I next talk to my mother
about how excited I am, I can tell her (actually I can show her thanks to the Samsung
tablet - thank you Microsoft!) that she'll see new applications that are easier to
learn, understand, and use.
</p>
        <p>
This is wonderful!!
</p>
        <p>
But from our perspective as developers, we are going to have to rethink and relearn
how apps are designed at the user experience and user workflow level. And we are going
to have to learn how to live within the new application lifecycle model where apps
can suspend and then either resume or be silently terminated.
</p>
        <p>
Instead of spending a lot of time angsting over whether the WinRT CLR or BCL is exactly
like .NET/Silverlight/WP7, we should be angsting over the major impact of the application
lifecycle and Metro style UX and Metro style navigation within each application.
</p>
        <p>
OK, I don't honestly think we should have angst over that either. I think this is
exciting, and challenging. If I wanted to live in a stable (stagnant?) world where
I didn't need to think through such things, well, I think I'd be an accountant or
something…
</p>
        <p>
Yes, this will take some effort and some deep thinking. And it will absolutely impact
how we build software over the next many years.
</p>
        <p>
And this brings me to the question of timing. When should we care about Metro and
WinRT? Here's a potential timeline, that I suspect is quite realistic based on watching
Windows releases since 1990.
</p>
        <p>
Win8 will probably RTM in time for hardware vendors to create, package, and deliver
all sorts of machines for the 2012 holiday season. So probably somewhere between July
and October 2012.
</p>
        <p>
For consumer apps this means you might care about Win8 now, because you might want
to make sure your cool app is in the Win8 online store for the 2012 holiday season.
</p>
        <p>
For business apps the timing is quite different. Corporations roll out a new OS much
later than consumers get it through retailers. As an example, Windows 7 has now been
out for about three years, but most corporations still use Windows XP!!! I have no
hard numbers, but I suspect Win7 is deployed in maybe 25% of corporations - after
being available for three years.
</p>
        <p>
That is pretty typical.
</p>
        <p>
So for business apps, we can look at doing a reasonable amount of Win8 Metro development
around 2015. 
</p>
        <p>
Yes, some of us will be lucky enough to work for "type A" companies that jump on new
things as they come out, and we'll get to build Metro apps starting in late 2012.
</p>
        <p>
Most of us work for "type B" companies, and they'll roll out a new OS after SP1 has
been deployed by the "type A" companies - these are the companies that will deploy
Win8 after has been out for 2-4 years.
</p>
        <p>
Some unfortunate souls work for "type C" companies, and they'll roll out Win8 when
Win7 loses support (so around 2018?). I used to work for a "type C" company, and that's
a hard place to find yourself as a developer. Yet those companies do exist even today.
</p>
        <p>
What does this all mean? It means that for a typical corporate or business developer,
we have around 4 years from today before we're building WinRT apps.
</p>
        <p>
The logical question to ask then (and you really should ask this question), is what
do we do for the next 4 years??? How do we build software between now and when we
get to use Metro/WinRT?
</p>
        <p>
Obviously the concern is that if you build an app starting today, how do you protect
that investment so you don't have to completely rewrite the app in 4 years?
</p>
        <p>
I don't yet know the solid answer. We just don't have enough deep information yet.
That'll change though, because we now have access to early Win8 builds and early tooling.
</p>
        <p>
What I suspect is that the best way to mitigate risk will be to build apps today using
Silverlight and the Silverlight navigation model (because that's also the model used
in WinRT). 
</p>
        <p>
The BCL features available to a Silverlight app are closer to WinRT than full .NET
is today, so the odds of using BCL features that won't be available to a Metro app
is reduced.
</p>
        <p>
Also, thinking through the user experience and user workflow from a Silverlight navigation
perspective will get your overall application experience closer to what you'd do in
a Metro style app - at least when compared to any workflow you'd have in Windows Forms.
Certainly you can use WPF and also create a Silverlight-style navigation model, and
that'd also be good.
</p>
        <p>
Clearly any app that uses multiple windows or modal dialogs (or really any dialogs)
will not migrate to Metro without some major rework.
</p>
        <p>
The one remaining concern is the new run/suspend/resume/terminate application model.
Even Silverlight doesn't use that model today - except on WP7. I think some thought
needs to go into application design today to enable support for suspend in the future.
I don't have a great answer right at the moment, but I know that I'll be thinking
about it, because this is important to easing migrations in the future.
</p>
        <p>
It is true that whatever XAML you use today won't move to WinRT unchanged. Well, I
can't say that with certainty, but the reality is that WinRT exposes several powerful
UI controls we don't have today. And any Metro style app will need to use those WinRT
controls to fit seamlessly into the Win8 world.
</p>
        <p>
My guess is that some of the third-party component vendors are well on their way to
replicating the WinRT controls for Silverlight and WPF today. I surely hope so anyway.
And that's probably going to be the best way to minimize the XAML migration. If we
have access to controls today that are very similar to the WinRT controls of the future,
then we can more easily streamline the eventual migration.
</p>
        <p>
In summary, Windows 8, WinRT, and Metro are a big deal. But not in the way most people
seem to think. The .NET/C#/CLR/BCL story is evolutionary and just isn't that big a
deal. It is the user experience and application lifecycle story that will require
the most thought and effort as we build software over the next several years.
</p>
        <p>
Personally I'm thrilled! These are good challenges, and I very much look forward to
building .NET applications that deeply integrate with Windows 8. Applications that
I can point to and proudly say "I built that".
</p>
        <p>
          <strong>Update: </strong>here are a couple related blog posts from fellow Microsoft
RDs:
</p>
        <ul>
          <li>
            <a href="http://vinodunny.com/blog/post/Windows-8-Dev-Stacke28093My-take-on-it.aspx">http://vinodunny.com/blog/post/Windows-8-Dev-Stacke28093My-take-on-it.aspx</a>
          </li>
          <li>
            <a href="http://briannoyes.net/2011/09/15/SilverlightDevelopersHaveTheSmoothestRoadToMetro.aspx">http://briannoyes.net/2011/09/15/SilverlightDevelopersHaveTheSmoothestRoadToMetro.aspx</a>
          </li>
        </ul>
        <p>
and a good post from Doug Seven:
</p>
        <ul>
          <li>
            <a href="http://dougseven.com/2011/09/15/a-bad-picture-is-worth-a-thousand-long-discussions/">http://dougseven.com/2011/09/15/a-bad-picture-is-worth-a-thousand-long-discussions/</a>
          </li>
        </ul>
        <p>
and from fellow Magenic experts:
</p>
        <ul>
          <li>
            <a href="http://dotnetspeak.com/index.php/2011/09/what-i-learned-at-the-build-conference/">http://dotnetspeak.com/index.php/2011/09/what-i-learned-at-the-build-conference/</a>
          </li>
        </ul>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=32805477-89ee-4a76-af9f-674ce8d248ed" />
      </body>
      <title>WinRT and .NET</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,32805477-89ee-4a76-af9f-674ce8d248ed.aspx</guid>
      <link>http://www.lhotka.net/weblog/WinRTAndNET.aspx</link>
      <pubDate>Sat, 17 Sep 2011 02:27:24 GMT</pubDate>
      <description>&lt;p&gt;
Microsoft revealed quite a lot of detail about "Windows 8" and its programming model
at the //build/ conference in September 2011. The result is a lot of excitement, and
a lot of fear and worry, on the part of Microsoft developers and customers.
&lt;/p&gt;
&lt;p&gt;
From what I've seen so far, in reading tweets and other online discussions, is that
people's fear and worry are misplaced. Not necessarily unwarranted, but misplaced.
&lt;/p&gt;
&lt;p&gt;
There's a lot of worry that ".NET has no future" or "Silverlight has no future". These
worries are, in my view, misplaced.
&lt;/p&gt;
&lt;p&gt;
First, it is important to understand that the new WinRT (Windows Runtime) model that
supports Win8 Metro style apps is accessible from .NET. Yes, you can also use C++,
but I can't imagine a whole lot of people care. And you can use JavaScript, which
is pretty cool.
&lt;/p&gt;
&lt;p&gt;
But the important thing to understand is that WinRT is fully accessible from .NET.
The model is quite similar to Silverlight for Windows Phone. You write a program using
C# or VB, and that program runs within the CLR, and has access to a set of base class
libraries (BCL) just like a .NET, Silverlight, or WP7 app today. Your program also
has access to a large new namespace where you have access to all the WinRT types. 
&lt;/p&gt;
&lt;p&gt;
These WinRT types are the same ones used by C++ or JavaScript developers in WinRT.
I think this is very cool, because it means that (for perhaps the first time ever)
we'll be able to create truly first-class Windows applications in C#, without having
to resort to C++ or p/invoke calls.
&lt;/p&gt;
&lt;p&gt;
The BCL available to your Metro/WinRT app is restricted to things that are "safe"
for a Metro app to use, and the BCL features don't duplicate what's provided by the
WinRT objects. This means that some of your existing .NET code won't just compile
in WinRT, because you might be using some .NET BCL features that are now found in
WinRT, or that aren't deemed "safe" for a Metro app.
&lt;/p&gt;
&lt;p&gt;
That is exactly like Silverlight and WP7 apps. The BCL features available in Silverlight
or WP7 are also restricted to disallow things that aren't safe, or that make no sense
in those environments.
&lt;/p&gt;
&lt;p&gt;
In fact, from what I've seen so far, it looks like the WinRT BCL features are more
comparable to Silverlight than anything else. So I strongly suspect that Silverlight
apps will migrate to WinRT far more easily than any other type of app.
&lt;/p&gt;
&lt;p&gt;
None of this gives me any real worry or concern. Yes, if you are a Windows Forms developer,
and very possibly if you are a WPF developer, you'll have some real effort to migrate
to WinRT, but it isn't like you have to learn everything new from scratch like we
did moving from VB/COM to .NET. And if you are a Silverlight developer you'll probably
have a pretty easy time, but there'll still be some real effort to migrate to WinRT.
&lt;/p&gt;
&lt;p&gt;
If nothing else, we all need to go learn the WinRT API, which Microsoft said was around
1800 types.
&lt;/p&gt;
&lt;p&gt;
So what should you worry about? In my view, the big thing about Win8 and Metro style
apps is that these apps have a different lifetime and a different user experience
model. The last time we underwent such a dramatic change in the way Windows apps worked
was when we moved from Windows 3.1 (or Windows for Workgroups) to Windows 95.
&lt;/p&gt;
&lt;p&gt;
To bring this home, let me share a story. When .NET was first coming out I was quite
excited, and I was putting a lot of time into learning .NET. As a developer my world
was turned upside down and I had to learn a whole new platform and tools and langauge
- awesome!! :)
&lt;/p&gt;
&lt;p&gt;
I was having a conversation with my mother, and she could tell I was having fun. She
asked "so when will I see some of this new .NET on my computer?"
&lt;/p&gt;
&lt;p&gt;
How do you answer that? Windows Forms, as different as it was from VB6, created apps
that looked exactly the same. My mother saw exactly zero difference as a result of
our massive move from VB/COM to .NET.
&lt;/p&gt;
&lt;p&gt;
Kind of sad when you think about it. We learned a whole new programming platform so
we could build apps that users couldn't distinguish from what we'd been doing before.
&lt;/p&gt;
&lt;p&gt;
Windows 8 and Metro are the inverse. We don't really need to learn any new major platform
or tools or languages. From a developer perspective this is exciting, but evolutionary.
But from a user perspective everything is changing. When I next talk to my mother
about how excited I am, I can tell her (actually I can show her thanks to the Samsung
tablet - thank you Microsoft!) that she'll see new applications that are easier to
learn, understand, and use.
&lt;/p&gt;
&lt;p&gt;
This is wonderful!!
&lt;/p&gt;
&lt;p&gt;
But from our perspective as developers, we are going to have to rethink and relearn
how apps are designed at the user experience and user workflow level. And we are going
to have to learn how to live within the new application lifecycle model where apps
can suspend and then either resume or be silently terminated.
&lt;/p&gt;
&lt;p&gt;
Instead of spending a lot of time angsting over whether the WinRT CLR or BCL is exactly
like .NET/Silverlight/WP7, we should be angsting over the major impact of the application
lifecycle and Metro style UX and Metro style navigation within each application.
&lt;/p&gt;
&lt;p&gt;
OK, I don't honestly think we should have angst over that either. I think this is
exciting, and challenging. If I wanted to live in a stable (stagnant?) world where
I didn't need to think through such things, well, I think I'd be an accountant or
something…
&lt;/p&gt;
&lt;p&gt;
Yes, this will take some effort and some deep thinking. And it will absolutely impact
how we build software over the next many years.
&lt;/p&gt;
&lt;p&gt;
And this brings me to the question of timing. When should we care about Metro and
WinRT? Here's a potential timeline, that I suspect is quite realistic based on watching
Windows releases since 1990.
&lt;/p&gt;
&lt;p&gt;
Win8 will probably RTM in time for hardware vendors to create, package, and deliver
all sorts of machines for the 2012 holiday season. So probably somewhere between July
and October 2012.
&lt;/p&gt;
&lt;p&gt;
For consumer apps this means you might care about Win8 now, because you might want
to make sure your cool app is in the Win8 online store for the 2012 holiday season.
&lt;/p&gt;
&lt;p&gt;
For business apps the timing is quite different. Corporations roll out a new OS much
later than consumers get it through retailers. As an example, Windows 7 has now been
out for about three years, but most corporations still use Windows XP!!! I have no
hard numbers, but I suspect Win7 is deployed in maybe 25% of corporations - after
being available for three years.
&lt;/p&gt;
&lt;p&gt;
That is pretty typical.
&lt;/p&gt;
&lt;p&gt;
So for business apps, we can look at doing a reasonable amount of Win8 Metro development
around 2015. 
&lt;/p&gt;
&lt;p&gt;
Yes, some of us will be lucky enough to work for "type A" companies that jump on new
things as they come out, and we'll get to build Metro apps starting in late 2012.
&lt;/p&gt;
&lt;p&gt;
Most of us work for "type B" companies, and they'll roll out a new OS after SP1 has
been deployed by the "type A" companies - these are the companies that will deploy
Win8 after has been out for 2-4 years.
&lt;/p&gt;
&lt;p&gt;
Some unfortunate souls work for "type C" companies, and they'll roll out Win8 when
Win7 loses support (so around 2018?). I used to work for a "type C" company, and that's
a hard place to find yourself as a developer. Yet those companies do exist even today.
&lt;/p&gt;
&lt;p&gt;
What does this all mean? It means that for a typical corporate or business developer,
we have around 4 years from today before we're building WinRT apps.
&lt;/p&gt;
&lt;p&gt;
The logical question to ask then (and you really should ask this question), is what
do we do for the next 4 years??? How do we build software between now and when we
get to use Metro/WinRT?
&lt;/p&gt;
&lt;p&gt;
Obviously the concern is that if you build an app starting today, how do you protect
that investment so you don't have to completely rewrite the app in 4 years?
&lt;/p&gt;
&lt;p&gt;
I don't yet know the solid answer. We just don't have enough deep information yet.
That'll change though, because we now have access to early Win8 builds and early tooling.
&lt;/p&gt;
&lt;p&gt;
What I suspect is that the best way to mitigate risk will be to build apps today using
Silverlight and the Silverlight navigation model (because that's also the model used
in WinRT). 
&lt;/p&gt;
&lt;p&gt;
The BCL features available to a Silverlight app are closer to WinRT than full .NET
is today, so the odds of using BCL features that won't be available to a Metro app
is reduced.
&lt;/p&gt;
&lt;p&gt;
Also, thinking through the user experience and user workflow from a Silverlight navigation
perspective will get your overall application experience closer to what you'd do in
a Metro style app - at least when compared to any workflow you'd have in Windows Forms.
Certainly you can use WPF and also create a Silverlight-style navigation model, and
that'd also be good.
&lt;/p&gt;
&lt;p&gt;
Clearly any app that uses multiple windows or modal dialogs (or really any dialogs)
will not migrate to Metro without some major rework.
&lt;/p&gt;
&lt;p&gt;
The one remaining concern is the new run/suspend/resume/terminate application model.
Even Silverlight doesn't use that model today - except on WP7. I think some thought
needs to go into application design today to enable support for suspend in the future.
I don't have a great answer right at the moment, but I know that I'll be thinking
about it, because this is important to easing migrations in the future.
&lt;/p&gt;
&lt;p&gt;
It is true that whatever XAML you use today won't move to WinRT unchanged. Well, I
can't say that with certainty, but the reality is that WinRT exposes several powerful
UI controls we don't have today. And any Metro style app will need to use those WinRT
controls to fit seamlessly into the Win8 world.
&lt;/p&gt;
&lt;p&gt;
My guess is that some of the third-party component vendors are well on their way to
replicating the WinRT controls for Silverlight and WPF today. I surely hope so anyway.
And that's probably going to be the best way to minimize the XAML migration. If we
have access to controls today that are very similar to the WinRT controls of the future,
then we can more easily streamline the eventual migration.
&lt;/p&gt;
&lt;p&gt;
In summary, Windows 8, WinRT, and Metro are a big deal. But not in the way most people
seem to think. The .NET/C#/CLR/BCL story is evolutionary and just isn't that big a
deal. It is the user experience and application lifecycle story that will require
the most thought and effort as we build software over the next several years.
&lt;/p&gt;
&lt;p&gt;
Personally I'm thrilled! These are good challenges, and I very much look forward to
building .NET applications that deeply integrate with Windows 8. Applications that
I can point to and proudly say "I built that".
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Update: &lt;/strong&gt;here are a couple related blog posts from fellow Microsoft
RDs:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://vinodunny.com/blog/post/Windows-8-Dev-Stacke28093My-take-on-it.aspx"&gt;http://vinodunny.com/blog/post/Windows-8-Dev-Stacke28093My-take-on-it.aspx&lt;/a&gt; 
&lt;li&gt;
&lt;a href="http://briannoyes.net/2011/09/15/SilverlightDevelopersHaveTheSmoothestRoadToMetro.aspx"&gt;http://briannoyes.net/2011/09/15/SilverlightDevelopersHaveTheSmoothestRoadToMetro.aspx&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
and a good post from Doug Seven:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://dougseven.com/2011/09/15/a-bad-picture-is-worth-a-thousand-long-discussions/"&gt;http://dougseven.com/2011/09/15/a-bad-picture-is-worth-a-thousand-long-discussions/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
and from fellow Magenic experts:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://dotnetspeak.com/index.php/2011/09/what-i-learned-at-the-build-conference/"&gt;http://dotnetspeak.com/index.php/2011/09/what-i-learned-at-the-build-conference/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=32805477-89ee-4a76-af9f-674ce8d248ed" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,32805477-89ee-4a76-af9f-674ce8d248ed.aspx</comments>
      <category>Microsoft .NET</category>
      <category>Programming</category>
      <category>WinRT</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=c068203c-292e-4726-9975-864fef6de73b</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,c068203c-292e-4726-9975-864fef6de73b.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,c068203c-292e-4726-9975-864fef6de73b.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=c068203c-292e-4726-9975-864fef6de73b</wfw:commentRss>
      <slash:comments>10</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Anyone who expected HTML5 to be more standard or consistent than previous HTML standards
hasn’t been paying attention to the web over the past 13+ years.
</p>
        <p>
          <a href="http://www.zdnet.com/blog/bott/google-chrome-to-drop-h264-support-roadblock-to-html5/2856?tag=nl.e539">Google’s
decision to drop H.264</a> may be surprising as a specific item, but the idea of supporting
and not supporting various parts of HTML5 (or what vendors hope might be in HTML5
as it becomes a standard over the next several years) is something everyone should
expect.
</p>
        <p>
I have held out exactly zero hope for a consistent HTML5 implementation across the
various browser vendors. Why? It is simple economics.
</p>
        <p>
If IE, Chrome, FF and other browsers on Windows were <em>completely standards complaint
in all respects</em> there would be no reason for all those browsers. The only browser
that would exist is IE because it ships with Windows.
</p>
        <p>
The same is true on the Mac and any other platform. If the browsers implement exactly
the same behaviors, they can’t differentiate, so nobody would use anything except
the browser shipping with the OS.
</p>
        <p>
But the browser vendors have their own agendas and goals, which have nothing to do
with standards compliance or consistency. Every browser vendor is motivated by economics
– whether that’s mindshare for other products or web properties, data mining, advertising,
or other factors. These vendors want you to use their browser more than other browsers.
</p>
        <p>
So in a “standards-based world” how do you convince people to use your product when
it is (in theory) identical to every other product?
</p>
        <p>
When products have a price you could try to compete on that price. That’s a losing
game though, because when you undercut the average price you have less money to innovate
or even keep up. So even in the 1990’s with Unix standards vendors didn’t play the
pricing game – it is just a slow death.
</p>
        <p>
But browsers are free, so even if you wanted the slow death of the price-war strategy
you can’t play it in the browser world. So you are left with “embrace and extend”
or “deviate from the standard” as your options. And every browser vendor <em>must
play this game</em> or just give up and die.
</p>
        <p>
This happened to Unix in the 1990’s too – the various vendors didn’t want to play
on price, so they added features beyond any standard with the intent of doing two
things:
</p>
        <ol>
          <li>
Lure users to their version of Unix because it is “better”</li>
          <li>
Lock them into your version of Unix because as soon as they use your cool features
they are stuck on your version</li>
        </ol>
        <p>
The same is true with browsers and HTML5. All browser vendors are jockeying now (before
the standard is set) to differentiate and shape the standard. But even once there
is a “standard” they’ll continue to support the various features they’ve added that
didn’t make it into the standard.
</p>
        <p>
This is necessary, because it is the only way any given browser can lure users away
from the other browsers, thereby meeting the vendors’ long term goals.
</p>
        <p>
People often say they don’t want a homogenous computing world. That they want a lot
of variation and variety in the development platforms used across the industry. Over
the past 13+ years HTML has proven that variation is absolutely possible, and that
it is very expensive and frustrating.
</p>
        <p>
Working for consulting companies during all this time, I can say that HTML is a great
thing. Consultants charge by the hour, and any scenario where the same app must be
rebuilt, or at least tweaked, for every browser and every new version of every browser
is just a way to generate more revenue.
</p>
        <p>
Is HTML a drag on the world economy overall? Sure it is. Anything that automatically
increases the cost of software development like HTML is an economic drag by definition.
The inefficiency is built-in.
</p>
        <p>
The only place (today) with more inefficiency is the mobile space, where every mobile
platform has a unique development environment, tools, languages and technologies.
I love the mobile space – any app you want to build must be created for 2-5 different
platforms, all paid for at an hourly rate. (this is sarcasm btw – I really dislike
this sort of blatant inefficiency and waste)
</p>
        <p>
But I digress. Ultimately what I’m saying is that expecting HTML5 to provide more
consistency than previous versions of HTML is unrealistic, and moves like Google just
took are something we should all expect to happen on a continuing basis.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=c068203c-292e-4726-9975-864fef6de73b" />
      </body>
      <title>HTML5 &amp;ldquo;standard&amp;rdquo;?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,c068203c-292e-4726-9975-864fef6de73b.aspx</guid>
      <link>http://www.lhotka.net/weblog/HTML5Ldquostandardrdquo.aspx</link>
      <pubDate>Wed, 12 Jan 2011 17:49:44 GMT</pubDate>
      <description>&lt;p&gt;
Anyone who expected HTML5 to be more standard or consistent than previous HTML standards
hasn’t been paying attention to the web over the past 13+ years.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.zdnet.com/blog/bott/google-chrome-to-drop-h264-support-roadblock-to-html5/2856?tag=nl.e539"&gt;Google’s
decision to drop H.264&lt;/a&gt; may be surprising as a specific item, but the idea of supporting
and not supporting various parts of HTML5 (or what vendors hope might be in HTML5
as it becomes a standard over the next several years) is something everyone should
expect.
&lt;/p&gt;
&lt;p&gt;
I have held out exactly zero hope for a consistent HTML5 implementation across the
various browser vendors. Why? It is simple economics.
&lt;/p&gt;
&lt;p&gt;
If IE, Chrome, FF and other browsers on Windows were &lt;em&gt;completely standards complaint
in all respects&lt;/em&gt; there would be no reason for all those browsers. The only browser
that would exist is IE because it ships with Windows.
&lt;/p&gt;
&lt;p&gt;
The same is true on the Mac and any other platform. If the browsers implement exactly
the same behaviors, they can’t differentiate, so nobody would use anything except
the browser shipping with the OS.
&lt;/p&gt;
&lt;p&gt;
But the browser vendors have their own agendas and goals, which have nothing to do
with standards compliance or consistency. Every browser vendor is motivated by economics
– whether that’s mindshare for other products or web properties, data mining, advertising,
or other factors. These vendors want you to use their browser more than other browsers.
&lt;/p&gt;
&lt;p&gt;
So in a “standards-based world” how do you convince people to use your product when
it is (in theory) identical to every other product?
&lt;/p&gt;
&lt;p&gt;
When products have a price you could try to compete on that price. That’s a losing
game though, because when you undercut the average price you have less money to innovate
or even keep up. So even in the 1990’s with Unix standards vendors didn’t play the
pricing game – it is just a slow death.
&lt;/p&gt;
&lt;p&gt;
But browsers are free, so even if you wanted the slow death of the price-war strategy
you can’t play it in the browser world. So you are left with “embrace and extend”
or “deviate from the standard” as your options. And every browser vendor &lt;em&gt;must
play this game&lt;/em&gt; or just give up and die.
&lt;/p&gt;
&lt;p&gt;
This happened to Unix in the 1990’s too – the various vendors didn’t want to play
on price, so they added features beyond any standard with the intent of doing two
things:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Lure users to their version of Unix because it is “better”&lt;/li&gt;
&lt;li&gt;
Lock them into your version of Unix because as soon as they use your cool features
they are stuck on your version&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The same is true with browsers and HTML5. All browser vendors are jockeying now (before
the standard is set) to differentiate and shape the standard. But even once there
is a “standard” they’ll continue to support the various features they’ve added that
didn’t make it into the standard.
&lt;/p&gt;
&lt;p&gt;
This is necessary, because it is the only way any given browser can lure users away
from the other browsers, thereby meeting the vendors’ long term goals.
&lt;/p&gt;
&lt;p&gt;
People often say they don’t want a homogenous computing world. That they want a lot
of variation and variety in the development platforms used across the industry. Over
the past 13+ years HTML has proven that variation is absolutely possible, and that
it is very expensive and frustrating.
&lt;/p&gt;
&lt;p&gt;
Working for consulting companies during all this time, I can say that HTML is a great
thing. Consultants charge by the hour, and any scenario where the same app must be
rebuilt, or at least tweaked, for every browser and every new version of every browser
is just a way to generate more revenue.
&lt;/p&gt;
&lt;p&gt;
Is HTML a drag on the world economy overall? Sure it is. Anything that automatically
increases the cost of software development like HTML is an economic drag by definition.
The inefficiency is built-in.
&lt;/p&gt;
&lt;p&gt;
The only place (today) with more inefficiency is the mobile space, where every mobile
platform has a unique development environment, tools, languages and technologies.
I love the mobile space – any app you want to build must be created for 2-5 different
platforms, all paid for at an hourly rate. (this is sarcasm btw – I really dislike
this sort of blatant inefficiency and waste)
&lt;/p&gt;
&lt;p&gt;
But I digress. Ultimately what I’m saying is that expecting HTML5 to provide more
consistency than previous versions of HTML is unrealistic, and moves like Google just
took are something we should all expect to happen on a continuing basis.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=c068203c-292e-4726-9975-864fef6de73b" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,c068203c-292e-4726-9975-864fef6de73b.aspx</comments>
      <category>Programming</category>
      <category>Web</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=be235a80-ddea-46c8-92d2-8fd26974dc4c</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,be235a80-ddea-46c8-92d2-8fd26974dc4c.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,be235a80-ddea-46c8-92d2-8fd26974dc4c.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=be235a80-ddea-46c8-92d2-8fd26974dc4c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One of the nicest things about TFS is the way it can be customized and extended to
fit different types of process.
</p>
        <p>
A colleague of mine, Mario Cardinal, works for a company who has built an Agile/SCRUM
extension: <a title="http://urbanturtle.com/awesome/" href="http://urbanturtle.com/awesome/">http://urbanturtle.com/awesome/</a></p>
        <p>
This really highlights how TFS can be used as the basis for a deep solution around
a specific process, methodology or project philosophy. Cool stuff – and if you do
SCRUM you should probably take a look at Urban Turtle to see if it can help you out.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=be235a80-ddea-46c8-92d2-8fd26974dc4c" />
      </body>
      <title>TFS extensibility</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,be235a80-ddea-46c8-92d2-8fd26974dc4c.aspx</guid>
      <link>http://www.lhotka.net/weblog/TFSExtensibility.aspx</link>
      <pubDate>Tue, 11 Jan 2011 18:41:56 GMT</pubDate>
      <description>&lt;p&gt;
One of the nicest things about TFS is the way it can be customized and extended to
fit different types of process.
&lt;/p&gt;
&lt;p&gt;
A colleague of mine, Mario Cardinal, works for a company who has built an Agile/SCRUM
extension: &lt;a title="http://urbanturtle.com/awesome/" href="http://urbanturtle.com/awesome/"&gt;http://urbanturtle.com/awesome/&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
This really highlights how TFS can be used as the basis for a deep solution around
a specific process, methodology or project philosophy. Cool stuff – and if you do
SCRUM you should probably take a look at Urban Turtle to see if it can help you out.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=be235a80-ddea-46c8-92d2-8fd26974dc4c" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,be235a80-ddea-46c8-92d2-8fd26974dc4c.aspx</comments>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=df95e884-8fe5-4740-8ac8-9b61cf1dfb5d</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,df95e884-8fe5-4740-8ac8-9b61cf1dfb5d.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,df95e884-8fe5-4740-8ac8-9b61cf1dfb5d.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=df95e884-8fe5-4740-8ac8-9b61cf1dfb5d</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One week from today, on December 6, at the Microsoft office in Bloomington, MN you
can attend a free two-track .NET developer training event: <a href="http://www.codemastery.com/">Code
Mastery</a>.
</p>
        <p>
This event includes content from the Microsoft PDC 2010 event, plus custom content
covering topics such as:
</p>
        <ul>
          <li>
Windows Phone 7 (WP7) development</li>
          <li>
How to really use the MVVM design pattern in WPF</li>
          <li>
SQL Azure</li>
          <li>
Combining Scrum and TFS 2010</li>
          <li>
Best practices for development in .NET</li>
          <li>
and more!!</li>
        </ul>
        <p>
If that isn’t enough, there’s a raffle at the end of the day, with great prizes (including
an MSDN Universal subscription), and our special guest Carl Franklin from .NET Rocks!
will be in attendance to spice up the event.
</p>
        <p>
          <a href="http://www.magenic.com/Default.aspx?tabid=134&amp;id=39C5D10D-E9D6-DF11-881F-00304861CFBC">Register
now</a> to reserve your seat!
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=df95e884-8fe5-4740-8ac8-9b61cf1dfb5d" />
      </body>
      <title>Minneapolis PDC, Code Mastery and more!</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,df95e884-8fe5-4740-8ac8-9b61cf1dfb5d.aspx</guid>
      <link>http://www.lhotka.net/weblog/MinneapolisPDCCodeMasteryAndMore.aspx</link>
      <pubDate>Tue, 30 Nov 2010 04:21:14 GMT</pubDate>
      <description>&lt;p&gt;
One week from today, on December 6, at the Microsoft office in Bloomington, MN you
can attend a free two-track .NET developer training event: &lt;a href="http://www.codemastery.com/"&gt;Code
Mastery&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
This event includes content from the Microsoft PDC 2010 event, plus custom content
covering topics such as:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Windows Phone 7 (WP7) development&lt;/li&gt;
&lt;li&gt;
How to really use the MVVM design pattern in WPF&lt;/li&gt;
&lt;li&gt;
SQL Azure&lt;/li&gt;
&lt;li&gt;
Combining Scrum and TFS 2010&lt;/li&gt;
&lt;li&gt;
Best practices for development in .NET&lt;/li&gt;
&lt;li&gt;
and more!!&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
If that isn’t enough, there’s a raffle at the end of the day, with great prizes (including
an MSDN Universal subscription), and our special guest Carl Franklin from .NET Rocks!
will be in attendance to spice up the event.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.magenic.com/Default.aspx?tabid=134&amp;amp;id=39C5D10D-E9D6-DF11-881F-00304861CFBC"&gt;Register
now&lt;/a&gt; to reserve your seat!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=df95e884-8fe5-4740-8ac8-9b61cf1dfb5d" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,df95e884-8fe5-4740-8ac8-9b61cf1dfb5d.aspx</comments>
      <category>Magenic</category>
      <category>Microsoft .NET</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=e282c763-873a-436e-b44a-d1ca1bda14be</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,e282c763-873a-436e-b44a-d1ca1bda14be.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,e282c763-873a-436e-b44a-d1ca1bda14be.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=e282c763-873a-436e-b44a-d1ca1bda14be</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Listen to an interview where I talk about CSLA 4, UnitDriven and a lot of things related
to Silverlight, WPF and Windows Phone (WP7) development.
</p>
        <p>
          <a href="http://www.pluralsight-training.net/community/blogs/pluralcast/archive/2010/11/08/pluralcast-28-talking-business-and-objectification-with-rocky-lhotka.aspx">Pluralcast
28 : Talking Business and Objectification with Rocky Lhotka</a>
        </p>
        <p>
This was recorded in October at the Patterns and Practices Symposium in Redmond.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=e282c763-873a-436e-b44a-d1ca1bda14be" />
      </body>
      <title>Talking Business and Objectification with Rocky Lhotka</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,e282c763-873a-436e-b44a-d1ca1bda14be.aspx</guid>
      <link>http://www.lhotka.net/weblog/TalkingBusinessAndObjectificationWithRockyLhotka.aspx</link>
      <pubDate>Mon, 08 Nov 2010 16:56:59 GMT</pubDate>
      <description>&lt;p&gt;
Listen to an interview where I talk about CSLA 4, UnitDriven and a lot of things related
to Silverlight, WPF and Windows Phone (WP7) development.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.pluralsight-training.net/community/blogs/pluralcast/archive/2010/11/08/pluralcast-28-talking-business-and-objectification-with-rocky-lhotka.aspx"&gt;Pluralcast
28 : Talking Business and Objectification with Rocky Lhotka&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
This was recorded in October at the Patterns and Practices Symposium in Redmond.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=e282c763-873a-436e-b44a-d1ca1bda14be" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,e282c763-873a-436e-b44a-d1ca1bda14be.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=c3e83762-7b99-4ffe-8532-163e567dd009</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,c3e83762-7b99-4ffe-8532-163e567dd009.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,c3e83762-7b99-4ffe-8532-163e567dd009.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=c3e83762-7b99-4ffe-8532-163e567dd009</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In the past week I’ve had a couple people mention that CSLA .NET is ‘heavyweight’.
Both times it was in regard to the fact that CSLA 4 now works on WP7.
</p>
        <p>
I think the train of thought is that CSLA 4 supports .NET and Silverlight, but that
phones are so … small. How can this translate?
</p>
        <p>
But I’ve had people suggest that CSLA is too heavyweight for small to medium app development
on Windows too.
</p>
        <p>
As you can probably guess, I don’t usually think about CSLA as being ‘heavyweight’,
and I feel comfortable using it for small, medium and large apps, and even on the
phone. However, the question bears some thought – hence this blog post.
</p>
        <p>
I think there are perhaps three things to consider:
</p>
        <ol>
          <li>
Assembly size</li>
          <li>
Runtime footprint</li>
          <li>
Conceptual surface area</li>
        </ol>
        <p>
CSLA is a small framework in terms of <strong>assembly size</strong> – weighing in
at around 300k (slightly more for .NET, less for SL and WP7). This is smaller than
many UI component libraries or other frameworks in general, so I feel pretty good
about the <em>lightweight </em>nature of the actual assemblies.
</p>
        <p>
The <strong>runtime footprint </strong>is more meaningful though, especially if we’re
talking about the phone. It is a little hard to analyze this, because it varies a
lot depending on what parts of CSLA you use. 
</p>
        <p>
The most resource-intensive feature is the ability to undo changes to an object graph,
because that triggers a snapshot of the object graph – obviously consuming memory.
Fortunately this feature is entirely optional, and on the phone it is not clear you’d
implement the type of Cancel button this feature is designed to support. Fortunately,
if you don’t use this feature then it doesn’t consume resources.
</p>
        <p>
The other primary area of resource consumption is where business rules are associated
with domain object types. This can get intense for applications with lots and lots
of business rules, and objects with lots and lots of properties. However, the phone
has serious UI limitations due to screen size, and it is pretty unrealistic to think
that you are going to allow a user to edit an object with 100 properties via a single
form on the phone…
</p>
        <p>
Of course if you did decide to create a scrolling edit form so a user could interact
with a big object like this, it doesn’t really matter if you use CSLA or not – you
are going to have a lot of code to implement the business logic and hook it into your
object so the logic runs as properties change, etc.
</p>
        <p>
There’s this theory I have, that software has an analogy to the Conservation of Energy
Principle (which says you can neither create nor destroy energy). You can neither
create nor destroy the minimum logic necessary to solve a business problem. In other
words, if your business problem requires lots of properties with lots of rules, you
need those properties and rules – regardless of which technology or framework you
are using.
</p>
        <p>
The CSLA 4 business rule system is quite spare – lightweight – at least given the
functionality it provides in terms of running rules as properties change and tracking
the results of those rules for display to the user.
</p>
        <p>
The <strong>conceptual surface area </strong>topic is quite meaningful to me – for
any framework or tool or pattern. Developers have a lot to keep track of – all the
knowledge about their business, their personal lives, their relationships with co-workers,
their development platform, the operating system they use, their network topography,
how to interact with their IT department, multiple programming languages, multiple
UI technologies, etc. Everything I just listed, and more, comes with a lot of concepts
– conceptual surface area.
</p>
        <p>
Go pick up a new technology. How do you learn to use it? You start by learning the
concepts of the technology, and (hopefully) relating those concepts to things you
already know. Either by comparison or contrast or analogy. Technologies with few concepts
(or few new concepts) are easy to pick up – which is why it is easy to switch between
C# and VB – they are virtually identical in most respects. But it is harder to switch
from Windows Forms to Web Forms, because there are deep and important conceptual differences
at the technology, architecture and platform levels.
</p>
        <p>
I think large conceptual surface areas are counterproductive. Which is why, while
I love patterns in general, I think good frameworks use complex patterns behind the
scenes, and avoid (as much as possible) the requirement that every developer internalize
every pattern. Patterns are a major avenue for <em>conceptual surface area bloat</em>.
</p>
        <p>
CSLA has a fairly large conceptual surface area. Larger than I’d like, but as small
as I’ve been able to maintain. CSLA 4 is, I think, the best so far, in that it pretty
much requires a specific syntax for class and property implementations – and you have
to learn that – but it abstracts the vast majority of what’s going on behind that
syntax, which reduces the surface area compared to older versions of the framework.
</p>
        <p>
Still, when people ask me what’s going to be the hardest part of getting up to speed
with CSLA, my answer is that there are two things:
</p>
        <ol>
          <li>
Domain-driven, behavior-focused object design</li>
          <li>
Learning the concepts and coding practices to use the framework itself</li>
        </ol>
        <p>
The first point is what it is. That has less to do with CSLA than with the challenges
learning good OOD/OOP in general. Generally speaking, most devs don’t do OO design,
and those that try tend to create object models that are data-focused, not behavior-focused.
It is the fault of tooling and a matter of education I think. So it becomes an area
of serious ramp-up before you can really leverage CSLA.
</p>
        <p>
The second point is an area where CSLA could be considered ‘heavyweight’ – in its
basic usage it is pretty easy (I think), but as you dive deeper and deeper, it turns
out there are a lot of concepts that support advanced scenarios. You can use CSLA
to create simple apps, and it can be helpful; but it also supports extremely sophisticated
enterprise app scenarios and they obviously have a lot more complexity.
</p>
        <p>
I can easily see where someone tasked with building a small to mid-size app, and who’s
not already familiar with CSLA, would find CSLA very counter-productive in the short-term.
I think they’d find it valuable in the long-term because it would simplify their maintenance
burden, but that can be hard to appreciate during initial development.
</p>
        <p>
On the other hand, for someone familiar with CSLA it is a lot <em>harder</em> to build
even simple apps without the framework, because you end up re-solving problems CSLA
already solved. Every time I go to build an app without CSLA it is so frustrating,
because I end up re-implementing all this stuff that I know <em>is already there for
the taking</em> if I could only use CSLA…
</p>
        <p>
.NET is great – but it is a general-purpose framework – so while it gives you all
the tools to do almost anything, it is up to you (or another framework) to fill in
the gaps between the bits and pieces in an elegant way so you can get down to the
business of writing business code. So while CSLA has a non-trivial conceptual surface
area where it solves these problems – you’ll <em>have to solve them anyway</em> because
they exist and must be solved.
</p>
        <p>
          <strong>In summary</strong>, from an assembly size and runtime size perspective, I
don’t think CSLA is heavyweight – which is why it works nicely on WP7. But from a
conceptual surface area perspective, I think there’s an argument to be made that CSLA
is a very comprehensive framework, and has the heavyweight depth that comes along
with that designation.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=c3e83762-7b99-4ffe-8532-163e567dd009" />
      </body>
      <title>What makes a framework &amp;lsquo;heavyweight&amp;rsquo;?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,c3e83762-7b99-4ffe-8532-163e567dd009.aspx</guid>
      <link>http://www.lhotka.net/weblog/WhatMakesAFrameworkLsquoheavyweightrsquo.aspx</link>
      <pubDate>Wed, 27 Oct 2010 15:58:30 GMT</pubDate>
      <description>&lt;p&gt;
In the past week I’ve had a couple people mention that CSLA .NET is ‘heavyweight’.
Both times it was in regard to the fact that CSLA 4 now works on WP7.
&lt;/p&gt;
&lt;p&gt;
I think the train of thought is that CSLA 4 supports .NET and Silverlight, but that
phones are so … small. How can this translate?
&lt;/p&gt;
&lt;p&gt;
But I’ve had people suggest that CSLA is too heavyweight for small to medium app development
on Windows too.
&lt;/p&gt;
&lt;p&gt;
As you can probably guess, I don’t usually think about CSLA as being ‘heavyweight’,
and I feel comfortable using it for small, medium and large apps, and even on the
phone. However, the question bears some thought – hence this blog post.
&lt;/p&gt;
&lt;p&gt;
I think there are perhaps three things to consider:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Assembly size&lt;/li&gt;
&lt;li&gt;
Runtime footprint&lt;/li&gt;
&lt;li&gt;
Conceptual surface area&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
CSLA is a small framework in terms of &lt;strong&gt;assembly size&lt;/strong&gt; – weighing in
at around 300k (slightly more for .NET, less for SL and WP7). This is smaller than
many UI component libraries or other frameworks in general, so I feel pretty good
about the &lt;em&gt;lightweight &lt;/em&gt;nature of the actual assemblies.
&lt;/p&gt;
&lt;p&gt;
The &lt;strong&gt;runtime footprint &lt;/strong&gt;is more meaningful though, especially if we’re
talking about the phone. It is a little hard to analyze this, because it varies a
lot depending on what parts of CSLA you use. 
&lt;/p&gt;
&lt;p&gt;
The most resource-intensive feature is the ability to undo changes to an object graph,
because that triggers a snapshot of the object graph – obviously consuming memory.
Fortunately this feature is entirely optional, and on the phone it is not clear you’d
implement the type of Cancel button this feature is designed to support. Fortunately,
if you don’t use this feature then it doesn’t consume resources.
&lt;/p&gt;
&lt;p&gt;
The other primary area of resource consumption is where business rules are associated
with domain object types. This can get intense for applications with lots and lots
of business rules, and objects with lots and lots of properties. However, the phone
has serious UI limitations due to screen size, and it is pretty unrealistic to think
that you are going to allow a user to edit an object with 100 properties via a single
form on the phone…
&lt;/p&gt;
&lt;p&gt;
Of course if you did decide to create a scrolling edit form so a user could interact
with a big object like this, it doesn’t really matter if you use CSLA or not – you
are going to have a lot of code to implement the business logic and hook it into your
object so the logic runs as properties change, etc.
&lt;/p&gt;
&lt;p&gt;
There’s this theory I have, that software has an analogy to the Conservation of Energy
Principle (which says you can neither create nor destroy energy). You can neither
create nor destroy the minimum logic necessary to solve a business problem. In other
words, if your business problem requires lots of properties with lots of rules, you
need those properties and rules – regardless of which technology or framework you
are using.
&lt;/p&gt;
&lt;p&gt;
The CSLA 4 business rule system is quite spare – lightweight – at least given the
functionality it provides in terms of running rules as properties change and tracking
the results of those rules for display to the user.
&lt;/p&gt;
&lt;p&gt;
The &lt;strong&gt;conceptual surface area &lt;/strong&gt;topic is quite meaningful to me – for
any framework or tool or pattern. Developers have a lot to keep track of – all the
knowledge about their business, their personal lives, their relationships with co-workers,
their development platform, the operating system they use, their network topography,
how to interact with their IT department, multiple programming languages, multiple
UI technologies, etc. Everything I just listed, and more, comes with a lot of concepts
– conceptual surface area.
&lt;/p&gt;
&lt;p&gt;
Go pick up a new technology. How do you learn to use it? You start by learning the
concepts of the technology, and (hopefully) relating those concepts to things you
already know. Either by comparison or contrast or analogy. Technologies with few concepts
(or few new concepts) are easy to pick up – which is why it is easy to switch between
C# and VB – they are virtually identical in most respects. But it is harder to switch
from Windows Forms to Web Forms, because there are deep and important conceptual differences
at the technology, architecture and platform levels.
&lt;/p&gt;
&lt;p&gt;
I think large conceptual surface areas are counterproductive. Which is why, while
I love patterns in general, I think good frameworks use complex patterns behind the
scenes, and avoid (as much as possible) the requirement that every developer internalize
every pattern. Patterns are a major avenue for &lt;em&gt;conceptual surface area bloat&lt;/em&gt;.
&lt;/p&gt;
&lt;p&gt;
CSLA has a fairly large conceptual surface area. Larger than I’d like, but as small
as I’ve been able to maintain. CSLA 4 is, I think, the best so far, in that it pretty
much requires a specific syntax for class and property implementations – and you have
to learn that – but it abstracts the vast majority of what’s going on behind that
syntax, which reduces the surface area compared to older versions of the framework.
&lt;/p&gt;
&lt;p&gt;
Still, when people ask me what’s going to be the hardest part of getting up to speed
with CSLA, my answer is that there are two things:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Domain-driven, behavior-focused object design&lt;/li&gt;
&lt;li&gt;
Learning the concepts and coding practices to use the framework itself&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The first point is what it is. That has less to do with CSLA than with the challenges
learning good OOD/OOP in general. Generally speaking, most devs don’t do OO design,
and those that try tend to create object models that are data-focused, not behavior-focused.
It is the fault of tooling and a matter of education I think. So it becomes an area
of serious ramp-up before you can really leverage CSLA.
&lt;/p&gt;
&lt;p&gt;
The second point is an area where CSLA could be considered ‘heavyweight’ – in its
basic usage it is pretty easy (I think), but as you dive deeper and deeper, it turns
out there are a lot of concepts that support advanced scenarios. You can use CSLA
to create simple apps, and it can be helpful; but it also supports extremely sophisticated
enterprise app scenarios and they obviously have a lot more complexity.
&lt;/p&gt;
&lt;p&gt;
I can easily see where someone tasked with building a small to mid-size app, and who’s
not already familiar with CSLA, would find CSLA very counter-productive in the short-term.
I think they’d find it valuable in the long-term because it would simplify their maintenance
burden, but that can be hard to appreciate during initial development.
&lt;/p&gt;
&lt;p&gt;
On the other hand, for someone familiar with CSLA it is a lot &lt;em&gt;harder&lt;/em&gt; to build
even simple apps without the framework, because you end up re-solving problems CSLA
already solved. Every time I go to build an app without CSLA it is so frustrating,
because I end up re-implementing all this stuff that I know &lt;em&gt;is already there for
the taking&lt;/em&gt; if I could only use CSLA…
&lt;/p&gt;
&lt;p&gt;
.NET is great – but it is a general-purpose framework – so while it gives you all
the tools to do almost anything, it is up to you (or another framework) to fill in
the gaps between the bits and pieces in an elegant way so you can get down to the
business of writing business code. So while CSLA has a non-trivial conceptual surface
area where it solves these problems – you’ll &lt;em&gt;have to solve them anyway&lt;/em&gt; because
they exist and must be solved.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In summary&lt;/strong&gt;, from an assembly size and runtime size perspective, I
don’t think CSLA is heavyweight – which is why it works nicely on WP7. But from a
conceptual surface area perspective, I think there’s an argument to be made that CSLA
is a very comprehensive framework, and has the heavyweight depth that comes along
with that designation.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=c3e83762-7b99-4ffe-8532-163e567dd009" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,c3e83762-7b99-4ffe-8532-163e567dd009.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=0b6cfa8e-4391-4821-9b37-499c72e95e46</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,0b6cfa8e-4391-4821-9b37-499c72e95e46.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,0b6cfa8e-4391-4821-9b37-499c72e95e46.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=0b6cfa8e-4391-4821-9b37-499c72e95e46</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Over the past 14 years of building and maintaining the CSLA framework I’ve tried several
source control technologies and strategies. My current technology is Subversion and
I have a branching and tagging strategy with which I’ve been very happy. So I thought
I’d share how this works.
</p>
        <p>
My CSLA .NET development team is distributed, with contributors to CSLA in various
regions of the US and as far away as Norway. And my user base is truly global, with
people using the code (and presumably looking at the repository) from countries in
every corner of the planet.
</p>
        <p>
I use Subversion primarily because it is “free as in beer”. In many ways I’d rather
use TFS, but since I expose my repository to the world via svn clients and the web
(and since CSLA is a free, open-source framework) TFS is completely out of reach financially.
</p>
        <p>
The thing is though, if I used TFS I’d almost certainly use it the same way I’m using
svn today. The lessons I’ve learned over the years about maintaining numerous releases,
building major new versions and reducing administrative and developer complexity should
generally apply to any source control technology.
</p>
        <h3>Top level folders
</h3>
        <p>
My top level folder structure organizes each project. 
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_2.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb.png" width="244" height="151" />
          </a>
        </p>
        <p>
No branching or tagging at this level. I tried that years ago, and it was a mess,
because the branches and tags often don’t operate at the project level (because projects
often have multiple components), so there’s a mismatch – the top level folders contain
projects, but the branches/tags often contain components – and that’s confusing.
</p>
        <p>
I know I could have a different repository for each project. And for more narrowly
focused authorization access to the projects that would be nice. But in my case I
want to expose all these projects externally via svn and web clients, so having the
projects within a single repository makes my administration burden quite manageable.
And I think it makes the repository easier to consume as an end-user, because there’s
this one URI that provides access to the entire history of CSLA .NET.
</p>
        <p>
You can see some “legacy projects” in this structure. Things like <em>csla1-x</em> or <em>samples </em>are
really just places where I’ve dumped very old code, or code from some of the ways
I no longer use svn. I don’t want to lose that history, but at the same time it wasn’t
realistic to try and fit that older code into the way I currently organize the code.
</p>
        <p>
Normally you’d look at <em>core </em>(the current code) or other comparatively live
projects like <em>n2</em>, <em>vb</em> or <em>ce</em>.
</p>
        <h3>Project folder structure
</h3>
        <p>
Within each project folder I have trunk, branches and tags.
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_4.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb_1.png" width="244" height="101" />
          </a>
        </p>
        <p>
This keeps each project isolated and reduces confusion within the repository.
</p>
        <p>
Within the trunk I have the folders of my project. In the current trunk I’ve organized
the CSLA 4 content into some high level areas.
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_6.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb_2.png" width="244" height="156" />
          </a>
        </p>
        <p>
At one point in the past I had the Samples as a separate project, rather than a folder
within a project. That was a problem though, because the samples need to version along
with the actual project source. They are dependent on the source. The same is true
of the support files and setup project (and hopefully soon the NuPack project).
</p>
        <p>
Basically what I’m doing is keeping all related content together within a project
to avoid version mismatch issues (such as having samples versioning independent from
the framework they demonstrate).
</p>
        <h3>Tagging
</h3>
        <p>
I use tagging for releases. When I release a version of the framework, I create a
tag that includes everything from trunk at the point of release.
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_8.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb_3.png" width="233" height="244" />
          </a>
        </p>
        <p>
The way svn prefers to think about tags is as a read-only snapshot of a point in time.
That is perfect for a release, since it really is a snapshot in time. This is incredibly
valuable because it means the code for any given release can always be easily discovered.
</p>
        <p>
I wasn’t always so disciplined about this, and the results were bad. People would
report issues with a version of the code and I wasn’t always able to see or even find
that version. Nor was it possible to do change comparisons between versions. Having
an easily discoverable and accessible snapshot of each version is invaluable.
</p>
        <h3>Branching
</h3>
        <p>
I have used branching for different reasons:
</p>
        <ul>
          <li>
Long-term maintenance of a point release (like 3.8)</li>
          <li>
Fixing bugs in an old release (where old is more than 1 release prior to current)</li>
          <li>
Creating major new versions of the code</li>
          <li>
Supporting experimental or research efforts that may or may not ever merge into the
trunk</li>
          <li>
Creating alternate versions of the framework (like the N2 or VB versions)</li>
        </ul>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_10.png">
            <img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb_4.png" width="244" height="222" />
          </a>
        </p>
        <p>
Not all those reasons turn out to be good ones… Specifically, I no longer use branching
to create alternate versions of the framework. Efforts like N2 or the VB version of
the framework are now top level projects. While I might use “branching” to create
those top level projects, I don’t maintain that code here in the branches folder of
the core. The reason is that those projects take on a life of their own, and need
their own branching and tagging – because they version and release independently.
</p>
        <p>
However, I find that the long term maintenance of a point release is a perfect use
for a branch. So you can see the branch for V3-8-x for example, which was created
when I started working on CSLA 4 in the trunk.
</p>
        <p>
In fact that’s an important point. In the past, when I started a major new version,
I’d start that work in a branch and then merge back into trunk. While that technically
works, the merge process is really painful. So I now keep trunk as being the future-looking
code – including major new versions. In other words, whenever I start working on CSLA
4.5 (or whatever) that work will occur in the trunk, and before I start that work
I’ll create a V4-0-x branch where I’ll be able to keep working on the then-current
version.
</p>
        <p>
I do cross-merging while working on major releases, especially early in the process
when the code is still very similar. For example, while I was building CSLA 4 people
would report issues with 3.8. So I’d fix the issue in 3.8 and then merge that fix
from the 3.8 branch into trunk. That was easy, because trunk started out exactly the
same. Over time however, that becomes increasingly difficult because the trunk diverges
more from any given branch, and eventually such cross-merging becomes (in my experience)
too difficult and it is easier to manually do the bug fix in both places (if appropriate).
</p>
        <p>
Today almost all work is done in trunk, because the primary focus is on CSLA 4. At
the same time, there are occasional bug fixes or changes made to 3.8, which of course
occur in the V3-8-x branch. And when I do a release of 3.8.x that still results in
a new tag for that release – with that tag created off the branch.
</p>
        <p>
In some <em>extremely rare</em> cases, I might end up doing a bug fix for an older
release (like 3.6 or something). While this is really unlikely, it can happen, and
in such a case I’d create a branch off the tag (the snapshot of the release) to make
that fix. And when that update is released, I’d create a tag off that branch for the
release.
</p>
        <p>
In summary, for branching I always end up with a branch to maintain the current code
every time the trunk becomes focused on a major future release. I sometimes create
a branch to fix a bug in an old release. And I sometimes create a branch to do some
experimental or research work – to see “what if I did something crazy” without affecting
any mainstream efforts.
</p>
        <p>
I no longer use branching to create alternate versions of the framework, or to create
major new versions. The drawbacks to using branching in those cases, specifically
in terms of complexity and/or merging issues, is just too high.
</p>
        <p>
This particular approach to folder structures, tagging and branching may not apply
to all scenarios, but it has absolutely made maintenance of CSLA .NET easier and better
over the past several years.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=0b6cfa8e-4391-4821-9b37-499c72e95e46" />
      </body>
      <title>CSLA .NET branching and tagging strategy</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,0b6cfa8e-4391-4821-9b37-499c72e95e46.aspx</guid>
      <link>http://www.lhotka.net/weblog/CSLANETBranchingAndTaggingStrategy.aspx</link>
      <pubDate>Fri, 15 Oct 2010 16:39:57 GMT</pubDate>
      <description>&lt;p&gt;
Over the past 14 years of building and maintaining the CSLA framework I’ve tried several
source control technologies and strategies. My current technology is Subversion and
I have a branching and tagging strategy with which I’ve been very happy. So I thought
I’d share how this works.
&lt;/p&gt;
&lt;p&gt;
My CSLA .NET development team is distributed, with contributors to CSLA in various
regions of the US and as far away as Norway. And my user base is truly global, with
people using the code (and presumably looking at the repository) from countries in
every corner of the planet.
&lt;/p&gt;
&lt;p&gt;
I use Subversion primarily because it is “free as in beer”. In many ways I’d rather
use TFS, but since I expose my repository to the world via svn clients and the web
(and since CSLA is a free, open-source framework) TFS is completely out of reach financially.
&lt;/p&gt;
&lt;p&gt;
The thing is though, if I used TFS I’d almost certainly use it the same way I’m using
svn today. The lessons I’ve learned over the years about maintaining numerous releases,
building major new versions and reducing administrative and developer complexity should
generally apply to any source control technology.
&lt;/p&gt;
&lt;h3&gt;Top level folders
&lt;/h3&gt;
&lt;p&gt;
My top level folder structure organizes each project. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_2.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb.png" width="244" height="151" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
No branching or tagging at this level. I tried that years ago, and it was a mess,
because the branches and tags often don’t operate at the project level (because projects
often have multiple components), so there’s a mismatch – the top level folders contain
projects, but the branches/tags often contain components – and that’s confusing.
&lt;/p&gt;
&lt;p&gt;
I know I could have a different repository for each project. And for more narrowly
focused authorization access to the projects that would be nice. But in my case I
want to expose all these projects externally via svn and web clients, so having the
projects within a single repository makes my administration burden quite manageable.
And I think it makes the repository easier to consume as an end-user, because there’s
this one URI that provides access to the entire history of CSLA .NET.
&lt;/p&gt;
&lt;p&gt;
You can see some “legacy projects” in this structure. Things like &lt;em&gt;csla1-x&lt;/em&gt; or &lt;em&gt;samples &lt;/em&gt;are
really just places where I’ve dumped very old code, or code from some of the ways
I no longer use svn. I don’t want to lose that history, but at the same time it wasn’t
realistic to try and fit that older code into the way I currently organize the code.
&lt;/p&gt;
&lt;p&gt;
Normally you’d look at &lt;em&gt;core &lt;/em&gt;(the current code) or other comparatively live
projects like &lt;em&gt;n2&lt;/em&gt;, &lt;em&gt;vb&lt;/em&gt; or &lt;em&gt;ce&lt;/em&gt;.
&lt;/p&gt;
&lt;h3&gt;Project folder structure
&lt;/h3&gt;
&lt;p&gt;
Within each project folder I have trunk, branches and tags.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_4.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb_1.png" width="244" height="101" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
This keeps each project isolated and reduces confusion within the repository.
&lt;/p&gt;
&lt;p&gt;
Within the trunk I have the folders of my project. In the current trunk I’ve organized
the CSLA 4 content into some high level areas.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_6.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb_2.png" width="244" height="156" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
At one point in the past I had the Samples as a separate project, rather than a folder
within a project. That was a problem though, because the samples need to version along
with the actual project source. They are dependent on the source. The same is true
of the support files and setup project (and hopefully soon the NuPack project).
&lt;/p&gt;
&lt;p&gt;
Basically what I’m doing is keeping all related content together within a project
to avoid version mismatch issues (such as having samples versioning independent from
the framework they demonstrate).
&lt;/p&gt;
&lt;h3&gt;Tagging
&lt;/h3&gt;
&lt;p&gt;
I use tagging for releases. When I release a version of the framework, I create a
tag that includes everything from trunk at the point of release.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_8.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb_3.png" width="233" height="244" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The way svn prefers to think about tags is as a read-only snapshot of a point in time.
That is perfect for a release, since it really is a snapshot in time. This is incredibly
valuable because it means the code for any given release can always be easily discovered.
&lt;/p&gt;
&lt;p&gt;
I wasn’t always so disciplined about this, and the results were bad. People would
report issues with a version of the code and I wasn’t always able to see or even find
that version. Nor was it possible to do change comparisons between versions. Having
an easily discoverable and accessible snapshot of each version is invaluable.
&lt;/p&gt;
&lt;h3&gt;Branching
&lt;/h3&gt;
&lt;p&gt;
I have used branching for different reasons:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Long-term maintenance of a point release (like 3.8)&lt;/li&gt;
&lt;li&gt;
Fixing bugs in an old release (where old is more than 1 release prior to current)&lt;/li&gt;
&lt;li&gt;
Creating major new versions of the code&lt;/li&gt;
&lt;li&gt;
Supporting experimental or research efforts that may or may not ever merge into the
trunk&lt;/li&gt;
&lt;li&gt;
Creating alternate versions of the framework (like the N2 or VB versions)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_10.png"&gt;&lt;img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/Windows-Live-Writer/8fe1d36745c9_912A/image_thumb_4.png" width="244" height="222" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Not all those reasons turn out to be good ones… Specifically, I no longer use branching
to create alternate versions of the framework. Efforts like N2 or the VB version of
the framework are now top level projects. While I might use “branching” to create
those top level projects, I don’t maintain that code here in the branches folder of
the core. The reason is that those projects take on a life of their own, and need
their own branching and tagging – because they version and release independently.
&lt;/p&gt;
&lt;p&gt;
However, I find that the long term maintenance of a point release is a perfect use
for a branch. So you can see the branch for V3-8-x for example, which was created
when I started working on CSLA 4 in the trunk.
&lt;/p&gt;
&lt;p&gt;
In fact that’s an important point. In the past, when I started a major new version,
I’d start that work in a branch and then merge back into trunk. While that technically
works, the merge process is really painful. So I now keep trunk as being the future-looking
code – including major new versions. In other words, whenever I start working on CSLA
4.5 (or whatever) that work will occur in the trunk, and before I start that work
I’ll create a V4-0-x branch where I’ll be able to keep working on the then-current
version.
&lt;/p&gt;
&lt;p&gt;
I do cross-merging while working on major releases, especially early in the process
when the code is still very similar. For example, while I was building CSLA 4 people
would report issues with 3.8. So I’d fix the issue in 3.8 and then merge that fix
from the 3.8 branch into trunk. That was easy, because trunk started out exactly the
same. Over time however, that becomes increasingly difficult because the trunk diverges
more from any given branch, and eventually such cross-merging becomes (in my experience)
too difficult and it is easier to manually do the bug fix in both places (if appropriate).
&lt;/p&gt;
&lt;p&gt;
Today almost all work is done in trunk, because the primary focus is on CSLA 4. At
the same time, there are occasional bug fixes or changes made to 3.8, which of course
occur in the V3-8-x branch. And when I do a release of 3.8.x that still results in
a new tag for that release – with that tag created off the branch.
&lt;/p&gt;
&lt;p&gt;
In some &lt;em&gt;extremely rare&lt;/em&gt; cases, I might end up doing a bug fix for an older
release (like 3.6 or something). While this is really unlikely, it can happen, and
in such a case I’d create a branch off the tag (the snapshot of the release) to make
that fix. And when that update is released, I’d create a tag off that branch for the
release.
&lt;/p&gt;
&lt;p&gt;
In summary, for branching I always end up with a branch to maintain the current code
every time the trunk becomes focused on a major future release. I sometimes create
a branch to fix a bug in an old release. And I sometimes create a branch to do some
experimental or research work – to see “what if I did something crazy” without affecting
any mainstream efforts.
&lt;/p&gt;
&lt;p&gt;
I no longer use branching to create alternate versions of the framework, or to create
major new versions. The drawbacks to using branching in those cases, specifically
in terms of complexity and/or merging issues, is just too high.
&lt;/p&gt;
&lt;p&gt;
This particular approach to folder structures, tagging and branching may not apply
to all scenarios, but it has absolutely made maintenance of CSLA .NET easier and better
over the past several years.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=0b6cfa8e-4391-4821-9b37-499c72e95e46" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,0b6cfa8e-4391-4821-9b37-499c72e95e46.aspx</comments>
      <category>CSLA .NET</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=61527092-40ff-44e5-abca-8c52519dc86f</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,61527092-40ff-44e5-abca-8c52519dc86f.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,61527092-40ff-44e5-abca-8c52519dc86f.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=61527092-40ff-44e5-abca-8c52519dc86f</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The Microsoft Patterns and Practices group has a new guidance book out:
</p>
        <p>
          <a href="http://msdn.microsoft.com/en-us/library/ff963553.aspx">MSDN Library: Parallel
Programming with Microsoft .NET</a>
        </p>
        <p>
A printed version will be coming from O’Reilly
</p>
        <p>
          <a href="http://oreilly.com/catalog/9780735651593/">Parallel Programming with Microsoft®
.NET</a>
        </p>
        <p>
And there are code samples on CodePlex
</p>
        <p>
          <a href="http://parallelpatterns.codeplex.com/">Parallel Patterns CodePlex</a>
        </p>
        <p>
Good stuff from the P&amp;P group!
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=61527092-40ff-44e5-abca-8c52519dc86f" />
      </body>
      <title>Parallel Programming with Microsoft .NET</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,61527092-40ff-44e5-abca-8c52519dc86f.aspx</guid>
      <link>http://www.lhotka.net/weblog/ParallelProgrammingWithMicrosoftNET.aspx</link>
      <pubDate>Wed, 01 Sep 2010 22:22:41 GMT</pubDate>
      <description>&lt;p&gt;
The Microsoft Patterns and Practices group has a new guidance book out:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/ff963553.aspx"&gt;MSDN Library: Parallel
Programming with Microsoft .NET&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
A printed version will be coming from O’Reilly
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://oreilly.com/catalog/9780735651593/"&gt;Parallel Programming with Microsoft®
.NET&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
And there are code samples on CodePlex
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://parallelpatterns.codeplex.com/"&gt;Parallel Patterns CodePlex&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Good stuff from the P&amp;amp;P group!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=61527092-40ff-44e5-abca-8c52519dc86f" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,61527092-40ff-44e5-abca-8c52519dc86f.aspx</comments>
      <category>Microsoft .NET</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=19d68712-4157-45e6-b6ef-2ac0a48e1b18</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,19d68712-4157-45e6-b6ef-2ac0a48e1b18.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,19d68712-4157-45e6-b6ef-2ac0a48e1b18.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=19d68712-4157-45e6-b6ef-2ac0a48e1b18</wfw:commentRss>
      <slash:comments>8</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was just at a family reunion and heard a joke about the comedian’s retirement home.
A guy walks into the common room and hears one old guy shout out “19”, and everyone
laughs. Across the room another guy shouts out “54” and everyone laughs even harder.
The guy turns to his guide and asks “What is going on?”. The guide replies “These
guys know all the same jokes, and at their age it takes too long to tell them, so
they just assigned them all numbers.” The guy smiles, and shouts out “92”, which results
in a just a few grudging chuckles. “What’d I do wrong?” he asks the guide. The guide
replies “Some people can tell a joke, some people can’t.”
</p>
        <p>
That made me think about patterns (yes, I know, I’m a geek).
</p>
        <p>
I like design patterns. Who wouldn’t? They are a formalized description of a solution
to a specific problem. If you have that problem, then having a formally described
solution seems like a dream come true.
</p>
        <p>
Perhaps more importantly patterns are a language short-cut. If everyone in a conversation
understands a pattern, the pattern (and often its problem) can be discussed merely
by using the pattern name, which saves an immense amount of time as opposed to describing
the actual problem and solution in detail.
</p>
        <p>
Of course the “formalized description” is prose. Human language. And therefore it
is ambiguous and open to interpretation. The descriptions <em>must be human-readable</em>,
because any pattern worth ink and paper transcends any specific platform or programming
language. Describing a “pattern” in Java or C# is silly – because that makes it far
too likely that it isn’t really a broad pattern, but is simply a practice that happens
to work in a given language or on a given platform.
</p>
        <p>
But this ambiguity leads to trouble. Not unlike the comedian’s retirement home, patterns
are a short-cut language to some really complex concepts, and often even more complex
implementations. While everyone <em>might</em> have a basic comprehension of “inversion
of control”, I can guarantee you that saying IoC doesn’t bring the same concept, implementation
or emotional response from everyone who hears it.
</p>
        <p>
Pattern zealots often forget (or overlook) the fact that patterns have consequences.
Good and bad consequences. <em>Every pattern has bad consequences</em>, as well as
good ones. Some people get attached to a pattern because it helped them at some point,
and they just assume that pattern will <em>always</em> have a positive or beneficial
result. But that’s simply not true. Sometimes the negative consequences of a pattern
outweigh the positive – it is all very dependent on the specific problem domain and
environment.
</p>
        <p>
Soft things like staffing levels, skill sets, attitudes and time frames all enter
into the real world environment. Add the reality that any given problem almost certainly
has <em>several patterns</em> that provide solutions – for different variations of
the problem – and it becomes clear that no one pattern is always “good”.
</p>
        <p>
It should come as no surprise then, that patterns are often misused – in several different
ways.
</p>
        <p>
My pet peeve is when a pattern is applied because something likes the pattern, not
because the application actually has the problem the pattern would solve. I often
see people using IoC, for example, because it is trendy, not because they actually
need the flexibility provided by the pattern. They use a container to create instances
of objects <em>that they will never swap out for other implementations</em>. What
a waste – they’ve accepted all the negative consequences of the pattern <em>for absolutely
no benefit</em> since they don’t have the problem the pattern would solve. Is this
the fault of IoC? Of course not, IoC is a powerful pattern. 
</p>
        <p>
It is the fault of what I call the “Pattern Of The Year” (POTY) syndrome. When a pattern
becomes really popular and trendy, it becomes the POTY. And everyone wants to go to
the POTY. If you need the POTY, you should go. But if you don’t need the POTY, it
is really a little silly (if not creepy) for you to go to the POTY…
</p>
        <p>
          <strong>In short: only use a pattern if you have the problem it solves, and the positive
consequences outweigh the negative consequences.</strong>
        </p>
        <p>
Perhaps the most common misuse of patterns is failure to actually understand the pattern
or its implementation. To stick with IoC as an example, it is pretty common for a
development team to completely misunderstand the pattern or the framework that implements
the pattern. Sure, some architect or lead developer “got it” (or so we hope) which
is why the team is using the pattern – but you can find apps where numerous competing
containers are created, each initialized differently.
</p>
        <p>
I always thought Apple BASIC spaghetti code was the worst thing possible – but misuse
of certain design patterns quickly creates a mess that is an order of magnitude worse
than anything people wrote back in the early 80’s…
</p>
        <p>
          <strong>In short: if you use a pattern, make sure your <em>entire team</em> understand
the pattern <em>and your implementation of the pattern</em>.</strong>
        </p>
        <p>
As I mentioned earlier, most problems can be solved by more than one pattern. Any
truly interesting problem almost certainly has multiple solutions, each with different
good/bad consequences and various subtle differences in outcome. It is not uncommon
for the best solution to be a combination of a few more basic patterns.
</p>
        <p>
As an example, the CSLA data portal is a combination of around six basic design patterns
that work together in concert to solve the problem space the data portal targets.
I’m not saying the data portal is a design pattern, but it is a solution for a problem
that came into being by combining several complimentary patterns.
</p>
        <p>
A few years after I created the data portal, various other design patterns were formalized
that describe other solutions to this same problem space. Some are similar, some are
not. If you look into each solution, it is clear that each one is actually a different
combination of some lower level design patterns, working together to solve the problem.
</p>
        <p>
The thing is, every pattern your bring into your solution (or ever pattern brought
in by a higher level pattern) comes with its own consequences. You need to be careful
to minimize the negative consequences of all those patterns so the overall balance
is toward the positive.
</p>
        <p>
          <strong>In short: don’t be afraid to combine simple or basic design patterns together
to solve a bigger problem, but be aware of the negative consequences of every pattern
you bring into play.</strong>
        </p>
        <p>
Having introduced this concept of “low level” vs “high level” patterns, I’m going
to follow that a bit further. Most of the patterns in the original GoF book are what
I’d call low level patterns. They stand alone and have little or no dependency on
each other. Each one solves a very narrow and clear problem and has very clear good/bad
consequences.
</p>
        <p>
Of course that was 15 years ago, and since then people have applied the pattern concept
to more complex and bigger problem spaces. The resulting solutions (patterns) very
often build on other patterns. In other words we’re raising the level of abstraction
by building on previous abstractions. And that’s a fine thing.
</p>
        <p>
But it is really important to understand that ultimately patterns are implemented,
and the implementations of patterns are often far messier than the abstract though
models provided by the patterns themselves. Even that is OK, but there’s a meta-consequence
the flows out of this: complexity.
</p>
        <p>
As you start to use higher level patterns, <em>and their implementations</em>, you
can easily become locked into not only the implementation of the pattern you wanted,
but also the implementations of the lower level patterns on which the implementation
is built.
</p>
        <p>
Again I’ll use IoC to illustrate my point. If you want IoC you’ll almost certainly
use a pre-existing implementation. And once you pick that framework, you are stuck
with it. You won’t want to use more than one IoC framework, because then you’d have
multiple containers, each configured differently and each competing for the attention
of every developer. The result is a massive increase in complexity, which means a
reduction in maintainability and a corresponding increase in cost.
</p>
        <p>
Now suppose you pick some higher level pattern, perhaps a portal or gateway, that
is implemented using IoC. If you want the implementation of the gateway pattern you
must also accept a dependency on <em>their IoC framework choice</em>.
</p>
        <p>
People often ask me whether (or when will) CSLA .NET will incorporate Enterprise Library,
log4net, Unity, Castle/Windsor, &lt;insert your framework here&gt;. I try very, very,
very hard to avoid any such dependencies, because as soon as I pick any one of these,
I make life really hard for everyone out there who didn’t choose that other framework.
</p>
        <p>
CSLA 3.8 has a dependency on a simple data structure framework, and even that was
a continual nightmare. I can hardly express how happy I am that I was able to get
rid of that dependency for CSLA 4. Not that the data structure framework was bad –
it does a great job – but the complexity introduced by the dependency was just nasty.
</p>
        <p>
          <strong>In short: be aware of the complexity introduced as high level patterns force
you to accept dependencies on lower level patterns and implementations.</strong>
        </p>
        <p>
The final topic I’d like to cover flows from a conversation I had with Ward Cunningham
a few years ago. We were talking about patterns and the “pattern movement”, and how
it has become a little warped over time as people actively look for ways to apply
patterns, rather than the patterns being used because they are the natural answer
to a problem.
</p>
        <p>
It is kind of like a carpenter who spends a lot of money buying some really nice new
power tool. And then trying to use that power tool for every part of the construction
process – even if that means being less efficient or increasing the complexity of
the job – just to use the tool.
</p>
        <p>
Obviously I’d never want to hire such a carpenter to work on my house!!
</p>
        <p>
Yet I’ve seen developers and architects get so fascinated by specific patterns, frameworks
or technologies that they do exactly that: increase the complexity of simple problem
domains specifically so they can use their new toy concept.
</p>
        <p>
In this conversation Ward suggested that there are different levels of understanding
or mastery of patterns. At the most basic level are people just learning what patterns
are, followed by people who “get” a pattern and actively seek opportunities to use
that pattern. But at higher levels of mastery are people who just do their job and
(often without a conscious thought) apply patterns as necessary.
</p>
        <p>
Carpenters don’t think twice about when and how to construct a staircase or put together
a 2x6” wall frame. These are common design patterns, but they are natural solutions
to common problems.
</p>
        <p>
          <strong>In short: strive for “pattern mastery” where you are not fixated on the pattern,
but instead are just solving problems with natural solutions, such that the pattern
“disappears” into the fabric of the overall solution.</strong>
        </p>
        <p>
The pattern movement has been going on for at least 15 years in our industry. And
over that time I think it has been far more beneficial than destructive. 
</p>
        <p>
But that doesn’t mean (especially as a consultant) that you don’t walk into many organizations
and see horrible misuse of design patterns – the results being higher complexity,
lower maintainability and higher cost of development and maintenance.
</p>
        <p>
I think it is important that we continually strive to make patterns be a common abstract
language for complex problems and solutions. And I think it is important that we continually
educate <em>everyone</em> on development teams about the patterns and implementations
we bring into our applications.
</p>
        <p>
But most importantly, I think we need to always make conscious choices, not choices
based on trends or fads or because somebody on the team is in love with pattern X
or framework Y or technology Z.
</p>
        <ol>
          <li>
Use a pattern because you have the problem it solves</li>
          <li>
Only use a pattern if the good consequences outweigh the bad (and remember that <em>every</em> pattern
has negative consequences)</li>
          <li>
Use patterns and implementations only if the entire team understands them</li>
          <li>
Use the simplest pattern that solves your problem</li>
          <li>
Don’t be afraid to combine several simple patterns to solve a complex problem</li>
          <li>
Be aware of (and consciously accept) the consequences of any low level patterns that
come with most high level pattern implementations</li>
          <li>
Strive for “pattern mastery”, where you are solving problems with natural solutions,
not looking for ways to apply any specific pattern</li>
        </ol>
        <p>
Eventually maybe we’ll all be in a software development retirement home and we can
shout things like “Memento” and “Channel adaptor” and everyone will chuckle with fond
memories of how those patterns made our lives easier as we built the software on which
the world runs.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=19d68712-4157-45e6-b6ef-2ac0a48e1b18" />
      </body>
      <title>On the use and misuse of patterns</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,19d68712-4157-45e6-b6ef-2ac0a48e1b18.aspx</guid>
      <link>http://www.lhotka.net/weblog/OnTheUseAndMisuseOfPatterns.aspx</link>
      <pubDate>Mon, 19 Jul 2010 17:03:04 GMT</pubDate>
      <description>&lt;p&gt;
I was just at a family reunion and heard a joke about the comedian’s retirement home.
A guy walks into the common room and hears one old guy shout out “19”, and everyone
laughs. Across the room another guy shouts out “54” and everyone laughs even harder.
The guy turns to his guide and asks “What is going on?”. The guide replies “These
guys know all the same jokes, and at their age it takes too long to tell them, so
they just assigned them all numbers.” The guy smiles, and shouts out “92”, which results
in a just a few grudging chuckles. “What’d I do wrong?” he asks the guide. The guide
replies “Some people can tell a joke, some people can’t.”
&lt;/p&gt;
&lt;p&gt;
That made me think about patterns (yes, I know, I’m a geek).
&lt;/p&gt;
&lt;p&gt;
I like design patterns. Who wouldn’t? They are a formalized description of a solution
to a specific problem. If you have that problem, then having a formally described
solution seems like a dream come true.
&lt;/p&gt;
&lt;p&gt;
Perhaps more importantly patterns are a language short-cut. If everyone in a conversation
understands a pattern, the pattern (and often its problem) can be discussed merely
by using the pattern name, which saves an immense amount of time as opposed to describing
the actual problem and solution in detail.
&lt;/p&gt;
&lt;p&gt;
Of course the “formalized description” is prose. Human language. And therefore it
is ambiguous and open to interpretation. The descriptions &lt;em&gt;must be human-readable&lt;/em&gt;,
because any pattern worth ink and paper transcends any specific platform or programming
language. Describing a “pattern” in Java or C# is silly – because that makes it far
too likely that it isn’t really a broad pattern, but is simply a practice that happens
to work in a given language or on a given platform.
&lt;/p&gt;
&lt;p&gt;
But this ambiguity leads to trouble. Not unlike the comedian’s retirement home, patterns
are a short-cut language to some really complex concepts, and often even more complex
implementations. While everyone &lt;em&gt;might&lt;/em&gt; have a basic comprehension of “inversion
of control”, I can guarantee you that saying IoC doesn’t bring the same concept, implementation
or emotional response from everyone who hears it.
&lt;/p&gt;
&lt;p&gt;
Pattern zealots often forget (or overlook) the fact that patterns have consequences.
Good and bad consequences. &lt;em&gt;Every pattern has bad consequences&lt;/em&gt;, as well as
good ones. Some people get attached to a pattern because it helped them at some point,
and they just assume that pattern will &lt;em&gt;always&lt;/em&gt; have a positive or beneficial
result. But that’s simply not true. Sometimes the negative consequences of a pattern
outweigh the positive – it is all very dependent on the specific problem domain and
environment.
&lt;/p&gt;
&lt;p&gt;
Soft things like staffing levels, skill sets, attitudes and time frames all enter
into the real world environment. Add the reality that any given problem almost certainly
has &lt;em&gt;several patterns&lt;/em&gt; that provide solutions – for different variations of
the problem – and it becomes clear that no one pattern is always “good”.
&lt;/p&gt;
&lt;p&gt;
It should come as no surprise then, that patterns are often misused – in several different
ways.
&lt;/p&gt;
&lt;p&gt;
My pet peeve is when a pattern is applied because something likes the pattern, not
because the application actually has the problem the pattern would solve. I often
see people using IoC, for example, because it is trendy, not because they actually
need the flexibility provided by the pattern. They use a container to create instances
of objects &lt;em&gt;that they will never swap out for other implementations&lt;/em&gt;. What
a waste – they’ve accepted all the negative consequences of the pattern &lt;em&gt;for absolutely
no benefit&lt;/em&gt; since they don’t have the problem the pattern would solve. Is this
the fault of IoC? Of course not, IoC is a powerful pattern. 
&lt;/p&gt;
&lt;p&gt;
It is the fault of what I call the “Pattern Of The Year” (POTY) syndrome. When a pattern
becomes really popular and trendy, it becomes the POTY. And everyone wants to go to
the POTY. If you need the POTY, you should go. But if you don’t need the POTY, it
is really a little silly (if not creepy) for you to go to the POTY…
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In short: only use a pattern if you have the problem it solves, and the positive
consequences outweigh the negative consequences.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Perhaps the most common misuse of patterns is failure to actually understand the pattern
or its implementation. To stick with IoC as an example, it is pretty common for a
development team to completely misunderstand the pattern or the framework that implements
the pattern. Sure, some architect or lead developer “got it” (or so we hope) which
is why the team is using the pattern – but you can find apps where numerous competing
containers are created, each initialized differently.
&lt;/p&gt;
&lt;p&gt;
I always thought Apple BASIC spaghetti code was the worst thing possible – but misuse
of certain design patterns quickly creates a mess that is an order of magnitude worse
than anything people wrote back in the early 80’s…
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In short: if you use a pattern, make sure your &lt;em&gt;entire team&lt;/em&gt; understand
the pattern &lt;em&gt;and your implementation of the pattern&lt;/em&gt;.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
As I mentioned earlier, most problems can be solved by more than one pattern. Any
truly interesting problem almost certainly has multiple solutions, each with different
good/bad consequences and various subtle differences in outcome. It is not uncommon
for the best solution to be a combination of a few more basic patterns.
&lt;/p&gt;
&lt;p&gt;
As an example, the CSLA data portal is a combination of around six basic design patterns
that work together in concert to solve the problem space the data portal targets.
I’m not saying the data portal is a design pattern, but it is a solution for a problem
that came into being by combining several complimentary patterns.
&lt;/p&gt;
&lt;p&gt;
A few years after I created the data portal, various other design patterns were formalized
that describe other solutions to this same problem space. Some are similar, some are
not. If you look into each solution, it is clear that each one is actually a different
combination of some lower level design patterns, working together to solve the problem.
&lt;/p&gt;
&lt;p&gt;
The thing is, every pattern your bring into your solution (or ever pattern brought
in by a higher level pattern) comes with its own consequences. You need to be careful
to minimize the negative consequences of all those patterns so the overall balance
is toward the positive.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In short: don’t be afraid to combine simple or basic design patterns together
to solve a bigger problem, but be aware of the negative consequences of every pattern
you bring into play.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
Having introduced this concept of “low level” vs “high level” patterns, I’m going
to follow that a bit further. Most of the patterns in the original GoF book are what
I’d call low level patterns. They stand alone and have little or no dependency on
each other. Each one solves a very narrow and clear problem and has very clear good/bad
consequences.
&lt;/p&gt;
&lt;p&gt;
Of course that was 15 years ago, and since then people have applied the pattern concept
to more complex and bigger problem spaces. The resulting solutions (patterns) very
often build on other patterns. In other words we’re raising the level of abstraction
by building on previous abstractions. And that’s a fine thing.
&lt;/p&gt;
&lt;p&gt;
But it is really important to understand that ultimately patterns are implemented,
and the implementations of patterns are often far messier than the abstract though
models provided by the patterns themselves. Even that is OK, but there’s a meta-consequence
the flows out of this: complexity.
&lt;/p&gt;
&lt;p&gt;
As you start to use higher level patterns, &lt;em&gt;and their implementations&lt;/em&gt;, you
can easily become locked into not only the implementation of the pattern you wanted,
but also the implementations of the lower level patterns on which the implementation
is built.
&lt;/p&gt;
&lt;p&gt;
Again I’ll use IoC to illustrate my point. If you want IoC you’ll almost certainly
use a pre-existing implementation. And once you pick that framework, you are stuck
with it. You won’t want to use more than one IoC framework, because then you’d have
multiple containers, each configured differently and each competing for the attention
of every developer. The result is a massive increase in complexity, which means a
reduction in maintainability and a corresponding increase in cost.
&lt;/p&gt;
&lt;p&gt;
Now suppose you pick some higher level pattern, perhaps a portal or gateway, that
is implemented using IoC. If you want the implementation of the gateway pattern you
must also accept a dependency on &lt;em&gt;their IoC framework choice&lt;/em&gt;.
&lt;/p&gt;
&lt;p&gt;
People often ask me whether (or when will) CSLA .NET will incorporate Enterprise Library,
log4net, Unity, Castle/Windsor, &amp;lt;insert your framework here&amp;gt;. I try very, very,
very hard to avoid any such dependencies, because as soon as I pick any one of these,
I make life really hard for everyone out there who didn’t choose that other framework.
&lt;/p&gt;
&lt;p&gt;
CSLA 3.8 has a dependency on a simple data structure framework, and even that was
a continual nightmare. I can hardly express how happy I am that I was able to get
rid of that dependency for CSLA 4. Not that the data structure framework was bad –
it does a great job – but the complexity introduced by the dependency was just nasty.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In short: be aware of the complexity introduced as high level patterns force
you to accept dependencies on lower level patterns and implementations.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
The final topic I’d like to cover flows from a conversation I had with Ward Cunningham
a few years ago. We were talking about patterns and the “pattern movement”, and how
it has become a little warped over time as people actively look for ways to apply
patterns, rather than the patterns being used because they are the natural answer
to a problem.
&lt;/p&gt;
&lt;p&gt;
It is kind of like a carpenter who spends a lot of money buying some really nice new
power tool. And then trying to use that power tool for every part of the construction
process – even if that means being less efficient or increasing the complexity of
the job – just to use the tool.
&lt;/p&gt;
&lt;p&gt;
Obviously I’d never want to hire such a carpenter to work on my house!!
&lt;/p&gt;
&lt;p&gt;
Yet I’ve seen developers and architects get so fascinated by specific patterns, frameworks
or technologies that they do exactly that: increase the complexity of simple problem
domains specifically so they can use their new toy concept.
&lt;/p&gt;
&lt;p&gt;
In this conversation Ward suggested that there are different levels of understanding
or mastery of patterns. At the most basic level are people just learning what patterns
are, followed by people who “get” a pattern and actively seek opportunities to use
that pattern. But at higher levels of mastery are people who just do their job and
(often without a conscious thought) apply patterns as necessary.
&lt;/p&gt;
&lt;p&gt;
Carpenters don’t think twice about when and how to construct a staircase or put together
a 2x6” wall frame. These are common design patterns, but they are natural solutions
to common problems.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;In short: strive for “pattern mastery” where you are not fixated on the pattern,
but instead are just solving problems with natural solutions, such that the pattern
“disappears” into the fabric of the overall solution.&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
The pattern movement has been going on for at least 15 years in our industry. And
over that time I think it has been far more beneficial than destructive. 
&lt;/p&gt;
&lt;p&gt;
But that doesn’t mean (especially as a consultant) that you don’t walk into many organizations
and see horrible misuse of design patterns – the results being higher complexity,
lower maintainability and higher cost of development and maintenance.
&lt;/p&gt;
&lt;p&gt;
I think it is important that we continually strive to make patterns be a common abstract
language for complex problems and solutions. And I think it is important that we continually
educate &lt;em&gt;everyone&lt;/em&gt; on development teams about the patterns and implementations
we bring into our applications.
&lt;/p&gt;
&lt;p&gt;
But most importantly, I think we need to always make conscious choices, not choices
based on trends or fads or because somebody on the team is in love with pattern X
or framework Y or technology Z.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Use a pattern because you have the problem it solves&lt;/li&gt;
&lt;li&gt;
Only use a pattern if the good consequences outweigh the bad (and remember that &lt;em&gt;every&lt;/em&gt; pattern
has negative consequences)&lt;/li&gt;
&lt;li&gt;
Use patterns and implementations only if the entire team understands them&lt;/li&gt;
&lt;li&gt;
Use the simplest pattern that solves your problem&lt;/li&gt;
&lt;li&gt;
Don’t be afraid to combine several simple patterns to solve a complex problem&lt;/li&gt;
&lt;li&gt;
Be aware of (and consciously accept) the consequences of any low level patterns that
come with most high level pattern implementations&lt;/li&gt;
&lt;li&gt;
Strive for “pattern mastery”, where you are solving problems with natural solutions,
not looking for ways to apply any specific pattern&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
Eventually maybe we’ll all be in a software development retirement home and we can
shout things like “Memento” and “Channel adaptor” and everyone will chuckle with fond
memories of how those patterns made our lives easier as we built the software on which
the world runs.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=19d68712-4157-45e6-b6ef-2ac0a48e1b18" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,19d68712-4157-45e6-b6ef-2ac0a48e1b18.aspx</comments>
      <category>Architecture</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=26706644-7e94-431f-872b-a7f9b0d73c7a</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,26706644-7e94-431f-872b-a7f9b0d73c7a.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,26706644-7e94-431f-872b-a7f9b0d73c7a.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=26706644-7e94-431f-872b-a7f9b0d73c7a</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
There’s a lot of understandable buzz about the iPad, including <a href="http://chucksblog.emc.com/chucks_blog/2010/05/what-ipads-did-to-my-family.html">this
well-written post</a> that I think conveys something important.
</p>
        <p>
As a Microsoft-oriented technical evangelist I’m now almost constantly asked what
I think of the iPad. I’ve spent perhaps a total of 20 minutes with one, so I’m not
an expert, but I can confidently say that I found it very pleasant to use, and I think
it is a great v1 product.
</p>
        <p>
(as an aside, many people also call it a “Kindle killer”, which I absolutely think
it is NOT. It is too heavy, the screen is shiny and backlit and the battery doesn’t
last 1-2 weeks – it was almost inconceivable to me that anything could replace real
books (but the <a href="http://kindle.amazon.com/">Kindle</a> did), and the iPad certainly
doesn’t compete with real paper or the Kindle)
</p>
        <p>
I think the iPad reveals something very, very important. As does the iPhone, the Android
phones and the upcoming Windows Phone 7: most users don’t need a “computer”. 
</p>
        <p>
Not a computer in the traditional sense, the way we as software designer/developers
think about it.
</p>
        <p>
Given the following:
</p>
        <ul>
          <li>
“Instant” on 
</li>
          <li>
Primarily touch-based UI for the OS 
</li>
          <li>
Apps (and OS) that is designed for touch through and through (and no non-touch apps) 
</li>
          <li>
Light weight 
</li>
          <li>
Good battery life 
</li>
          <li>
Good networking (including home LAN, corporate domain, network printing, etc) 
</li>
          <li>
Portable peripherals, and standard connectors (USB, Firewire, ESATA, etc) 
</li>
          <li>
Docking station capability 
</li>
        </ul>
        <p>
I submit that your typical user <em>doesn’t need a traditional computer</em>. Sure,
there are the “knowledge workers” in accounting, who push computers harder than developers
do, but they aren’t a typical user either.
</p>
        <p>
From what I can see, a typical user spends a lot of time 
</p>
        <ul>
          <li>
reading and composing email 
</li>
          <li>
using specialized line of business apps, mostly doing data entry and data viewing/analysis 
</li>
          <li>
browsing the web 
</li>
          <li>
playing lightweight casual games (solitaire, Flash-based games, etc) 
</li>
          <li>
using consumer apps like birthday card makers 
</li>
          <li>
organizing and viewing pictures and home videos 
</li>
          <li>
creating simple art projects with drawing apps, etc 
</li>
        </ul>
        <p>
None of these things require anything like the new i7 quad core (w/ hyperthreading
– so 8 way) laptop Magenic is rolling out to all its consultants. Most users just
don’t need that kind of horsepower, and would gladly trade it to get better battery
life and more intuitive apps.
</p>
        <p>
Which (finally) brings me to the real point of this post: today’s apps suck (just
ask <a href="http://suckbusters.com/">David Platt</a>).
</p>
        <p>
David talks a lot about why software sucks. But I want to focus on one narrow area:
usability, especially in a world where touch is the primary model, and keyboard/mouse
is secondary.
</p>
        <p>
I have a Windows 7 tablet, which I like quite a lot. But it is far, far, far less
usable than the iPad for most things. Why? It really isn’t because of Windows, which
can be configured to be pretty touch-friendly. It is because of the apps.
</p>
        <p>
Outlook, for example, is absolutely horrible. Trying to click on a message in the
inbox, or worse, trying to click on something in the ribbon – that’s crazy. I’m a
big guy, and I have big fingers. I typically touch the wrong thing more often than
the right thing…
</p>
        <p>
Web browsers are also horrible. Their toolbars are too small as well. But web pages
are as much to blame – all those text links crammed together in tables and lists –
it is nearly impossible to touch the correct link to navigate from page to page. Sure,
I can zoom in and out, but that’s just a pain.
</p>
        <p>
The web page thing is one area where the iPad is just as bad as anything else. It
isn’t the fault of the devices (Windows or iPad), it is the fault of the web page
designers. And it really isn’t <em>their</em> fault either, because their primary
audience is keyboard/mouse computer users…
</p>
        <p>
And that’s the challenge we all face. If the traditional computing form factor is
at its end, and I suspect it is, then we’re in for an interesting ride over the next
5-7 years. I don’t think there’s been as big a user interaction transition since we
moved from green-screen terminals to the Windows GUI keyboard/mouse world. 
</p>
        <p>
Moving to a world that is primarily touch is going to affect every app we build in
pretty fundamental ways. When click targets need to be 2-4 times bigger than they
are today, our beautiful high-resolution screens start to seem terribly cramped. And
these battery-conserving end user devices don’t have that high of resolution to start
with, so that makes space <em>really cramped</em>.
</p>
        <p>
And that means interaction metaphors must change, and UI layouts need to be more dynamic.
That’s the only way to really leverage this limited space and retain usability.
</p>
        <p>
For my part, I think Microsoft is in a great place in this regard. Several years ago
they introduced WPF and XAML, which are awesome tools for addressing these UI requirements.
More recently they streamlined those concepts by creating Silverlight – lighter weight
and more easily deployed, but with the same UI power.
</p>
        <p>
I’d be absolutely shocked if we don’t see some sort of Silverlight-based tablet/slate/pad/whatever
device in the relatively near future. And I’d be shocked if we don’t see the iPad
rapidly evolve based on user feedback.
</p>
        <p>
I really think we’re entering a period of major transition in terms of what it means
to be a “computer user”, and this transition will have a deep impact on how we design
and develop software for these computing appliances/devices.
</p>
        <p>
And it all starts with recognizing that the type of UI we’ve been building since the
early 1990’s is about to become just as obsolete as the green-screen terminal UIs
from the 1980’s.
</p>
        <p>
It took about 5 years for most organizations to transition from green-screen to GUI.
I don’t think the iPad alone is enough to start the next transition, but I think it
is the pebble that will start the avalanche. Once there are other devices (most notably
some Silverlight-based device – in my mind at least), then the real change will start,
because line of business apps will shift, as will consumer apps.
</p>
        <p>
I’m looking forward to the next few years – I think it is going to be a wild ride!
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=26706644-7e94-431f-872b-a7f9b0d73c7a" />
      </body>
      <title>A &amp;ldquo;computer free&amp;rdquo; future?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,26706644-7e94-431f-872b-a7f9b0d73c7a.aspx</guid>
      <link>http://www.lhotka.net/weblog/ALdquocomputerFreerdquoFuture.aspx</link>
      <pubDate>Fri, 07 May 2010 16:16:26 GMT</pubDate>
      <description>&lt;p&gt;
There’s a lot of understandable buzz about the iPad, including &lt;a href="http://chucksblog.emc.com/chucks_blog/2010/05/what-ipads-did-to-my-family.html"&gt;this
well-written post&lt;/a&gt; that I think conveys something important.
&lt;/p&gt;
&lt;p&gt;
As a Microsoft-oriented technical evangelist I’m now almost constantly asked what
I think of the iPad. I’ve spent perhaps a total of 20 minutes with one, so I’m not
an expert, but I can confidently say that I found it very pleasant to use, and I think
it is a great v1 product.
&lt;/p&gt;
&lt;p&gt;
(as an aside, many people also call it a “Kindle killer”, which I absolutely think
it is NOT. It is too heavy, the screen is shiny and backlit and the battery doesn’t
last 1-2 weeks – it was almost inconceivable to me that anything could replace real
books (but the &lt;a href="http://kindle.amazon.com/"&gt;Kindle&lt;/a&gt; did), and the iPad certainly
doesn’t compete with real paper or the Kindle)
&lt;/p&gt;
&lt;p&gt;
I think the iPad reveals something very, very important. As does the iPhone, the Android
phones and the upcoming Windows Phone 7: most users don’t need a “computer”. 
&lt;/p&gt;
&lt;p&gt;
Not a computer in the traditional sense, the way we as software designer/developers
think about it.
&lt;/p&gt;
&lt;p&gt;
Given the following:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
“Instant” on 
&lt;li&gt;
Primarily touch-based UI for the OS 
&lt;li&gt;
Apps (and OS) that is designed for touch through and through (and no non-touch apps) 
&lt;li&gt;
Light weight 
&lt;li&gt;
Good battery life 
&lt;li&gt;
Good networking (including home LAN, corporate domain, network printing, etc) 
&lt;li&gt;
Portable peripherals, and standard connectors (USB, Firewire, ESATA, etc) 
&lt;li&gt;
Docking station capability 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I submit that your typical user &lt;em&gt;doesn’t need a traditional computer&lt;/em&gt;. Sure,
there are the “knowledge workers” in accounting, who push computers harder than developers
do, but they aren’t a typical user either.
&lt;/p&gt;
&lt;p&gt;
From what I can see, a typical user spends a lot of time 
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
reading and composing email 
&lt;li&gt;
using specialized line of business apps, mostly doing data entry and data viewing/analysis 
&lt;li&gt;
browsing the web 
&lt;li&gt;
playing lightweight casual games (solitaire, Flash-based games, etc) 
&lt;li&gt;
using consumer apps like birthday card makers 
&lt;li&gt;
organizing and viewing pictures and home videos 
&lt;li&gt;
creating simple art projects with drawing apps, etc 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
None of these things require anything like the new i7 quad core (w/ hyperthreading
– so 8 way) laptop Magenic is rolling out to all its consultants. Most users just
don’t need that kind of horsepower, and would gladly trade it to get better battery
life and more intuitive apps.
&lt;/p&gt;
&lt;p&gt;
Which (finally) brings me to the real point of this post: today’s apps suck (just
ask &lt;a href="http://suckbusters.com/"&gt;David Platt&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;
David talks a lot about why software sucks. But I want to focus on one narrow area:
usability, especially in a world where touch is the primary model, and keyboard/mouse
is secondary.
&lt;/p&gt;
&lt;p&gt;
I have a Windows 7 tablet, which I like quite a lot. But it is far, far, far less
usable than the iPad for most things. Why? It really isn’t because of Windows, which
can be configured to be pretty touch-friendly. It is because of the apps.
&lt;/p&gt;
&lt;p&gt;
Outlook, for example, is absolutely horrible. Trying to click on a message in the
inbox, or worse, trying to click on something in the ribbon – that’s crazy. I’m a
big guy, and I have big fingers. I typically touch the wrong thing more often than
the right thing…
&lt;/p&gt;
&lt;p&gt;
Web browsers are also horrible. Their toolbars are too small as well. But web pages
are as much to blame – all those text links crammed together in tables and lists –
it is nearly impossible to touch the correct link to navigate from page to page. Sure,
I can zoom in and out, but that’s just a pain.
&lt;/p&gt;
&lt;p&gt;
The web page thing is one area where the iPad is just as bad as anything else. It
isn’t the fault of the devices (Windows or iPad), it is the fault of the web page
designers. And it really isn’t &lt;em&gt;their&lt;/em&gt; fault either, because their primary
audience is keyboard/mouse computer users…
&lt;/p&gt;
&lt;p&gt;
And that’s the challenge we all face. If the traditional computing form factor is
at its end, and I suspect it is, then we’re in for an interesting ride over the next
5-7 years. I don’t think there’s been as big a user interaction transition since we
moved from green-screen terminals to the Windows GUI keyboard/mouse world. 
&lt;/p&gt;
&lt;p&gt;
Moving to a world that is primarily touch is going to affect every app we build in
pretty fundamental ways. When click targets need to be 2-4 times bigger than they
are today, our beautiful high-resolution screens start to seem terribly cramped. And
these battery-conserving end user devices don’t have that high of resolution to start
with, so that makes space &lt;em&gt;really cramped&lt;/em&gt;.
&lt;/p&gt;
&lt;p&gt;
And that means interaction metaphors must change, and UI layouts need to be more dynamic.
That’s the only way to really leverage this limited space and retain usability.
&lt;/p&gt;
&lt;p&gt;
For my part, I think Microsoft is in a great place in this regard. Several years ago
they introduced WPF and XAML, which are awesome tools for addressing these UI requirements.
More recently they streamlined those concepts by creating Silverlight – lighter weight
and more easily deployed, but with the same UI power.
&lt;/p&gt;
&lt;p&gt;
I’d be absolutely shocked if we don’t see some sort of Silverlight-based tablet/slate/pad/whatever
device in the relatively near future. And I’d be shocked if we don’t see the iPad
rapidly evolve based on user feedback.
&lt;/p&gt;
&lt;p&gt;
I really think we’re entering a period of major transition in terms of what it means
to be a “computer user”, and this transition will have a deep impact on how we design
and develop software for these computing appliances/devices.
&lt;/p&gt;
&lt;p&gt;
And it all starts with recognizing that the type of UI we’ve been building since the
early 1990’s is about to become just as obsolete as the green-screen terminal UIs
from the 1980’s.
&lt;/p&gt;
&lt;p&gt;
It took about 5 years for most organizations to transition from green-screen to GUI.
I don’t think the iPad alone is enough to start the next transition, but I think it
is the pebble that will start the avalanche. Once there are other devices (most notably
some Silverlight-based device – in my mind at least), then the real change will start,
because line of business apps will shift, as will consumer apps.
&lt;/p&gt;
&lt;p&gt;
I’m looking forward to the next few years – I think it is going to be a wild ride!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=26706644-7e94-431f-872b-a7f9b0d73c7a" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,26706644-7e94-431f-872b-a7f9b0d73c7a.aspx</comments>
      <category>Architecture</category>
      <category>Programming</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=f34953a5-a950-422e-8c6e-ea1ef1091f0e</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,f34953a5-a950-422e-8c6e-ea1ef1091f0e.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,f34953a5-a950-422e-8c6e-ea1ef1091f0e.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=f34953a5-a950-422e-8c6e-ea1ef1091f0e</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a title="http://www.ruthmalan.com/Journal/2006JournalMay.htm#Need_to_Code" href="http://www.ruthmalan.com/Journal/2006JournalMay.htm#Need_to_Code">http://www.ruthmalan.com/Journal/2006JournalMay.htm#Need_to_Code</a>
        </p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=f34953a5-a950-422e-8c6e-ea1ef1091f0e" />
      </body>
      <title>Do Architects Need to Code?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,f34953a5-a950-422e-8c6e-ea1ef1091f0e.aspx</guid>
      <link>http://www.lhotka.net/weblog/DoArchitectsNeedToCode.aspx</link>
      <pubDate>Thu, 06 May 2010 17:30:45 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a title="http://www.ruthmalan.com/Journal/2006JournalMay.htm#Need_to_Code" href="http://www.ruthmalan.com/Journal/2006JournalMay.htm#Need_to_Code"&gt;http://www.ruthmalan.com/Journal/2006JournalMay.htm#Need_to_Code&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=f34953a5-a950-422e-8c6e-ea1ef1091f0e" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,f34953a5-a950-422e-8c6e-ea1ef1091f0e.aspx</comments>
      <category>Architecture</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=36cd52cf-88e9-4b4b-be8d-9f01489e8963</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,36cd52cf-88e9-4b4b-be8d-9f01489e8963.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,36cd52cf-88e9-4b4b-be8d-9f01489e8963.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=36cd52cf-88e9-4b4b-be8d-9f01489e8963</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
At the <a href="http://chicagocodecamp.com/">Chicago codecamp</a> this past weekend
I was sitting next to a younger guy (probably mid-20’s) who was angsting about what
to learn and not learn.
</p>
        <blockquote>
          <p>
“I’ll never learn C#, it is Microsoft only”
</p>
          <p>
“Should I learn Python? I don’t have a use for it, but people talk about it a lot”
</p>
        </blockquote>
        <p>
And much, much more.
</p>
        <p>
Eventually, for better or worse (and I suspect worse), I suggested that you can’t
go wrong. That <em>every</em> programming language has something to teach, as does
every platform and every architectural model.
</p>
        <p>
For my part, a few years ago I listed many of the <a href="http://www.lhotka.net/weblog/ADifferentTakeOnVBVsC.aspx">languages
I’d learned up to that point</a> – and I don’t regret learning any of them. OK, I
also learned RPG and COBOL, and they weren’t fun – but even those languages taught
me something about how a language <em>shouldn’t</em> work :)  But I must say
that PostScript was a fun language – programming printers is kind of an interesting
thing to do for a while.
</p>
        <p>
Platform-wise, I’ve used Apple II, C64, AmigaOS, OpenVMS, PC DOS, Novell, Windows
3.x, Windows NT, and modern Windows, as well as Unix, Linux and a tiny bit of some
JCL-oriented mainframe via batch processing.
</p>
        <p>
Every platform has something to teach, just like every programming language.
</p>
        <p>
I also suggested that people who’ve only ever done web development, or only ever done
smart-client or terminal-based development – well – they’re crippled. They lack perspective
and it almost always limits their career. If you’ve never written a real distributed
n-tier app, it is really hard to understand the potential of leveraging the all those
resources. If you’ve never written a server-only app (like with a VT100 terminal)
it is really hard to understand the simplicity of a completely self-contained app
model. If you’ve never written a web app it is really hard to understand the intricacies
of managing state in a world where state is so fluid.
</p>
        <p>
Sadly (in my view at least), the angsting 20-something wasn’t interested in hearing
that there’s value in learning all these things. Perhaps he was secretly enjoying
being paralyzed by the fear that he’d “waste” some time learning something that wasn’t
immediately useful. Who knows…
</p>
        <p>
It is true that things aren’t always immediately useful. Most of the classes I took
in college weren’t immediately useful. But even something as non-useful as Minnesota
history turns out to be useful later in life – it is a lot more fun to travel the
state knowing all the interesting things that happened in various places and times.
(I pick that topic, because when I took that class I thought it was a total waste
of time – I needed credits and it seemed easy enough – but now I’m glad it took it!)
</p>
        <p>
(And some classes were just fun. I took a “Foundations of Math” class – my favorite
class ever. We learned how to prove that 1+1=2 – why is that actually how it works?
And why x+y=y+x, but x-z&lt;&gt;z-x. Useful? No. Never in my career have I directly
used any of that. But fun? Oh yeah! :) )
</p>
        <p>
A colleague of mine, some years ago, was on an ASP classic gig. This was in 2004 or
2005. He was very frustrated to be working on obsolete technology, right as .NET 2.0
was about to come out. His fear was that he’d be left behind as ASP.NET moved forward,
and he had 3-4 more months of working on 1997 technologies. My point to him was that
even if the technology wasn’t cutting edge, there were things to be learned about
the business, the management style and the process being used by the client. 
</p>
        <p>
A <em>career</em> isn’t about a given technology, or even a technology wave. It is
a long-term 20-30 year endeavor that requires accumulation of knowledge around technology,
architecture, software design, best practices, business concepts, management concepts,
software process, business process and more.
</p>
        <p>
People who fixate on technology simply can’t go as far in their career as people who
also pay attention to the business, management and inter-personal aspects of the world.
It is the combination of broad sweeping technical knowledge and business knowledge
that <em>really</em> makes a person valuable over the long haul.
</p>
        <p>
“Wasting” 6-8 months on some old technology, or learning a technology that never becomes
mainstream (I learned a language called Envelope of all things – and it was in the
cool-but-useless category) is not that big a deal. That’s maybe 2% of your career.
And if, during that time, you didn’t also learn something interesting about business,
management and process – as well as deepening your appreciation for some aspects of
technology, then I suggest you just weren’t paying attention…
</p>
        <p>
All that said, spending several <em>years</em> working on obsolete technology really
can harm your career – assuming you want to remain a technologist. I’m not saying
you should blissfully remain somewhere like that. 
</p>
        <p>
But I am suggesting that, as a general rule, spending a few weeks or even months learning
and using <em>anything</em> is useful. Nothing is a waste.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=36cd52cf-88e9-4b4b-be8d-9f01489e8963" />
      </body>
      <title>Nothing is a waste</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,36cd52cf-88e9-4b4b-be8d-9f01489e8963.aspx</guid>
      <link>http://www.lhotka.net/weblog/NothingIsAWaste.aspx</link>
      <pubDate>Mon, 03 May 2010 14:41:33 GMT</pubDate>
      <description>&lt;p&gt;
At the &lt;a href="http://chicagocodecamp.com/"&gt;Chicago codecamp&lt;/a&gt; this past weekend
I was sitting next to a younger guy (probably mid-20’s) who was angsting about what
to learn and not learn.
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
“I’ll never learn C#, it is Microsoft only”
&lt;/p&gt;
&lt;p&gt;
“Should I learn Python? I don’t have a use for it, but people talk about it a lot”
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
And much, much more.
&lt;/p&gt;
&lt;p&gt;
Eventually, for better or worse (and I suspect worse), I suggested that you can’t
go wrong. That &lt;em&gt;every&lt;/em&gt; programming language has something to teach, as does
every platform and every architectural model.
&lt;/p&gt;
&lt;p&gt;
For my part, a few years ago I listed many of the &lt;a href="http://www.lhotka.net/weblog/ADifferentTakeOnVBVsC.aspx"&gt;languages
I’d learned up to that point&lt;/a&gt; – and I don’t regret learning any of them. OK, I
also learned RPG and COBOL, and they weren’t fun – but even those languages taught
me something about how a language &lt;em&gt;shouldn’t&lt;/em&gt; work :)&amp;#160; But I must say
that PostScript was a fun language – programming printers is kind of an interesting
thing to do for a while.
&lt;/p&gt;
&lt;p&gt;
Platform-wise, I’ve used Apple II, C64, AmigaOS, OpenVMS, PC DOS, Novell, Windows
3.x, Windows NT, and modern Windows, as well as Unix, Linux and a tiny bit of some
JCL-oriented mainframe via batch processing.
&lt;/p&gt;
&lt;p&gt;
Every platform has something to teach, just like every programming language.
&lt;/p&gt;
&lt;p&gt;
I also suggested that people who’ve only ever done web development, or only ever done
smart-client or terminal-based development – well – they’re crippled. They lack perspective
and it almost always limits their career. If you’ve never written a real distributed
n-tier app, it is really hard to understand the potential of leveraging the all those
resources. If you’ve never written a server-only app (like with a VT100 terminal)
it is really hard to understand the simplicity of a completely self-contained app
model. If you’ve never written a web app it is really hard to understand the intricacies
of managing state in a world where state is so fluid.
&lt;/p&gt;
&lt;p&gt;
Sadly (in my view at least), the angsting 20-something wasn’t interested in hearing
that there’s value in learning all these things. Perhaps he was secretly enjoying
being paralyzed by the fear that he’d “waste” some time learning something that wasn’t
immediately useful. Who knows…
&lt;/p&gt;
&lt;p&gt;
It is true that things aren’t always immediately useful. Most of the classes I took
in college weren’t immediately useful. But even something as non-useful as Minnesota
history turns out to be useful later in life – it is a lot more fun to travel the
state knowing all the interesting things that happened in various places and times.
(I pick that topic, because when I took that class I thought it was a total waste
of time – I needed credits and it seemed easy enough – but now I’m glad it took it!)
&lt;/p&gt;
&lt;p&gt;
(And some classes were just fun. I took a “Foundations of Math” class – my favorite
class ever. We learned how to prove that 1+1=2 – why is that actually how it works?
And why x+y=y+x, but x-z&amp;lt;&amp;gt;z-x. Useful? No. Never in my career have I directly
used any of that. But fun? Oh yeah! :) )
&lt;/p&gt;
&lt;p&gt;
A colleague of mine, some years ago, was on an ASP classic gig. This was in 2004 or
2005. He was very frustrated to be working on obsolete technology, right as .NET 2.0
was about to come out. His fear was that he’d be left behind as ASP.NET moved forward,
and he had 3-4 more months of working on 1997 technologies. My point to him was that
even if the technology wasn’t cutting edge, there were things to be learned about
the business, the management style and the process being used by the client. 
&lt;/p&gt;
&lt;p&gt;
A &lt;em&gt;career&lt;/em&gt; isn’t about a given technology, or even a technology wave. It is
a long-term 20-30 year endeavor that requires accumulation of knowledge around technology,
architecture, software design, best practices, business concepts, management concepts,
software process, business process and more.
&lt;/p&gt;
&lt;p&gt;
People who fixate on technology simply can’t go as far in their career as people who
also pay attention to the business, management and inter-personal aspects of the world.
It is the combination of broad sweeping technical knowledge and business knowledge
that &lt;em&gt;really&lt;/em&gt; makes a person valuable over the long haul.
&lt;/p&gt;
&lt;p&gt;
“Wasting” 6-8 months on some old technology, or learning a technology that never becomes
mainstream (I learned a language called Envelope of all things – and it was in the
cool-but-useless category) is not that big a deal. That’s maybe 2% of your career.
And if, during that time, you didn’t also learn something interesting about business,
management and process – as well as deepening your appreciation for some aspects of
technology, then I suggest you just weren’t paying attention…
&lt;/p&gt;
&lt;p&gt;
All that said, spending several &lt;em&gt;years&lt;/em&gt; working on obsolete technology really
can harm your career – assuming you want to remain a technologist. I’m not saying
you should blissfully remain somewhere like that. 
&lt;/p&gt;
&lt;p&gt;
But I am suggesting that, as a general rule, spending a few weeks or even months learning
and using &lt;em&gt;anything&lt;/em&gt; is useful. Nothing is a waste.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=36cd52cf-88e9-4b4b-be8d-9f01489e8963" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,36cd52cf-88e9-4b4b-be8d-9f01489e8963.aspx</comments>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=b68b1fb2-ee8c-478b-a565-8ceba56faedb</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,b68b1fb2-ee8c-478b-a565-8ceba56faedb.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,b68b1fb2-ee8c-478b-a565-8ceba56faedb.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=b68b1fb2-ee8c-478b-a565-8ceba56faedb</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Here’s a link to an article I wrote on using code-gen vs building a more dynamic runtime:
</p>
        <p>
          <a title="http://msdn.microsoft.com/en-us/library/ff621668.aspx" href="http://msdn.microsoft.com/en-us/library/ff621668.aspx">http://msdn.microsoft.com/en-us/library/ff621668.aspx</a>
        </p>
        <p>
          <strong>Update: </strong>There doesn't appear to be a code download on the Microsoft
site. <a href="http://www.lhotka.net/files/CodeGen-100510.zip">Click here</a> to download
the code.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=b68b1fb2-ee8c-478b-a565-8ceba56faedb" />
      </body>
      <title>Design Time Code Generation and Runtime Model-Driven Generation</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,b68b1fb2-ee8c-478b-a565-8ceba56faedb.aspx</guid>
      <link>http://www.lhotka.net/weblog/DesignTimeCodeGenerationAndRuntimeModelDrivenGeneration.aspx</link>
      <pubDate>Mon, 19 Apr 2010 05:30:24 GMT</pubDate>
      <description>&lt;p&gt;
Here’s a link to an article I wrote on using code-gen vs building a more dynamic runtime:
&lt;/p&gt;
&lt;p&gt;
&lt;a title=http://msdn.microsoft.com/en-us/library/ff621668.aspx href="http://msdn.microsoft.com/en-us/library/ff621668.aspx"&gt;http://msdn.microsoft.com/en-us/library/ff621668.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Update: &lt;/strong&gt;There doesn't appear to be a code download on the Microsoft
site. &lt;a href="http://www.lhotka.net/files/CodeGen-100510.zip"&gt;Click here&lt;/a&gt; to download
the code.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=b68b1fb2-ee8c-478b-a565-8ceba56faedb" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,b68b1fb2-ee8c-478b-a565-8ceba56faedb.aspx</comments>
      <category>Microsoft .NET</category>
      <category>Programming</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=7d196742-5d55-49e8-8798-b59d1bd9f93c</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,7d196742-5d55-49e8-8798-b59d1bd9f93c.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,7d196742-5d55-49e8-8798-b59d1bd9f93c.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=7d196742-5d55-49e8-8798-b59d1bd9f93c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m working on a number of things at the moment. Most notably the <a href="http://download.lhotka.net/Default.aspx?t=SLVid01">CSLA
.NET for Silverlight video series</a> that will be available in the very near future
(it turns out that creating a video series is a lot of work!). And of course I’m prepping
for numerous <a href="http://www.lhotka.net/Presentations.aspx">upcoming speaking
engagements</a>, and I’d love to see you at them – please come up and say hi if you
get a chance.
</p>
        <p>
But I’m also working on some content around <a href="http://msdn.com/oslo">Microsoft
Oslo</a>, MGrammar and related concepts. To do this, I’m creating a prototype “MCsla”
language (DSL) that allows the creation of CSLA .NET business objects (and more) with
very concise syntax. I’ll probably be blogging about this a bit over the next couple
weeks, but the goal is to end up with some in-depth content that really walks through
everything in detail.
</p>
        <p>
My goal is for the prototype to handle CSLA <em>editable root</em> objects, but covers
business rules, validation rules and per-type and per-property authorization rules.
Here’s a conceptual example:
</p>
        <blockquote>
          <p>
            <font face="Courier New">Object foo 
<br />
{ 
<br />
    // per-type authz 
<br />
    Allow Create ("Admin"); 
<br />
    Allow Edit ("Admin", "Clerk" ); 
<br /><br />
    // property definitions 
<br /><br />
    Public ReadOnly int Id; 
<br /></font>
            <font face="Courier New">
              <br />
    Public Integer Value { 
<br />
       // per-property authz 
<br />
       Allow Write ("Clerk" ); 
<br />
       // business/validation rules 
<br />
       Rule MinValue (1 ); 
<br />
       Rule MaxValue (50 ); 
<br />
    } 
<br />
}</font>
          </p>
        </blockquote>
        <p>
But what I’ve realized as I’ve gotten further into this, is that I made a tactical
error.
</p>
        <p>
A lot of people, including myself, have been viewing MGrammar as a way to create a
DSL that is really a front-end to a code generator. My friend <a href="http://www.justnbusiness.com/">Justin
Chase</a> has done a lot of very cool work in this space, and he’s not alone.
</p>
        <p>
But it turns out that if you want to really leverage <em>Microsoft Oslo</em> and not
just MGrammar, then this is not about creating a code generator. And what I’m finding
is that starting with the DSL is a terrible mistake!
</p>
        <p>
In fact, the idea behind MOslo is that the DSL is just a way to get metadata into
the Oslo repository. And you can use other techniques to get metadata into the repository
as well, including the graphical “Quadrant” tool.
</p>
        <p>
But my next question, and I’m guessing yours too, is that if all we do is put metadata
into the repository, what good is that???
</p>
        <p>
This is where a <em>runtime</em> comes into play. A runtime is a program that reads
the metadata from the repository and basically executes the metadata.
</p>
        <p>
I always had a mental picture of MOslo “projecting” the metadata into the runtime.
But that’s not accurate. It is the runtime that “pulls” metadata from the repository
and then uses it.
</p>
        <p>
And that’s OK. The point is that the runtime is this application that interprets/compiles/uses/consumes
the metadata to end up with something that actually does some work.
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/ThebeginningsofMCsla_92A7/image_6.png">
            <img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/ThebeginningsofMCsla_92A7/image_thumb_2.png" width="584" height="500" />
          </a>
        </p>
        <p>
What I’m learning through this process, is that the DSL exists to service the metadata
in the repository. But it is the <em>runtime that defines the metadata</em>. The runtime
consumes the metadata, so the metadata exists to serve the needs of the runtime.
</p>
        <p>
In other words, I should have started with the runtime <em>first</em> so I knew what
metadata was required, so I could design a DSL that was capable of expressing and
capturing that metadata.
</p>
        <p>
The example MCsla code you see above is OK, but it turns out that it is missing some
important bits of information that my runtime needs to function. So while the DSL
expresses the important CSLA .NET concepts, it doesn’t express everything necessary
to generate a useful runtime result…
</p>
        <p>
So at the moment I’ve stopped working on the DSL, and am focusing on creating a working
runtime. One that can execute the metadata in a way that the user gets a dynamically
created UI (in WPF) that is bound to a dynamically created CSLA .NET business object,
that leverages a dynamically created data access layer (using the CSLA .NET 3.6 ObjectFactory
concept). I’m not dynamically creating the database, because I think that’s unrealistic
in any real-world scenario. We all have pre-existing databases after all.
</p>
        <p>
Once I get the runtime working (and it is close – here’s a screenshot of a simple
object, showing how the dynamic WPF UI is running against an object with business
rules, buttons bound to the CslaDataProvider through commanding and all the other
nice CSLA features.
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/ThebeginningsofMCsla_92A7/image_8.png">
            <img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/ThebeginningsofMCsla_92A7/image_thumb_3.png" width="551" height="480" />
          </a>
        </p>
        <p>
Not that my UI is a work of art, but still :)
</p>
        <p>
I have a lot more to do, but it is now clear that starting with the runtime makes
a lot more sense than starting with the DSL.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=7d196742-5d55-49e8-8798-b59d1bd9f93c" />
      </body>
      <title>The beginnings of MCsla</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,7d196742-5d55-49e8-8798-b59d1bd9f93c.aspx</guid>
      <link>http://www.lhotka.net/weblog/TheBeginningsOfMCsla.aspx</link>
      <pubDate>Fri, 10 Apr 2009 15:30:07 GMT</pubDate>
      <description>&lt;p&gt;
I’m working on a number of things at the moment. Most notably the &lt;a href="http://download.lhotka.net/Default.aspx?t=SLVid01"&gt;CSLA
.NET for Silverlight video series&lt;/a&gt; that will be available in the very near future
(it turns out that creating a video series is a lot of work!). And of course I’m prepping
for numerous &lt;a href="http://www.lhotka.net/Presentations.aspx"&gt;upcoming speaking
engagements&lt;/a&gt;, and I’d love to see you at them – please come up and say hi if you
get a chance.
&lt;/p&gt;
&lt;p&gt;
But I’m also working on some content around &lt;a href="http://msdn.com/oslo"&gt;Microsoft
Oslo&lt;/a&gt;, MGrammar and related concepts. To do this, I’m creating a prototype “MCsla”
language (DSL) that allows the creation of CSLA .NET business objects (and more) with
very concise syntax. I’ll probably be blogging about this a bit over the next couple
weeks, but the goal is to end up with some in-depth content that really walks through
everything in detail.
&lt;/p&gt;
&lt;p&gt;
My goal is for the prototype to handle CSLA &lt;em&gt;editable root&lt;/em&gt; objects, but covers
business rules, validation rules and per-type and per-property authorization rules.
Here’s a conceptual example:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;font face="Courier New"&gt;Object foo 
&lt;br&gt;
{ 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // per-type authz 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Allow Create ("Admin"); 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Allow Edit ("Admin", "Clerk" ); 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // property definitions 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public ReadOnly int Id; 
&lt;br&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Public Integer Value { 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // per-property authz 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Allow Write ("Clerk" ); 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // business/validation rules 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rule MinValue (1 ); 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rule MaxValue (50 ); 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; } 
&lt;br&gt;
}&lt;/font&gt; 
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
But what I’ve realized as I’ve gotten further into this, is that I made a tactical
error.
&lt;/p&gt;
&lt;p&gt;
A lot of people, including myself, have been viewing MGrammar as a way to create a
DSL that is really a front-end to a code generator. My friend &lt;a href="http://www.justnbusiness.com/"&gt;Justin
Chase&lt;/a&gt; has done a lot of very cool work in this space, and he’s not alone.
&lt;/p&gt;
&lt;p&gt;
But it turns out that if you want to really leverage &lt;em&gt;Microsoft Oslo&lt;/em&gt; and not
just MGrammar, then this is not about creating a code generator. And what I’m finding
is that starting with the DSL is a terrible mistake!
&lt;/p&gt;
&lt;p&gt;
In fact, the idea behind MOslo is that the DSL is just a way to get metadata into
the Oslo repository. And you can use other techniques to get metadata into the repository
as well, including the graphical “Quadrant” tool.
&lt;/p&gt;
&lt;p&gt;
But my next question, and I’m guessing yours too, is that if all we do is put metadata
into the repository, what good is that???
&lt;/p&gt;
&lt;p&gt;
This is where a &lt;em&gt;runtime&lt;/em&gt; comes into play. A runtime is a program that reads
the metadata from the repository and basically executes the metadata.
&lt;/p&gt;
&lt;p&gt;
I always had a mental picture of MOslo “projecting” the metadata into the runtime.
But that’s not accurate. It is the runtime that “pulls” metadata from the repository
and then uses it.
&lt;/p&gt;
&lt;p&gt;
And that’s OK. The point is that the runtime is this application that interprets/compiles/uses/consumes
the metadata to end up with something that actually does some work.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/ThebeginningsofMCsla_92A7/image_6.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/ThebeginningsofMCsla_92A7/image_thumb_2.png" width=584 height=500&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
What I’m learning through this process, is that the DSL exists to service the metadata
in the repository. But it is the &lt;em&gt;runtime that defines the metadata&lt;/em&gt;. The runtime
consumes the metadata, so the metadata exists to serve the needs of the runtime.
&lt;/p&gt;
&lt;p&gt;
In other words, I should have started with the runtime &lt;em&gt;first&lt;/em&gt; so I knew what
metadata was required, so I could design a DSL that was capable of expressing and
capturing that metadata.
&lt;/p&gt;
&lt;p&gt;
The example MCsla code you see above is OK, but it turns out that it is missing some
important bits of information that my runtime needs to function. So while the DSL
expresses the important CSLA .NET concepts, it doesn’t express everything necessary
to generate a useful runtime result…
&lt;/p&gt;
&lt;p&gt;
So at the moment I’ve stopped working on the DSL, and am focusing on creating a working
runtime. One that can execute the metadata in a way that the user gets a dynamically
created UI (in WPF) that is bound to a dynamically created CSLA .NET business object,
that leverages a dynamically created data access layer (using the CSLA .NET 3.6 ObjectFactory
concept). I’m not dynamically creating the database, because I think that’s unrealistic
in any real-world scenario. We all have pre-existing databases after all.
&lt;/p&gt;
&lt;p&gt;
Once I get the runtime working (and it is close – here’s a screenshot of a simple
object, showing how the dynamic WPF UI is running against an object with business
rules, buttons bound to the CslaDataProvider through commanding and all the other
nice CSLA features.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/ThebeginningsofMCsla_92A7/image_8.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=image border=0 alt=image src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/ThebeginningsofMCsla_92A7/image_thumb_3.png" width=551 height=480&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Not that my UI is a work of art, but still :)
&lt;/p&gt;
&lt;p&gt;
I have a lot more to do, but it is now clear that starting with the runtime makes
a lot more sense than starting with the DSL.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=7d196742-5d55-49e8-8798-b59d1bd9f93c" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,7d196742-5d55-49e8-8798-b59d1bd9f93c.aspx</comments>
      <category>CSLA .NET</category>
      <category>MOslo</category>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=b7693faa-064b-48f7-ad1f-ee58864e09d7</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,b7693faa-064b-48f7-ad1f-ee58864e09d7.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,b7693faa-064b-48f7-ad1f-ee58864e09d7.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=b7693faa-064b-48f7-ad1f-ee58864e09d7</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
For some years now there’s been this background hum about “domain specific languages”
or DSLs. Whether portrayed as graphical cartoon-to-code, or specialized textual constructs,
DSLs are programming languages designed to abstract the concepts around a specific
problem domain.
</p>
        <p>
A couple weeks ago I delivered the “Lap around Oslo” talk for the MDC in Minneapolis.
That was fun, because I got to demonstrate MSchema (a DSL for creating SQL tables
and inserting data), and show how it can be used as a building-block to create a programming
language that looks like this:
</p>
        <p>
          <em>“Moving Pictures” by “Rush” is awesome!</em>
        </p>
        <p>
It is hard to believe that this sentence is constructed using a programming language,
but that’s the power of a DSL. That’s just fun!
</p>
        <p>
I also got to demonstrate MService, a DSL for creating WCF services implemented using
Windows Workflow (WF). The entire thing is textual, even the workflow definition.
There’s no XML, no C#-class-as-a-service, nothing awkward at all. The entire thing
is constructed using terms you’d use when speaking aloud about building a service.
</p>
        <p>
A couple years ago I had a discussion with some guys in Microsoft’s connected systems
division. My contention in that conversation was that a language truly centered around
services/SOA would have a first-class construct for a service. That C# or VB are poor
languages for this, because we have to use a class and fake the service construct
through inheritance or interfaces.
</p>
        <p>
This MService DSL is exactly the kind of thing I was talking about, and in this regard
DSLs are very cool!
</p>
        <p>
So they are fun. They are cool. So why might DSLs be a bad idea?
</p>
        <p>
If you’ve been in the industry long enough, you may have encountered companies who
built their enterprise systems on in-house languages. Often a variation on Basic,
C or some other common language. Some hot-shot developer decided none of the existing
languages at the time could quite fit the bill. Or some adventurous business person
didn’t want the vendor lock-in that came with using VendorX’s compiler. So these companies
built their own languages (usually interpreted, sometimes compiled). And they built
entire enterprise systems on this one-off language.
</p>
        <p>
As a consultant through the 1990’s, I encountered a number of these companies. You
might think this was rare, but it was not all that rare – surprising but true. They
were all in a bad spot, having a lot of software built on a language and tools that
were known by absolutely no one outside that company. To hire a programmer, they had
to con someone into learning a set of totally dead-end skills. And if a programmer
left, the company not only lost domain knowledge, but a very large percentage of the
global population of programmers who knew their technology.
</p>
        <p>
How does this relate to DSLs?
</p>
        <p>
Imagine you work at a bio-medical manufacturing company. Suppose some hot-shot developer
falls in love with Microsoft’s M language and creates this really awesome programming
language for bio-medical manufacturing software development. A language that abstracts
concepts, and allows developers to write a line of this DSL instead of a page of C#.
Suppose the company loves this DSL, and it spreads through all the enterprise systems.
</p>
        <p>
Then fast-forward maybe 5 years. Now this company has major enterprise systems written
in a language known only by the people who work there. To hire a programmer, they
need to con someone into learning a set of totally dead-end skills. And if a programmer
leaves, the company has not only lost domain knowledge, but also one of the few people
in the world who know this DSL.
</p>
        <p>
To me, this is the dark side of the DSL movement.
</p>
        <p>
It is one thing for a vendor like Microsoft to use M to create a limited set of globally
standard DSLs for things like creating services, configuring servers or other broad
tasks. It is a whole different issue for individual companies to invent their own
one-off languages.
</p>
        <p>
Sure, DSLs can provide amazing levels of abstraction, and thus productivity. But that
doesn’t come for free. I suspect this will become a major issue over the next decade,
as tools like Oslo and related DSL concepts work their way into the mainstream.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=b7693faa-064b-48f7-ad1f-ee58864e09d7" />
      </body>
      <title>DSLs &amp;ndash; fun, cool, but maybe a bad idea?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,b7693faa-064b-48f7-ad1f-ee58864e09d7.aspx</guid>
      <link>http://www.lhotka.net/weblog/DSLsNdashFunCoolButMaybeABadIdea.aspx</link>
      <pubDate>Fri, 23 Jan 2009 23:30:57 GMT</pubDate>
      <description>&lt;p&gt;
For some years now there’s been this background hum about “domain specific languages”
or DSLs. Whether portrayed as graphical cartoon-to-code, or specialized textual constructs,
DSLs are programming languages designed to abstract the concepts around a specific
problem domain.
&lt;/p&gt;
&lt;p&gt;
A couple weeks ago I delivered the “Lap around Oslo” talk for the MDC in Minneapolis.
That was fun, because I got to demonstrate MSchema (a DSL for creating SQL tables
and inserting data), and show how it can be used as a building-block to create a programming
language that looks like this:
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;“Moving Pictures” by “Rush” is awesome!&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
It is hard to believe that this sentence is constructed using a programming language,
but that’s the power of a DSL. That’s just fun!
&lt;/p&gt;
&lt;p&gt;
I also got to demonstrate MService, a DSL for creating WCF services implemented using
Windows Workflow (WF). The entire thing is textual, even the workflow definition.
There’s no XML, no C#-class-as-a-service, nothing awkward at all. The entire thing
is constructed using terms you’d use when speaking aloud about building a service.
&lt;/p&gt;
&lt;p&gt;
A couple years ago I had a discussion with some guys in Microsoft’s connected systems
division. My contention in that conversation was that a language truly centered around
services/SOA would have a first-class construct for a service. That C# or VB are poor
languages for this, because we have to use a class and fake the service construct
through inheritance or interfaces.
&lt;/p&gt;
&lt;p&gt;
This MService DSL is exactly the kind of thing I was talking about, and in this regard
DSLs are very cool!
&lt;/p&gt;
&lt;p&gt;
So they are fun. They are cool. So why might DSLs be a bad idea?
&lt;/p&gt;
&lt;p&gt;
If you’ve been in the industry long enough, you may have encountered companies who
built their enterprise systems on in-house languages. Often a variation on Basic,
C or some other common language. Some hot-shot developer decided none of the existing
languages at the time could quite fit the bill. Or some adventurous business person
didn’t want the vendor lock-in that came with using VendorX’s compiler. So these companies
built their own languages (usually interpreted, sometimes compiled). And they built
entire enterprise systems on this one-off language.
&lt;/p&gt;
&lt;p&gt;
As a consultant through the 1990’s, I encountered a number of these companies. You
might think this was rare, but it was not all that rare – surprising but true. They
were all in a bad spot, having a lot of software built on a language and tools that
were known by absolutely no one outside that company. To hire a programmer, they had
to con someone into learning a set of totally dead-end skills. And if a programmer
left, the company not only lost domain knowledge, but a very large percentage of the
global population of programmers who knew their technology.
&lt;/p&gt;
&lt;p&gt;
How does this relate to DSLs?
&lt;/p&gt;
&lt;p&gt;
Imagine you work at a bio-medical manufacturing company. Suppose some hot-shot developer
falls in love with Microsoft’s M language and creates this really awesome programming
language for bio-medical manufacturing software development. A language that abstracts
concepts, and allows developers to write a line of this DSL instead of a page of C#.
Suppose the company loves this DSL, and it spreads through all the enterprise systems.
&lt;/p&gt;
&lt;p&gt;
Then fast-forward maybe 5 years. Now this company has major enterprise systems written
in a language known only by the people who work there. To hire a programmer, they
need to con someone into learning a set of totally dead-end skills. And if a programmer
leaves, the company has not only lost domain knowledge, but also one of the few people
in the world who know this DSL.
&lt;/p&gt;
&lt;p&gt;
To me, this is the dark side of the DSL movement.
&lt;/p&gt;
&lt;p&gt;
It is one thing for a vendor like Microsoft to use M to create a limited set of globally
standard DSLs for things like creating services, configuring servers or other broad
tasks. It is a whole different issue for individual companies to invent their own
one-off languages.
&lt;/p&gt;
&lt;p&gt;
Sure, DSLs can provide amazing levels of abstraction, and thus productivity. But that
doesn’t come for free. I suspect this will become a major issue over the next decade,
as tools like Oslo and related DSL concepts work their way into the mainstream.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=b7693faa-064b-48f7-ad1f-ee58864e09d7" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,b7693faa-064b-48f7-ad1f-ee58864e09d7.aspx</comments>
      <category>Programming</category>
    </item>
  </channel>
</rss>