<?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 - Architecture</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>Thu, 14 Feb 2013 16:39:23 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=4a9a1e7e-3459-4ff0-8b00-a9759008ef0e</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,4a9a1e7e-3459-4ff0-8b00-a9759008ef0e.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,4a9a1e7e-3459-4ff0-8b00-a9759008ef0e.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=4a9a1e7e-3459-4ff0-8b00-a9759008ef0e</wfw:commentRss>
      <slash:comments>8</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In a recent email thread I ended up writing a lengthy bit of content summarizing some
of my thoughts around the idea of automatically projecting js code into an HTML 5
(h5js) browser app.
</p>
        <p>
Another participant in the thread mentioned that he’s a strong proponent of separation
of concerns, and in particular keeping the “model” separate from data access. In his
context the “model” is basically a set of data container or DTO objects. My response:
</p>
        <p>
-----------------------------
</p>
        <p>
I agree about separation of concerns at the lower levels.
</p>
        <p>
I am a firm believer in domain focused business objects though. In the use of “real”
OOD, which largely eliminates the need for add-on hacks like a viewmodel.
</p>
        <p>
In other words, apps should have clearly defined logical layers. I use this model:
</p>
        <blockquote>
          <p>
Interface 
<br />
Interface control 
<br />
Business 
<br />
Data access 
<br />
Data storage
</p>
        </blockquote>
        <p>
This model works for pretty much everything: web apps, smart client apps, service
apps, workflow tasks (apps), etc.
</p>
        <p>
The key is that the business layer consists of honest-to-god real life business domain
objects. These are designed using OOD so they reflect the requirements of the user
scenario, not the database design.
</p>
        <p>
If you have data-centric objects, they’ll live in the Data access layer. And that’s
pretty common when using any ORM or something like EF, where the tools help you create
data-centric types. That’s very useful – then all you need to do is use object:object
mapping (OOM) to get the data from the data-centric objects into the more meaningful
business domain objects.
</p>
        <p>
At no point should any layer talk to the database other than the Data access layer.
And at no point should the Interface/Interface control layers interact with anything
except the Business layer.
</p>
        <p>
Given all that, the question with smart client web apps (as I’ve taken to calling
these weird h5js/.NET hybrids) is whether you are using a service-oriented architecture
or an n-tier architecture. This choice must be made _<i>first</i>_ because it impacts
every other decision.
</p>
        <p>
The service-oriented approach says you are creating a system composed of multiple
apps. In our discussion this would be the smart client h5js app and the server-side
service app. SOA mandates that these apps don’t trust each other, and that they communicate
through loosely coupled and clearly defined interface contracts. That allows the apps
to version independently. And the lack of trust means that data flowing from the consuming
app (h5js) to the service app isn’t trusted – which makes sense given how easy it
is to hack anything running in the browser. In this world each app should (imo) consist
of a series of layers such as those I mentioned earlier.
</p>
        <p>
The n-tier approach says you are creating one app with multiple layers, and those
layers might be deployed on different physical tiers. Because this is one app, the
layers can and should have reasonable levels of trust between them. As a result you
shouldn’t feel the need to re-run business logic just because the data flowed from
one layer/tier to another (completely different from SOA).
</p>
        <p>
N-tier can be challenging because you typically have to decide where to physically
put the business layer: on the client to give the user a rich and interactive experience,
or on the server for more control and easier maintenance. In the case of my CSLA .NET
framework I embraced the concept of _<i>mobile objects</i>_ where the business layer
literally runs on the client AND on the server, allowing you to easily run business
logic where most appropriate. Sadly this requires that the same code can actually
run on the client and server, which isn’t the case when the client and server are
disparate platforms (e.g. h5js and .NET).
</p>
        <p>
This idea of projecting server-side business domain objects into the client fits naturally
into the n-tier world. This has been an area of deep discussion for months within
the CSLA dev team – how to make it practical to translate the rich domain business
behaviors into js without imposing a major burden of writing js alongside C#.
</p>
        <p>
CSLA objects have a very rich set of rules and behaviors that ideally would be automatically
projected into a js business layer for use by the smart client h5js Interface and
Interface control layers. I love this idea – but the trick is to make it possible
such that there’s not a major new burden for developers.
</p>
        <p>
This idea of projecting server-side business domain objects into the client is a less
natural fit for a service-oriented system, because there’s a clear and obvious level
of coupling between the service app and the h5js app (given that parts of the h5js
app literally generate based on the service app). I’m not sure this is a total roadblock,
but you have to go into this recognizing that such an approach compromises the primary
purpose of SOA, which is loose coupling between the apps in the system…
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=4a9a1e7e-3459-4ff0-8b00-a9759008ef0e" />
      </body>
      <title>Projecting js code from a .NET business layer</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,4a9a1e7e-3459-4ff0-8b00-a9759008ef0e.aspx</guid>
      <link>http://www.lhotka.net/weblog/ProjectingJsCodeFromANETBusinessLayer.aspx</link>
      <pubDate>Thu, 14 Feb 2013 16:39:23 GMT</pubDate>
      <description>&lt;p&gt;
In a recent email thread I ended up writing a lengthy bit of content summarizing some
of my thoughts around the idea of automatically projecting js code into an HTML 5
(h5js) browser app.
&lt;/p&gt;
&lt;p&gt;
Another participant in the thread mentioned that he’s a strong proponent of separation
of concerns, and in particular keeping the “model” separate from data access. In his
context the “model” is basically a set of data container or DTO objects. My response:
&lt;/p&gt;
&lt;p&gt;
-----------------------------
&lt;/p&gt;
&lt;p&gt;
I agree about separation of concerns at the lower levels.
&lt;/p&gt;
&lt;p&gt;
I am a firm believer in domain focused business objects though. In the use of “real”
OOD, which largely eliminates the need for add-on hacks like a viewmodel.
&lt;/p&gt;
&lt;p&gt;
In other words, apps should have clearly defined logical layers. I use this model:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
Interface 
&lt;br /&gt;
Interface control 
&lt;br /&gt;
Business 
&lt;br /&gt;
Data access 
&lt;br /&gt;
Data storage
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
This model works for pretty much everything: web apps, smart client apps, service
apps, workflow tasks (apps), etc.
&lt;/p&gt;
&lt;p&gt;
The key is that the business layer consists of honest-to-god real life business domain
objects. These are designed using OOD so they reflect the requirements of the user
scenario, not the database design.
&lt;/p&gt;
&lt;p&gt;
If you have data-centric objects, they’ll live in the Data access layer. And that’s
pretty common when using any ORM or something like EF, where the tools help you create
data-centric types. That’s very useful – then all you need to do is use object:object
mapping (OOM) to get the data from the data-centric objects into the more meaningful
business domain objects.
&lt;/p&gt;
&lt;p&gt;
At no point should any layer talk to the database other than the Data access layer.
And at no point should the Interface/Interface control layers interact with anything
except the Business layer.
&lt;/p&gt;
&lt;p&gt;
Given all that, the question with smart client web apps (as I’ve taken to calling
these weird h5js/.NET hybrids) is whether you are using a service-oriented architecture
or an n-tier architecture. This choice must be made _&lt;i&gt;first&lt;/i&gt;_ because it impacts
every other decision.
&lt;/p&gt;
&lt;p&gt;
The service-oriented approach says you are creating a system composed of multiple
apps. In our discussion this would be the smart client h5js app and the server-side
service app. SOA mandates that these apps don’t trust each other, and that they communicate
through loosely coupled and clearly defined interface contracts. That allows the apps
to version independently. And the lack of trust means that data flowing from the consuming
app (h5js) to the service app isn’t trusted – which makes sense given how easy it
is to hack anything running in the browser. In this world each app should (imo) consist
of a series of layers such as those I mentioned earlier.
&lt;/p&gt;
&lt;p&gt;
The n-tier approach says you are creating one app with multiple layers, and those
layers might be deployed on different physical tiers. Because this is one app, the
layers can and should have reasonable levels of trust between them. As a result you
shouldn’t feel the need to re-run business logic just because the data flowed from
one layer/tier to another (completely different from SOA).
&lt;/p&gt;
&lt;p&gt;
N-tier can be challenging because you typically have to decide where to physically
put the business layer: on the client to give the user a rich and interactive experience,
or on the server for more control and easier maintenance. In the case of my CSLA .NET
framework I embraced the concept of _&lt;i&gt;mobile objects&lt;/i&gt;_ where the business layer
literally runs on the client AND on the server, allowing you to easily run business
logic where most appropriate. Sadly this requires that the same code can actually
run on the client and server, which isn’t the case when the client and server are
disparate platforms (e.g. h5js and .NET).
&lt;/p&gt;
&lt;p&gt;
This idea of projecting server-side business domain objects into the client fits naturally
into the n-tier world. This has been an area of deep discussion for months within
the CSLA dev team – how to make it practical to translate the rich domain business
behaviors into js without imposing a major burden of writing js alongside C#.
&lt;/p&gt;
&lt;p&gt;
CSLA objects have a very rich set of rules and behaviors that ideally would be automatically
projected into a js business layer for use by the smart client h5js Interface and
Interface control layers. I love this idea – but the trick is to make it possible
such that there’s not a major new burden for developers.
&lt;/p&gt;
&lt;p&gt;
This idea of projecting server-side business domain objects into the client is a less
natural fit for a service-oriented system, because there’s a clear and obvious level
of coupling between the service app and the h5js app (given that parts of the h5js
app literally generate based on the service app). I’m not sure this is a total roadblock,
but you have to go into this recognizing that such an approach compromises the primary
purpose of SOA, which is loose coupling between the apps in the system…
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=4a9a1e7e-3459-4ff0-8b00-a9759008ef0e" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,4a9a1e7e-3459-4ff0-8b00-a9759008ef0e.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>h5js</category>
      <category>Microsoft .NET</category>
      <category>Web</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=12925691-3e22-41e2-9d8f-a66c115e8b8c</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,12925691-3e22-41e2-9d8f-a66c115e8b8c.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,12925691-3e22-41e2-9d8f-a66c115e8b8c.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=12925691-3e22-41e2-9d8f-a66c115e8b8c</wfw:commentRss>
      <slash:comments>22</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <em>Disclaimer: I know nothing. The following is (hopefully) well educated speculation
on my part. Time will tell whether I’m right.</em>
        </p>
        <p>
I really like Silverlight. I’ve been a strong proponent of <sub></sub>Silverlight
since 2007 when I rushed to port CSLA .NET to the new platform.
</p>
        <p>
In fact, Magenic provided me with a dev and test team to make that transition happen,
because we all saw the amazing potential of Silverlight.
</p>
        <p>
And it has been a good few years.
</p>
        <p>
But let’s face reality. Microsoft has invested who-knows-how-much money to build WinRT,
and no matter how you look at it, WinRT is the replacement for Win32. That means all
the stuff that runs on Win32 is “dead”. This includes Silverlight, Windows Forms,
WPF, console apps – everything.
</p>
        <p>
(this is partially in answer to <a href="http://www.zdnet.com/blog/microsoft/will-there-be-a-silverlight-6-and-does-it-matter/11180">Mary-Jo’s
article on Silverlight 5</a>)
</p>
        <p>
I wouldn’t be surprised if Silverlight 5 was the last version. I also wouldn’t be
surprised if .NET 4.5 was the last version for the Win32 client, and that future versions
of .NET were released for servers and Azure only.
</p>
        <p>
Before you panic though, remember that VB6 has been “dead” for well over a decade.
It died at the PDC in 1999, along with COM. But you still use VB6 and/or COM? Or at
least you know organizations who do? How can that be when it is dead??
</p>
        <p>
That’s my point. “dead” isn’t really dead.
</p>
        <p>
Just how long do you think people (like me and you) will continue to run Win32-based
operating systems and applications? At least 10 years, and many will probably run
15-20 years into the future. This is the rate of change that exists in the corporate
world. At least that’s been my observation for the past couple decades.
</p>
        <p>
Microsoft supports their technologies for 10 years after a final release. So even
if SL5 is the end (and they haven’t said it is), that gives us 10 years of supported
Silverlight usage. The same for the other various .NET and Win32 technologies.
</p>
        <p>
That’s plenty of time for Microsoft to get WinRT mature, and to allow us to migrate
to that platform over a period of years.
</p>
        <p>
I don’t expect WinRT 1.0 (the Windows 8 version) to be capable of replacing Win32
or .NET. I rather expect it to be pretty crippled in many respects. Much like VB 1.0
(and 2.0), .NET 1.0 and 1.1, Silverlight 1 and 2, etc.
</p>
        <p>
But Windows 9 or Windows 10 (WinRT 2.0 or 3.0) should be quite capable of replacing
Win32 and .NET and Silverlight.
</p>
        <p>
If we assume Win8 comes out in 2012, and that Microsoft does a forced march release
of 9 and 10 every two years, that means 2016 will give us WinRT 3.0. And if we hold
to the basic truism that Microsoft always gets it right on their third release, that’ll
be the one to target.
</p>
        <p>
I think it is also reasonable to expect that Win9 and Win10 will probably continue
to have the “blue side” (see my <a href="http://www.lhotka.net/weblog/UpdatedWin8DevPlatformDiagram.aspx">Windows
8 dev platform</a> post), meaning Win32, .NET, and Silverlight will continue to be
released and therefore supported over that time. They may not <em>change</em> over
that time, but they’ll be there, and they’ll be supported – or so goes my theory.
</p>
        <p>
This means that in 2016 the clock might really start for migration from Win32/.NET/Silverlight
to WinRT.
</p>
        <p>
Yes, I expect that a lot of us will build things for WinRT sooner than 2016. I certainly
hope so, because it looks like a lot of fun!
</p>
        <p>
But from a corporate perspective, where things move so slowly, this is probably good
news. Certain apps can be ported sooner, but big and important apps can move slowly
over time.
</p>
        <p>
What to do in the meantime? Between now and 2016?
</p>
        <p>
Focus on XAML, and on n-tier or SOA async server access as architectural models.
</p>
        <p>
Or focus on HTML 5 (soon to be HTML 6 fwiw, and possibly HTML 7 by 2016 for all we
know).
</p>
        <p>
I’m focusing on XAML, creating a CSLA 4 version 4.5 release that supports .NET 4.5
on servers, Azure, Windows (Win32), and Windows (WinRT). And Silverlight 5 of course.
</p>
        <p>
In fact, the plan is for a version 4.3 release to support Silverlight 5, then version
4.5 with support for .NET 4.5 and WinRT.
</p>
        <p>
I suspect that you can use Silverlight or WPF as a bridge to WinRT. The real key is
architecture.
</p>
        <ol>
          <li>
An n-tier architecture is fine, as long as the data access layer is running on a server,
and the client uses async calls to interact with the server. WinRT requires a lot
of async, at a minimum all server interactions. Silverlight forces you to adopt this
architecture already, so it is a natural fit. WPF doesn’t force the issue, but you
can choose to do “the right thing”.</li>
          <li>
You can also build your client applications to be “edge applications” – on the edge
of a service-oriented system. This is a less mature technology area, and it is more
costly. But it is also a fine architecture for environments composed of many disparate
applications that need to interact as a loosely coupled system. Again, all service
interactions by the edge applications (the ones running on the clients) must be async.</li>
          <li>
Or you can build “hybrid solutions”, where individual applications are built using
n-tier architectures (with async server calls). And where <em>some</em> of those applications
also expose service interfaces so they can participate as part of a broader service-oriented
system.</li>
        </ol>
        <p>
I favor option 3. I don’t like to accept the cost and performance ramifications of
SOA when building <em>an application</em>, so I’d prefer to use a faster and cheaper
n-tier architecture. At the same time, many applications do need to interact with
each other, and the requirement to create “application mashups” through edge applications
happens from time to time. So building my n-tier applications to have dual interfaces
(XAML and JSON for example) is a perfect compromise.
</p>
        <p>
The direct users of my application get n-tier performance and maintainability. And
the broader organization can access my slower-moving, standards-based, contractual
service interface. It is the best of both worlds.
</p>
        <p>
So do I care if Silverlight 5 is the last version of Silverlight?
</p>
        <p>
Only if WPF continues to evolve prior to us all moving to WinRT. If WPF continues
to evolve, I would expect Silverlight to, at a minimum, keep up. Otherwise Microsoft
has led a lot of people down a dead-end path, and that’s a serious betrayal of trust.
</p>
        <p>
But if my suspicions are correct, we won’t see anything but bug fixes for WPF or Silverlight
for many years. I rather expect that these two technologies just became the next Windows
Forms. You’ll notice that WinForms hasn’t had anything but bug fixes for 6 years right?
The precedent is there for a UI technology to be “supported, stable, and stagnant”
for a very long time, and this is my expectation for WPF/SL.
</p>
        <p>
And if that’s the case, then I don’t care at all about a Silverlight 6 release. We
can use WPF/SL in their current form, right up to the point that WinRT is stable and
capable enough to act as a replacement for today’s Win32/.NET applications.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=12925691-3e22-41e2-9d8f-a66c115e8b8c" />
      </body>
      <title>Silverlight 6 doesn&amp;rsquo;t matter</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,12925691-3e22-41e2-9d8f-a66c115e8b8c.aspx</guid>
      <link>http://www.lhotka.net/weblog/Silverlight6DoesnrsquotMatter.aspx</link>
      <pubDate>Wed, 09 Nov 2011 02:51:12 GMT</pubDate>
      <description>&lt;p&gt;
&lt;em&gt;Disclaimer: I know nothing. The following is (hopefully) well educated speculation
on my part. Time will tell whether I’m right.&lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
I really like Silverlight. I’ve been a strong proponent of &lt;sub&gt;&lt;/sub&gt;Silverlight
since 2007 when I rushed to port CSLA .NET to the new platform.
&lt;/p&gt;
&lt;p&gt;
In fact, Magenic provided me with a dev and test team to make that transition happen,
because we all saw the amazing potential of Silverlight.
&lt;/p&gt;
&lt;p&gt;
And it has been a good few years.
&lt;/p&gt;
&lt;p&gt;
But let’s face reality. Microsoft has invested who-knows-how-much money to build WinRT,
and no matter how you look at it, WinRT is the replacement for Win32. That means all
the stuff that runs on Win32 is “dead”. This includes Silverlight, Windows Forms,
WPF, console apps – everything.
&lt;/p&gt;
&lt;p&gt;
(this is partially in answer to &lt;a href="http://www.zdnet.com/blog/microsoft/will-there-be-a-silverlight-6-and-does-it-matter/11180"&gt;Mary-Jo’s
article on Silverlight 5&lt;/a&gt;)
&lt;/p&gt;
&lt;p&gt;
I wouldn’t be surprised if Silverlight 5 was the last version. I also wouldn’t be
surprised if .NET 4.5 was the last version for the Win32 client, and that future versions
of .NET were released for servers and Azure only.
&lt;/p&gt;
&lt;p&gt;
Before you panic though, remember that VB6 has been “dead” for well over a decade.
It died at the PDC in 1999, along with COM. But you still use VB6 and/or COM? Or at
least you know organizations who do? How can that be when it is dead??
&lt;/p&gt;
&lt;p&gt;
That’s my point. “dead” isn’t really dead.
&lt;/p&gt;
&lt;p&gt;
Just how long do you think people (like me and you) will continue to run Win32-based
operating systems and applications? At least 10 years, and many will probably run
15-20 years into the future. This is the rate of change that exists in the corporate
world. At least that’s been my observation for the past couple decades.
&lt;/p&gt;
&lt;p&gt;
Microsoft supports their technologies for 10 years after a final release. So even
if SL5 is the end (and they haven’t said it is), that gives us 10 years of supported
Silverlight usage. The same for the other various .NET and Win32 technologies.
&lt;/p&gt;
&lt;p&gt;
That’s plenty of time for Microsoft to get WinRT mature, and to allow us to migrate
to that platform over a period of years.
&lt;/p&gt;
&lt;p&gt;
I don’t expect WinRT 1.0 (the Windows 8 version) to be capable of replacing Win32
or .NET. I rather expect it to be pretty crippled in many respects. Much like VB 1.0
(and 2.0), .NET 1.0 and 1.1, Silverlight 1 and 2, etc.
&lt;/p&gt;
&lt;p&gt;
But Windows 9 or Windows 10 (WinRT 2.0 or 3.0) should be quite capable of replacing
Win32 and .NET and Silverlight.
&lt;/p&gt;
&lt;p&gt;
If we assume Win8 comes out in 2012, and that Microsoft does a forced march release
of 9 and 10 every two years, that means 2016 will give us WinRT 3.0. And if we hold
to the basic truism that Microsoft always gets it right on their third release, that’ll
be the one to target.
&lt;/p&gt;
&lt;p&gt;
I think it is also reasonable to expect that Win9 and Win10 will probably continue
to have the “blue side” (see my &lt;a href="http://www.lhotka.net/weblog/UpdatedWin8DevPlatformDiagram.aspx"&gt;Windows
8 dev platform&lt;/a&gt; post), meaning Win32, .NET, and Silverlight will continue to be
released and therefore supported over that time. They may not &lt;em&gt;change&lt;/em&gt; over
that time, but they’ll be there, and they’ll be supported – or so goes my theory.
&lt;/p&gt;
&lt;p&gt;
This means that in 2016 the clock might really start for migration from Win32/.NET/Silverlight
to WinRT.
&lt;/p&gt;
&lt;p&gt;
Yes, I expect that a lot of us will build things for WinRT sooner than 2016. I certainly
hope so, because it looks like a lot of fun!
&lt;/p&gt;
&lt;p&gt;
But from a corporate perspective, where things move so slowly, this is probably good
news. Certain apps can be ported sooner, but big and important apps can move slowly
over time.
&lt;/p&gt;
&lt;p&gt;
What to do in the meantime? Between now and 2016?
&lt;/p&gt;
&lt;p&gt;
Focus on XAML, and on n-tier or SOA async server access as architectural models.
&lt;/p&gt;
&lt;p&gt;
Or focus on HTML 5 (soon to be HTML 6 fwiw, and possibly HTML 7 by 2016 for all we
know).
&lt;/p&gt;
&lt;p&gt;
I’m focusing on XAML, creating a CSLA 4 version 4.5 release that supports .NET 4.5
on servers, Azure, Windows (Win32), and Windows (WinRT). And Silverlight 5 of course.
&lt;/p&gt;
&lt;p&gt;
In fact, the plan is for a version 4.3 release to support Silverlight 5, then version
4.5 with support for .NET 4.5 and WinRT.
&lt;/p&gt;
&lt;p&gt;
I suspect that you can use Silverlight or WPF as a bridge to WinRT. The real key is
architecture.
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
An n-tier architecture is fine, as long as the data access layer is running on a server,
and the client uses async calls to interact with the server. WinRT requires a lot
of async, at a minimum all server interactions. Silverlight forces you to adopt this
architecture already, so it is a natural fit. WPF doesn’t force the issue, but you
can choose to do “the right thing”.&lt;/li&gt;
&lt;li&gt;
You can also build your client applications to be “edge applications” – on the edge
of a service-oriented system. This is a less mature technology area, and it is more
costly. But it is also a fine architecture for environments composed of many disparate
applications that need to interact as a loosely coupled system. Again, all service
interactions by the edge applications (the ones running on the clients) must be async.&lt;/li&gt;
&lt;li&gt;
Or you can build “hybrid solutions”, where individual applications are built using
n-tier architectures (with async server calls). And where &lt;em&gt;some&lt;/em&gt; of those applications
also expose service interfaces so they can participate as part of a broader service-oriented
system.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
I favor option 3. I don’t like to accept the cost and performance ramifications of
SOA when building &lt;em&gt;an application&lt;/em&gt;, so I’d prefer to use a faster and cheaper
n-tier architecture. At the same time, many applications do need to interact with
each other, and the requirement to create “application mashups” through edge applications
happens from time to time. So building my n-tier applications to have dual interfaces
(XAML and JSON for example) is a perfect compromise.
&lt;/p&gt;
&lt;p&gt;
The direct users of my application get n-tier performance and maintainability. And
the broader organization can access my slower-moving, standards-based, contractual
service interface. It is the best of both worlds.
&lt;/p&gt;
&lt;p&gt;
So do I care if Silverlight 5 is the last version of Silverlight?
&lt;/p&gt;
&lt;p&gt;
Only if WPF continues to evolve prior to us all moving to WinRT. If WPF continues
to evolve, I would expect Silverlight to, at a minimum, keep up. Otherwise Microsoft
has led a lot of people down a dead-end path, and that’s a serious betrayal of trust.
&lt;/p&gt;
&lt;p&gt;
But if my suspicions are correct, we won’t see anything but bug fixes for WPF or Silverlight
for many years. I rather expect that these two technologies just became the next Windows
Forms. You’ll notice that WinForms hasn’t had anything but bug fixes for 6 years right?
The precedent is there for a UI technology to be “supported, stable, and stagnant”
for a very long time, and this is my expectation for WPF/SL.
&lt;/p&gt;
&lt;p&gt;
And if that’s the case, then I don’t care at all about a Silverlight 6 release. We
can use WPF/SL in their current form, right up to the point that WinRT is stable and
capable enough to act as a replacement for today’s Win32/.NET applications.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=12925691-3e22-41e2-9d8f-a66c115e8b8c" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,12925691-3e22-41e2-9d8f-a66c115e8b8c.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Microsoft .NET</category>
      <category>Silverlight</category>
      <category>WinRT</category>
      <category>WPF</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=e45d3d2e-0ae3-44b3-87be-bbe14f2eb83e</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,e45d3d2e-0ae3-44b3-87be-bbe14f2eb83e.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,e45d3d2e-0ae3-44b3-87be-bbe14f2eb83e.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=e45d3d2e-0ae3-44b3-87be-bbe14f2eb83e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
The <a href="http://www.iasaglobal.org/iasa/Twin_Cities_Chapter.asp?SnID=1108452341">Minnesota
chapter of IASA</a> is holding an IT architect training event in May. Details:
</p>
        <ul>
          <li>
Date: May 16-20, 2011</li>
          <li>
Place: Blue Cross Blue Shield offices</li>
          <li>
Registration: <a title="http://www.iasaglobal.org/assnfe/ev.asp?ID=81&amp;SnID=1769887649" href="http://www.iasaglobal.org/assnfe/ev.asp?ID=81&amp;SnID=1769887649">http://www.iasaglobal.org/assnfe/ev.asp?ID=81&amp;SnID=1769887649</a></li>
        </ul>
        <p>
Course Summary:
</p>
        <p>
          <em>Foundation Core Skills - The Key Distinguishing Factor for IT Architects</em>
        </p>
        <ul>
          <li>
Business Technology Strategy - Identified by Iasa members and global thought leaders
as the core value proposition of any architect and the key set of skills in our profession,
business technology strategy ensures immediate business value from technology strategy.
It ensures that your organization will succeed in converting technology and IT from
a liability to an asset. 
</li>
        </ul>
        <p>
          <em>Foundation Supporting Skills</em>
        </p>
        <ul>
          <li>
Design- Architects commonly use design skills to create solutions to problems identified
in developing technology strategy solutions.</li>
          <li>
Quality Attributes - Quality Attributes represent cross-cutting concerns in technology
solutions such as Performance, security, manageability, etc that must be considered
across the entire enterprise technology strategy space.</li>
          <li>
IT Environment - Technology strategy must include a general knowledge of the IT space
including application development, operations, infrastructure, data/information management,
quality assurance, and project management. The IT Environment skills prepare an architect
for the IT side of a technology strategists job function.</li>
          <li>
Human Dynamics - Much of an architects daily role is working with other stakeholders
to understand and define the technology strategy of the organization. The human dynamics
skills represent the means for working with others in the organization including situational
awareness, politics, communication and leadership.</li>
        </ul>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=e45d3d2e-0ae3-44b3-87be-bbe14f2eb83e" />
      </body>
      <title>Architect training in May 2011</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,e45d3d2e-0ae3-44b3-87be-bbe14f2eb83e.aspx</guid>
      <link>http://www.lhotka.net/weblog/ArchitectTrainingInMay2011.aspx</link>
      <pubDate>Fri, 01 Apr 2011 14:12:16 GMT</pubDate>
      <description>&lt;p&gt;
The &lt;a href="http://www.iasaglobal.org/iasa/Twin_Cities_Chapter.asp?SnID=1108452341"&gt;Minnesota
chapter of IASA&lt;/a&gt; is holding an IT architect training event in May. Details:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Date: May 16-20, 2011&lt;/li&gt;
&lt;li&gt;
Place: Blue Cross Blue Shield offices&lt;/li&gt;
&lt;li&gt;
Registration: &lt;a title="http://www.iasaglobal.org/assnfe/ev.asp?ID=81&amp;amp;SnID=1769887649" href="http://www.iasaglobal.org/assnfe/ev.asp?ID=81&amp;amp;SnID=1769887649"&gt;http://www.iasaglobal.org/assnfe/ev.asp?ID=81&amp;amp;SnID=1769887649&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Course Summary:
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Foundation Core Skills - The Key Distinguishing Factor for IT Architects&lt;/em&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Business Technology Strategy - Identified by Iasa members and global thought leaders
as the core value proposition of any architect and the key set of skills in our profession,
business technology strategy ensures immediate business value from technology strategy.
It ensures that your organization will succeed in converting technology and IT from
a liability to an asset. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;em&gt;Foundation Supporting Skills&lt;/em&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Design- Architects commonly use design skills to create solutions to problems identified
in developing technology strategy solutions.&lt;/li&gt;
&lt;li&gt;
Quality Attributes - Quality Attributes represent cross-cutting concerns in technology
solutions such as Performance, security, manageability, etc that must be considered
across the entire enterprise technology strategy space.&lt;/li&gt;
&lt;li&gt;
IT Environment - Technology strategy must include a general knowledge of the IT space
including application development, operations, infrastructure, data/information management,
quality assurance, and project management. The IT Environment skills prepare an architect
for the IT side of a technology strategists job function.&lt;/li&gt;
&lt;li&gt;
Human Dynamics - Much of an architects daily role is working with other stakeholders
to understand and define the technology strategy of the organization. The human dynamics
skills represent the means for working with others in the organization including situational
awareness, politics, communication and leadership.&lt;/li&gt;
&lt;/ul&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=e45d3d2e-0ae3-44b3-87be-bbe14f2eb83e" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,e45d3d2e-0ae3-44b3-87be-bbe14f2eb83e.aspx</comments>
      <category>Architecture</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=bf3d7153-a95a-469d-8475-dd2f0adf9434</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,bf3d7153-a95a-469d-8475-dd2f0adf9434.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,bf3d7153-a95a-469d-8475-dd2f0adf9434.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=bf3d7153-a95a-469d-8475-dd2f0adf9434</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <h3>Foundation 101/102 IASA Training will be hosted at Magenic Technologies on October
4<sup>th</sup> through October 8<sup>th</sup>.
</h3>
        <p>
The foundations coursework and certification expose candidates to the “awareness”
level of the skills matrix, then takes the students through real-world application
of those skills at the project level in a 4+ day series of workshops covering: a year
lifecycles of business justification/selection of projects, creating the architecture,
managing through delivery, and then maturing the engagement model of the architecture
team.
</p>
        <p>
Finally a full half-day is spent on preparation for the CITA-Foundation certification
exam.
</p>
        <p>
You can register for the course at IASA’s home site <a href="http://www.iasahome.org">www.iasahome.org</a> “Twin
Cities” location. 
</p>
        <p>
Group discounts are available.
</p>
        <h3>
          <strong>Course Rational</strong>
        </h3>
        <p>
Heard of IASA and the Certified IT Architect – Professional (CITA-P) certification
process? Interested in going through the process? Have you mapped your skill set and
experience to the IASA Skills Matrix? This course will introduce you to the IASA skills
matrix that is validated with the CITA-P certification. This 1 week course provides
introduction to the IASA skills matrix and provides a self-analysis tool to evaluate
current skill level against the IT Architect Body of Knowledge:
</p>
        <p>
IT Architecture Body of Knowledge  (ITABoK)
</p>
        <p>
Pillar 1: Business Technology 
</p>
        <p>
Pillar 2: IT Environment
</p>
        <p>
Pillar 3: Quality Attributes
</p>
        <p>
Pillar 4: Human Dynamics 
</p>
        <p>
Pillar 5: System Design 
</p>
        <h3>IASA
</h3>
        <p>
The IASA vision is Professionalization of IT architecture, and our model is built
on proven methods that successful professions have taken historically (Doctors, Lawyers,
Building Architects, etc.); our career path model and supporting education/certification
come from practicing architects as a professional association, not from individuals
in a back room. IASA has built a global community of over 60,000 in readership, and
thousands of contributors from multiple countries, industries and specializations.
From that community, we have built extensive and inclusive skills taxonomy and methods
for teaching and evaluating the capabilities within the taxonomy. 
</p>
        <p>
          <a href="http://www.iasahome.org">www.iasahome.org</a>
        </p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=bf3d7153-a95a-469d-8475-dd2f0adf9434" />
      </body>
      <title>IASA training in Minneapolis</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,bf3d7153-a95a-469d-8475-dd2f0adf9434.aspx</guid>
      <link>http://www.lhotka.net/weblog/IASATrainingInMinneapolis.aspx</link>
      <pubDate>Wed, 01 Sep 2010 22:12:47 GMT</pubDate>
      <description>&lt;h3&gt;Foundation 101/102 IASA Training will be hosted at Magenic Technologies on October
4&lt;sup&gt;th&lt;/sup&gt; through October 8&lt;sup&gt;th&lt;/sup&gt;.
&lt;/h3&gt;
&lt;p&gt;
The foundations coursework and certification expose candidates to the “awareness”
level of the skills matrix, then takes the students through real-world application
of those skills at the project level in a 4+ day series of workshops covering: a year
lifecycles of business justification/selection of projects, creating the architecture,
managing through delivery, and then maturing the engagement model of the architecture
team.
&lt;/p&gt;
&lt;p&gt;
Finally a full half-day is spent on preparation for the CITA-Foundation certification
exam.
&lt;/p&gt;
&lt;p&gt;
You can register for the course at IASA’s home site &lt;a href="http://www.iasahome.org"&gt;www.iasahome.org&lt;/a&gt; “Twin
Cities” location. 
&lt;/p&gt;
&lt;p&gt;
Group discounts are available.
&lt;/p&gt;
&lt;h3&gt;&lt;strong&gt;Course Rational&lt;/strong&gt;
&lt;/h3&gt;
&lt;p&gt;
Heard of IASA and the Certified IT Architect – Professional (CITA-P) certification
process? Interested in going through the process? Have you mapped your skill set and
experience to the IASA Skills Matrix? This course will introduce you to the IASA skills
matrix that is validated with the CITA-P certification. This 1 week course provides
introduction to the IASA skills matrix and provides a self-analysis tool to evaluate
current skill level against the IT Architect Body of Knowledge:
&lt;/p&gt;
&lt;p&gt;
IT Architecture Body of Knowledge&amp;#160; (ITABoK)
&lt;/p&gt;
&lt;p&gt;
Pillar 1: Business Technology 
&lt;/p&gt;
&lt;p&gt;
Pillar 2: IT Environment
&lt;/p&gt;
&lt;p&gt;
Pillar 3: Quality Attributes
&lt;/p&gt;
&lt;p&gt;
Pillar 4: Human Dynamics 
&lt;/p&gt;
&lt;p&gt;
Pillar 5: System Design 
&lt;/p&gt;
&lt;h3&gt;IASA
&lt;/h3&gt;
&lt;p&gt;
The IASA vision is Professionalization of IT architecture, and our model is built
on proven methods that successful professions have taken historically (Doctors, Lawyers,
Building Architects, etc.); our career path model and supporting education/certification
come from practicing architects as a professional association, not from individuals
in a back room. IASA has built a global community of over 60,000 in readership, and
thousands of contributors from multiple countries, industries and specializations.
From that community, we have built extensive and inclusive skills taxonomy and methods
for teaching and evaluating the capabilities within the taxonomy. 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.iasahome.org"&gt;www.iasahome.org&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=bf3d7153-a95a-469d-8475-dd2f0adf9434" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,bf3d7153-a95a-469d-8475-dd2f0adf9434.aspx</comments>
      <category>Architecture</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=5d45d17a-41b2-4e3c-ae15-c23e0b9d83f4</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,5d45d17a-41b2-4e3c-ae15-c23e0b9d83f4.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,5d45d17a-41b2-4e3c-ae15-c23e0b9d83f4.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=5d45d17a-41b2-4e3c-ae15-c23e0b9d83f4</wfw:commentRss>
      <slash:comments>6</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
My personal area of focus is on application architecture, obviously around the .NET
platform, though most of the concepts, patterns and techniques apply to any mature
development platform.
</p>
        <p>
Application architecture is all about defining the standards, practices and patterns
that bring consistency across all development efforts on a platform. It is not the
same as application design – architecture spans applications, while design is applied
to every specific application. Any relevant architecture will enable a broad set of
applications, and therefore must enable multiple possible designs.
</p>
        <p>
It is also the case that application architecture, in my view, includes “horizontal”
and “vertical” concepts. 
</p>
        <p>
Horizontal concepts apply to any and all applications and are largely orthogonal to
any specific application design. These concepts include guidelines around authentication,
authorization, integration with operational monitoring systems, logging, tracing,
etc.
</p>
        <p>
Vertical concepts cover the actual shape of applications, including concepts like
layered application structure, what presentation layer design patterns to use (MVC,
MVVM, etc), how the presentation layer interacts with the business layer, how the
business layer is constructed (object-oriented, workflow, function libraries, etc),
how the data access layer is constructed, whether broad patterns like DI/IoC are used
and so forth.
</p>
        <p>
In today’s world, an application architecture must at least encompass the possibility
of n-tier and service-oriented architectures. Both horizontal and vertical aspects
of the architecture must be able to account for n-tier and SOA application models,
because both of these models are required to create the applications necessary to
support any sizable suite of enterprise application requirements.
</p>
        <p>
It is quite possible to define application architectures at a platform-neutral level.
And in a large organization this can be valuable. But in my view, this is all an academic
(and essentially useless) endeavor unless the architectures are taken to another level
of detail specific to a given platform (such as .NET).
</p>
        <p>
This is because the architecture must be actually relevant to on-the-ground developers
or it is just so much paper. Developers have hard goals and deadlines, and they usually
want to get their work done in time to get home for their kid’s soccer games. Abstract
architectures just mean more reading and essentially detract from the developers’
ability to get their work done.
</p>
        <p>
Concrete architectures <i>might be helpful</i> to developers – at least there’s some
chance of relevance in day to day work.
</p>
        <p>
But to really make an architecture relevant, the architect group must go beyond concepts,
standards and guidelines. They need to provide tools, frameworks and other tangible
elements that <i>make developer’s lives easier</i>.
</p>
        <p>
Developers are like electricity/water/insert-your-analogy-here, in that they take
the path of least resistance. If an architecture makes things harder, they’ll bypass
it. If an architecture (usually along with tools/frameworks/etc) makes things easier,
they’ll embrace it.
</p>
        <p>
Architecture by itself is just paper – concepts – nothing tangible. So it is virtually
impossible for <i>architecture</i> to make developer’s lives easier. But codify an
architecture into a framework, add some automated tooling, pre-built components and
training – and all of a sudden it becomes easier to do the right thing by following
the architecture, than by doing the wrong thing by ignoring it.
</p>
        <p>
This is the recipe for winning when it comes to application architecture: be pragmatic,
be comprehensive and above all, make sure the easiest path for developers is the right
path – the path defined by your architecture.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=5d45d17a-41b2-4e3c-ae15-c23e0b9d83f4" />
      </body>
      <title>Some thoughts on Application Architecture</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,5d45d17a-41b2-4e3c-ae15-c23e0b9d83f4.aspx</guid>
      <link>http://www.lhotka.net/weblog/SomeThoughtsOnApplicationArchitecture.aspx</link>
      <pubDate>Sun, 22 Aug 2010 15:55:06 GMT</pubDate>
      <description>&lt;p&gt;
My personal area of focus is on application architecture, obviously around the .NET
platform, though most of the concepts, patterns and techniques apply to any mature
development platform.
&lt;/p&gt;
&lt;p&gt;
Application architecture is all about defining the standards, practices and patterns
that bring consistency across all development efforts on a platform. It is not the
same as application design – architecture spans applications, while design is applied
to every specific application. Any relevant architecture will enable a broad set of
applications, and therefore must enable multiple possible designs.
&lt;/p&gt;
&lt;p&gt;
It is also the case that application architecture, in my view, includes “horizontal”
and “vertical” concepts. 
&lt;/p&gt;
&lt;p&gt;
Horizontal concepts apply to any and all applications and are largely orthogonal to
any specific application design. These concepts include guidelines around authentication,
authorization, integration with operational monitoring systems, logging, tracing,
etc.
&lt;/p&gt;
&lt;p&gt;
Vertical concepts cover the actual shape of applications, including concepts like
layered application structure, what presentation layer design patterns to use (MVC,
MVVM, etc), how the presentation layer interacts with the business layer, how the
business layer is constructed (object-oriented, workflow, function libraries, etc),
how the data access layer is constructed, whether broad patterns like DI/IoC are used
and so forth.
&lt;/p&gt;
&lt;p&gt;
In today’s world, an application architecture must at least encompass the possibility
of n-tier and service-oriented architectures. Both horizontal and vertical aspects
of the architecture must be able to account for n-tier and SOA application models,
because both of these models are required to create the applications necessary to
support any sizable suite of enterprise application requirements.
&lt;/p&gt;
&lt;p&gt;
It is quite possible to define application architectures at a platform-neutral level.
And in a large organization this can be valuable. But in my view, this is all an academic
(and essentially useless) endeavor unless the architectures are taken to another level
of detail specific to a given platform (such as .NET).
&lt;/p&gt;
&lt;p&gt;
This is because the architecture must be actually relevant to on-the-ground developers
or it is just so much paper. Developers have hard goals and deadlines, and they usually
want to get their work done in time to get home for their kid’s soccer games. Abstract
architectures just mean more reading and essentially detract from the developers’
ability to get their work done.
&lt;/p&gt;
&lt;p&gt;
Concrete architectures &lt;i&gt;might be helpful&lt;/i&gt; to developers – at least there’s some
chance of relevance in day to day work.
&lt;/p&gt;
&lt;p&gt;
But to really make an architecture relevant, the architect group must go beyond concepts,
standards and guidelines. They need to provide tools, frameworks and other tangible
elements that &lt;i&gt;make developer’s lives easier&lt;/i&gt;.
&lt;/p&gt;
&lt;p&gt;
Developers are like electricity/water/insert-your-analogy-here, in that they take
the path of least resistance. If an architecture makes things harder, they’ll bypass
it. If an architecture (usually along with tools/frameworks/etc) makes things easier,
they’ll embrace it.
&lt;/p&gt;
&lt;p&gt;
Architecture by itself is just paper – concepts – nothing tangible. So it is virtually
impossible for &lt;i&gt;architecture&lt;/i&gt; to make developer’s lives easier. But codify an
architecture into a framework, add some automated tooling, pre-built components and
training – and all of a sudden it becomes easier to do the right thing by following
the architecture, than by doing the wrong thing by ignoring it.
&lt;/p&gt;
&lt;p&gt;
This is the recipe for winning when it comes to application architecture: be pragmatic,
be comprehensive and above all, make sure the easiest path for developers is the right
path – the path defined by your architecture.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=5d45d17a-41b2-4e3c-ae15-c23e0b9d83f4" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,5d45d17a-41b2-4e3c-ae15-c23e0b9d83f4.aspx</comments>
      <category>Architecture</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=ce921708-d7b1-49b4-9a3a-9b39051e3e9b</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,ce921708-d7b1-49b4-9a3a-9b39051e3e9b.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,ce921708-d7b1-49b4-9a3a-9b39051e3e9b.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=ce921708-d7b1-49b4-9a3a-9b39051e3e9b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
This is a <a href="http://www.lessonsoffailure.com/developers/avoid-asshole-architect/">nice
list of things</a> a software architect should do to be relevant and accepted by developers
in the org.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=ce921708-d7b1-49b4-9a3a-9b39051e3e9b" />
      </body>
      <title>Rules for Software Architects</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,ce921708-d7b1-49b4-9a3a-9b39051e3e9b.aspx</guid>
      <link>http://www.lhotka.net/weblog/RulesForSoftwareArchitects.aspx</link>
      <pubDate>Mon, 09 Aug 2010 14:04:27 GMT</pubDate>
      <description>&lt;p&gt;
This is a &lt;a href="http://www.lessonsoffailure.com/developers/avoid-asshole-architect/"&gt;nice
list of things&lt;/a&gt; a software architect should do to be relevant and accepted by developers
in the org.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=ce921708-d7b1-49b4-9a3a-9b39051e3e9b" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,ce921708-d7b1-49b4-9a3a-9b39051e3e9b.aspx</comments>
      <category>Architecture</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=82310240-f331-4609-b0b4-4f4a468cf634</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,82310240-f331-4609-b0b4-4f4a468cf634.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,82310240-f331-4609-b0b4-4f4a468cf634.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=82310240-f331-4609-b0b4-4f4a468cf634</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I am working on a video series discussing the use of the MVVM design pattern, plus
a “zero code-behind” philosophy with CSLA .NET version 4.
</p>
        <p>
I’ve decided to put the intro video out there for free. It is a good video, covering
the basics of the pattern, my approach to the pattern and how a CSLA-based Model works
best in the pattern.
</p>
        <p>
          <a title="http://www.lhotka.net/files/MvvmIntro.wmv" href="http://www.lhotka.net/files/MvvmIntro.wmv">http://www.lhotka.net/files/MvvmIntro.wmv</a>
        </p>
        <p>
The rest of the series will be demo-based, covering the specifics of implementation.
I’ll add another blog post when that’s available for purchase, but I thought I’d get
this intro online now so people can make use of it.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=82310240-f331-4609-b0b4-4f4a468cf634" />
      </body>
      <title>CSLA 4 and MVVM video series</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,82310240-f331-4609-b0b4-4f4a468cf634.aspx</guid>
      <link>http://www.lhotka.net/weblog/CSLA4AndMVVMVideoSeries.aspx</link>
      <pubDate>Wed, 02 Jun 2010 18:36:58 GMT</pubDate>
      <description>&lt;p&gt;
I am working on a video series discussing the use of the MVVM design pattern, plus
a “zero code-behind” philosophy with CSLA .NET version 4.
&lt;/p&gt;
&lt;p&gt;
I’ve decided to put the intro video out there for free. It is a good video, covering
the basics of the pattern, my approach to the pattern and how a CSLA-based Model works
best in the pattern.
&lt;/p&gt;
&lt;p&gt;
&lt;a title="http://www.lhotka.net/files/MvvmIntro.wmv" href="http://www.lhotka.net/files/MvvmIntro.wmv"&gt;http://www.lhotka.net/files/MvvmIntro.wmv&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The rest of the series will be demo-based, covering the specifics of implementation.
I’ll add another blog post when that’s available for purchase, but I thought I’d get
this intro online now so people can make use of it.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=82310240-f331-4609-b0b4-4f4a468cf634" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,82310240-f331-4609-b0b4-4f4a468cf634.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Silverlight</category>
      <category>WPF</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=6b9e0847-0b0a-4753-bfca-409e182c42cf</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,6b9e0847-0b0a-4753-bfca-409e182c42cf.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,6b9e0847-0b0a-4753-bfca-409e182c42cf.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=6b9e0847-0b0a-4753-bfca-409e182c42cf</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Setting up any type of n-tier solution requires the creation of numerous projects
in the solution, along with appropriate references, configuration and so forth. Doing
this with a Silverlight application is complicated slightly because Silverlight and
.NET projects are slightly different (since they use different compilers, runtimes,
etc). And sharing code between Silverlight and .NET projects complicates things a
bit more, because the same physical code files are typically shared between two different
projects in the solution.
</p>
        <p>
          <a href="http://www.lhotka.net/cslalight">CSLA .NET for Silverlight</a> makes it relatively
easy to create powerful n-tier applications that do share some code between the Silverlight
client and the .NET server(s). Even though CSLA .NET does solve a whole host of issues
for you, the reality is that the solution still needs to be set up correctly.
</p>
        <p>
Here are the basic steps required to set up an n-tier CSLA .NET for Silverlight solution: 
</p>
        <ol>
          <li>
Create a new Silverlight application project 
<ol><li>
Have Visual Studio create a web application for the Silverlight project 
</li></ol></li>
          <li>
Add a new Silverlight Class Library project (this is your business library) 
</li>
          <li>
Add a new .NET Class Library project (this is your business library) 
</li>
          <li>
Use the Project Properties windows to set the Silverlight and .NET Class Library projects
to use the same namespace and assembly name 
<br /><a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_6.png"><img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_thumb_2.png" width="523" height="268" /></a><br /><a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_8.png"><img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_thumb_3.png" width="526" height="452" /></a></li>
          <li>
Remove the Class1 files from the Silverlight and .NET Class Library projects 
</li>
          <li>
(optional) Add a .NET Class Library project to contain the data access code 
</li>
          <li>
Set up references 
<ol><li>
The Silverlight application should reference Csla.dll (for Silverlight) and the Silverlight
Class Library 
</li><li>
The Silverlight Class Library (business) should reference Csla.dll (for Silverlight) 
</li><li>
The ASP.NET Web application should reference Csla.dll (for .NET), the .NET Class Library
(business) and the .NET Class Library (data) 
</li><li>
The .NET Class Library (data) should reference Csla.dll (for .NET) and the .NET Class
Library (business) 
</li><li>
The .NET Class Library (business) should reference Csla.dll (for .NET) 
<br /><a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_10.png"><img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title="image" border="0" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_thumb_4.png" width="510" height="363" /></a></li></ol></li>
          <li>
Add your business classes to the .NET Class Library (business) 
<ol><li>
Link them to the Silverlight Class Library (business) 
</li><li>
Use compiler directives (#if SILVERLIGHT) or partial classes to create Silverlight-only
or .NET-only code in each Class Library 
</li></ol></li>
          <li>
Configure the data portal 
<ol><li>
Add a WcfPortal.svc file to the ASP.NET web application to define an endpoint for
the Silverlight data portal 
</li><li>
Add a &lt;system.serviceModel&gt; element to web.config in the ASP.NET web application
to configure the endpoint for the Silverlight data portal 
</li><li>
Add any connection string or other configuration values needed on the server to the
web.config file 
</li><li>
Add a ServiceReferences.ClientConfig file to the Silverlight application and make
sure it has an endpoint named BasicHttpBinding_IWcfPortal pointing to the server 
</li></ol></li>
        </ol>
        <p>
This isn’t the simplest or most complex option for creating a CSLA .NET for Silverlight
solution. You could use CSLA .NET for Silverlight to create a client-only application
(that’s the simplest), or a 4-tier application where there is not only a web server
in the DMZ, but also a separate application server behind a second firewall. I do
think that the model I’ve shown in this blog post is probably the most common scenario
however, which is why this is the one I chose to outline.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=6b9e0847-0b0a-4753-bfca-409e182c42cf" />
      </body>
      <title>Setting up a basic n-tier CSLA .NET for Silverlight project</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,6b9e0847-0b0a-4753-bfca-409e182c42cf.aspx</guid>
      <link>http://www.lhotka.net/weblog/SettingUpABasicNtierCSLANETForSilverlightProject.aspx</link>
      <pubDate>Thu, 19 Feb 2009 22:24:58 GMT</pubDate>
      <description>&lt;p&gt;
Setting up any type of n-tier solution requires the creation of numerous projects
in the solution, along with appropriate references, configuration and so forth. Doing
this with a Silverlight application is complicated slightly because Silverlight and
.NET projects are slightly different (since they use different compilers, runtimes,
etc). And sharing code between Silverlight and .NET projects complicates things a
bit more, because the same physical code files are typically shared between two different
projects in the solution.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/cslalight"&gt;CSLA .NET for Silverlight&lt;/a&gt; makes it relatively
easy to create powerful n-tier applications that do share some code between the Silverlight
client and the .NET server(s). Even though CSLA .NET does solve a whole host of issues
for you, the reality is that the solution still needs to be set up correctly.
&lt;/p&gt;
&lt;p&gt;
Here are the basic steps required to set up an n-tier CSLA .NET for Silverlight solution: 
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Create a new Silverlight application project 
&lt;ol&gt;
&lt;li&gt;
Have Visual Studio create a web application for the Silverlight project 
&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;
Add a new Silverlight Class Library project (this is your business library) 
&lt;li&gt;
Add a new .NET Class Library project (this is your business library) 
&lt;li&gt;
Use the Project Properties windows to set the Silverlight and .NET Class Library projects
to use the same namespace and assembly name 
&lt;br&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_6.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_thumb_2.png" width=523 height=268&gt;&lt;/a&gt; 
&lt;br&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_8.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_thumb_3.png" width=526 height=452&gt;&lt;/a&gt; 
&lt;li&gt;
Remove the Class1 files from the Silverlight and .NET Class Library projects 
&lt;li&gt;
(optional) Add a .NET Class Library project to contain the data access code 
&lt;li&gt;
Set up references 
&lt;ol&gt;
&lt;li&gt;
The Silverlight application should reference Csla.dll (for Silverlight) and the Silverlight
Class Library 
&lt;li&gt;
The Silverlight Class Library (business) should reference Csla.dll (for Silverlight) 
&lt;li&gt;
The ASP.NET Web application should reference Csla.dll (for .NET), the .NET Class Library
(business) and the .NET Class Library (data) 
&lt;li&gt;
The .NET Class Library (data) should reference Csla.dll (for .NET) and the .NET Class
Library (business) 
&lt;li&gt;
The .NET Class Library (business) should reference Csla.dll (for .NET) 
&lt;br&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_10.png"&gt;&lt;img style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: inline; BORDER-TOP: 0px; BORDER-RIGHT: 0px" title=image border=0 alt=image src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Settingupabasic.NETforSilverlightproject_E6F6/image_thumb_4.png" width=510 height=363&gt;&lt;/a&gt; 
&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;
Add your business classes to the .NET Class Library (business) 
&lt;ol&gt;
&lt;li&gt;
Link them to the Silverlight Class Library (business) 
&lt;li&gt;
Use compiler directives (#if SILVERLIGHT) or partial classes to create Silverlight-only
or .NET-only code in each Class Library 
&lt;/li&gt;
&lt;/ol&gt;
&lt;li&gt;
Configure the data portal 
&lt;ol&gt;
&lt;li&gt;
Add a WcfPortal.svc file to the ASP.NET web application to define an endpoint for
the Silverlight data portal 
&lt;li&gt;
Add a &amp;lt;system.serviceModel&amp;gt; element to web.config in the ASP.NET web application
to configure the endpoint for the Silverlight data portal 
&lt;li&gt;
Add any connection string or other configuration values needed on the server to the
web.config file 
&lt;li&gt;
Add a ServiceReferences.ClientConfig file to the Silverlight application and make
sure it has an endpoint named BasicHttpBinding_IWcfPortal pointing to the server 
&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
This isn’t the simplest or most complex option for creating a CSLA .NET for Silverlight
solution. You could use CSLA .NET for Silverlight to create a client-only application
(that’s the simplest), or a 4-tier application where there is not only a web server
in the DMZ, but also a separate application server behind a second firewall. I do
think that the model I’ve shown in this blog post is probably the most common scenario
however, which is why this is the one I chose to outline.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=6b9e0847-0b0a-4753-bfca-409e182c42cf" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,6b9e0847-0b0a-4753-bfca-409e182c42cf.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=73c3f942-95b3-44fe-ac36-6bab069097ad</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,73c3f942-95b3-44fe-ac36-6bab069097ad.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,73c3f942-95b3-44fe-ac36-6bab069097ad.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=73c3f942-95b3-44fe-ac36-6bab069097ad</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img style="border-right: 0px; border-top: 0px; display: inline; margin: 5px; border-left: 0px; border-bottom: 0px" alt="AppArch2.0_small.jpg" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=AppArchGuide&amp;DownloadId=52040" align="right" border="0" />The
Microsoft Patterns and Practices group has a new <a href="http://www.codeplex.com/AppArchGuide">Application
Architecture Guide</a> available.
</p>
        <p>
Architecture, in my view, is primarily about restricting options. 
</p>
        <p>
Or to put it another way, it is about making a set of high level, often difficult,
choices up front. The result of those choices is to restrict the options available
for the design and construction of a system, because the choices place a set of constraints
and restrictions around what is allowed.
</p>
        <p>
When it comes to working in a platform like Microsoft .NET, architecture is <em>critical</em>.
This is because the platform provides many ways to design and implement nearly anything
you’d like to do. There are around 9 ways to talk to a database – from Microsoft,
not counting the myriad 3rd party options. The number of ways to build web apps continues
to grow, etc. The point I’m making is that if you just throw the entire .NET framework
at a dev group you’ll get a largely random result that may or may not actually meet
the short, medium and long-term needs of your business.
</p>
        <p>
Developing an architecture first allows you to rationally evaluate the various options,
discard those that don’t fit the business and application requirements and only allow
use of those that do meet the needs.
</p>
        <p>
An interesting side-effect of this process is that your developers may disagree. They
may only see short-term issues, or purely technical concerns, and may not understand
some of the medium/long term issues or broader business concerns. And that’s OK. You
can either say “buck up and do what you are told”, or you can try to educate them
on the business issues (recognizing that not all devs are particularly business-savvy).
But in the end, you do need some level of buy-in from the devs or they’ll work against
the architecture, often to the detriment of the overall system.
</p>
        <p>
Another interesting side-effect of this process is that an ill-informed or disconnected
architect might create an architecture that is really quite impractical. In other
words, the devs are right to be up in arms. This can also lead to disaster. I’ve heard
it said that architects shouldn’t code, or can’t code. If your application architect
can’t code, they are in trouble, and your application probably is too. On the other
hand, if they don’t know every nuance of the C# compiler, that’s probably good too!
A good architect can’t afford to be that deep into any given tool, because they need
more breadth than a hard-core coder can achieve.
</p>
        <p>
Architects live in the intersection between business and technology. 
</p>
        <p>
As such they need to be able to code, and to have productive meetings with business
stakeholders – often both in the same day. Worse, they need to have some understanding
of all the technology options available from their platform – and the Microsoft platform
is massive and complex.
</p>
        <p>
Which brings me back to the Application Architecture Guide. This guide won’t solve
all the challenges I’m discussing. But it is an <em>invaluable</em> tool in any .NET
application architect’s arsenal. If you are, or would like to be, an architect or
application designer, you really must read this book!
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=73c3f942-95b3-44fe-ac36-6bab069097ad" />
      </body>
      <title>Application Architecture Guide 2.0</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,73c3f942-95b3-44fe-ac36-6bab069097ad.aspx</guid>
      <link>http://www.lhotka.net/weblog/ApplicationArchitectureGuide20.aspx</link>
      <pubDate>Mon, 12 Jan 2009 17:29:13 GMT</pubDate>
      <description>&lt;p&gt;
&lt;img style="border-right: 0px; border-top: 0px; display: inline; margin: 5px; border-left: 0px; border-bottom: 0px" alt="AppArch2.0_small.jpg" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=AppArchGuide&amp;amp;DownloadId=52040" align="right" border="0" /&gt;The
Microsoft Patterns and Practices group has a new &lt;a href="http://www.codeplex.com/AppArchGuide"&gt;Application
Architecture Guide&lt;/a&gt; available.
&lt;/p&gt;
&lt;p&gt;
Architecture, in my view, is primarily about restricting options. 
&lt;/p&gt;
&lt;p&gt;
Or to put it another way, it is about making a set of high level, often difficult,
choices up front. The result of those choices is to restrict the options available
for the design and construction of a system, because the choices place a set of constraints
and restrictions around what is allowed.
&lt;/p&gt;
&lt;p&gt;
When it comes to working in a platform like Microsoft .NET, architecture is &lt;em&gt;critical&lt;/em&gt;.
This is because the platform provides many ways to design and implement nearly anything
you’d like to do. There are around 9 ways to talk to a database – from Microsoft,
not counting the myriad 3rd party options. The number of ways to build web apps continues
to grow, etc. The point I’m making is that if you just throw the entire .NET framework
at a dev group you’ll get a largely random result that may or may not actually meet
the short, medium and long-term needs of your business.
&lt;/p&gt;
&lt;p&gt;
Developing an architecture first allows you to rationally evaluate the various options,
discard those that don’t fit the business and application requirements and only allow
use of those that do meet the needs.
&lt;/p&gt;
&lt;p&gt;
An interesting side-effect of this process is that your developers may disagree. They
may only see short-term issues, or purely technical concerns, and may not understand
some of the medium/long term issues or broader business concerns. And that’s OK. You
can either say “buck up and do what you are told”, or you can try to educate them
on the business issues (recognizing that not all devs are particularly business-savvy).
But in the end, you do need some level of buy-in from the devs or they’ll work against
the architecture, often to the detriment of the overall system.
&lt;/p&gt;
&lt;p&gt;
Another interesting side-effect of this process is that an ill-informed or disconnected
architect might create an architecture that is really quite impractical. In other
words, the devs are right to be up in arms. This can also lead to disaster. I’ve heard
it said that architects shouldn’t code, or can’t code. If your application architect
can’t code, they are in trouble, and your application probably is too. On the other
hand, if they don’t know every nuance of the C# compiler, that’s probably good too!
A good architect can’t afford to be that deep into any given tool, because they need
more breadth than a hard-core coder can achieve.
&lt;/p&gt;
&lt;p&gt;
Architects live in the intersection between business and technology. 
&lt;/p&gt;
&lt;p&gt;
As such they need to be able to code, and to have productive meetings with business
stakeholders – often both in the same day. Worse, they need to have some understanding
of all the technology options available from their platform – and the Microsoft platform
is massive and complex.
&lt;/p&gt;
&lt;p&gt;
Which brings me back to the Application Architecture Guide. This guide won’t solve
all the challenges I’m discussing. But it is an &lt;em&gt;invaluable&lt;/em&gt; tool in any .NET
application architect’s arsenal. If you are, or would like to be, an architect or
application designer, you really must read this book!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=73c3f942-95b3-44fe-ac36-6bab069097ad" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,73c3f942-95b3-44fe-ac36-6bab069097ad.aspx</comments>
      <category>Architecture</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=49a43b5c-4788-451d-bd9a-2e2ebd6a4c1c</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,49a43b5c-4788-451d-bd9a-2e2ebd6a4c1c.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,49a43b5c-4788-451d-bd9a-2e2ebd6a4c1c.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=49a43b5c-4788-451d-bd9a-2e2ebd6a4c1c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
My previous blog post (<a href="http://www.lhotka.net/weblog/SomeThoughtsOnWindowsAzure.aspx">Some
thoughts on Windows Azure</a>) has generated some good comments. I was going to answer
with a comment, but I wrote enough that I thought I’d just do a follow-up post. 
</p>
        <p>
Jamie says “Sounds akin to Architecture:"convention over configuration" I'm wholly
in favour of that.” 
</p>
        <p>
Yes, this is very much a convention over configuration story, just at an arguably
larger scope that we’ve seen thus far. Or at least showing a glimpse of that larger
scope. Things like Rails are interesting, but I don't think they are as broad as the
potential we're seeing here. 
</p>
        <p>
It is my view that the primary job of an architect is to eliminate choices. To create
artificial restrictions within which applications are created. Basically to pre-make
most of the hard choices so each application designer/developer doesn’t need to. 
</p>
        <p>
What I’m saying with Azure, is that we’re seeing this effect at a platform level.
A platform that has already eliminated most choices, and that has created restrictions
on how applications are created – thus ensuring a high level of consistency, and potential
portability. 
</p>
        <p>
Jason is confused by my previous post, in that I say Azure has a "lock-in problem",
but that the restricted architecture is a good thing. 
</p>
        <p>
I understand your confusion, as I probably could have been more clear. I do think
Windows Azure has a lock-in problem - it doesn't scale down into my data center, or
onto my desktop. But the <em>concept</em> of a restricted runtime is a good one, and
I suspect that concept may outlive this first run at Azure. A restricted architecture
(and runtime to support it) doesn't have to cause lock-in at the hosting level. Perhaps
at the vendor level - but those of us who live in the Microsoft space put <em>that </em>concern
behind us many years ago. 
</p>
        <p>
Roger suggests that most organizations may not have the technical savvy to host the
Azure platform in-house. 
</p>
        <p>
That may be a valid point – the current Azure implementation might be too complex
for most organizations to administer. Microsoft didn't build it as a server product,
so they undoubtedly made implementation choices that create complexity for hosting.
This doesn’t mean the <em>idea</em> of a restricted runtime is bad. Nor does it mean
that someone (possibly Microsoft) could create such a restricted runtime that could
be deployed within an organization, or in the cloud. Consider that there is a version
of Azure that runs on a developer's workstation already - so it isn't hard to imagine
a version of Azure that I could run in my data center. 
</p>
        <p>
Remember that we’re talking about a restricted runtime, with a restricted architecture
and API. Basically a controlled subset of .NET. We’re already seeing this work – in
the form of Silverlight. Silverlight is largely compatible with .NET, even though
they are totally separate implementations. And Moonlight demonstrates that the abstraction
can carry to yet another implementation. 
</p>
        <p>
Silverlight has demonstrated that most business applications only use 5 of the 197
megabytes in the .NET 3.5 framework download to build the client. Just how much is
really required to build the server parts? A different 5 megabytes? 10? Maybe 20 tops?
</p>
        <p>
If someone had a defined runtime for server code, like Silverlight is for the client,
I think it becomes equally possible to have numerous physical implementations of the
same runtime. One for my laptop, one for my enterprise servers and one for Microsoft
to host in the cloud. Now I can write my app in this .NET subset, and I can not only
scale out, but I can scale up or down too.
</p>
        <p>
That’s where I suspect this will all end up, and spurring this type of thinking is
(to me) the real value of Azure in the short term. 
</p>
        <p>
Finally, Justin rightly suggests that we can use our own abstraction layer to be portable
to/from Azure even today. 
</p>
        <p>
That's absolutely true. What I'm saying is that I think Azure could light the way
to a <em>platform</em> that already does that abstraction. 
</p>
        <p>
Many, many years ago I worked on a project to port some software from a Prime to a
VAX. It was only possible because the original developers had (and I am not exaggerating)
abstracted every point of interaction with the OS. Everything that wasn't part of
the FORTRAN-77 spec was in an abstraction layer. I shudder to think of the expense
of doing that today - of abstracting everything outside the C# language spec - basically
all of .NET - so you could be portable. 
</p>
        <p>
So what we need, I think, is this server equivalent to Silverlight. Azure is not that
- not today - but I think it may start us down that path, and that'd be cool!
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=49a43b5c-4788-451d-bd9a-2e2ebd6a4c1c" />
      </body>
      <title>Windows Azure and the value of restricted platforms/architectures</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,49a43b5c-4788-451d-bd9a-2e2ebd6a4c1c.aspx</guid>
      <link>http://www.lhotka.net/weblog/WindowsAzureAndTheValueOfRestrictedPlatformsarchitectures.aspx</link>
      <pubDate>Fri, 12 Dec 2008 17:33:03 GMT</pubDate>
      <description>&lt;p&gt;
My previous blog post (&lt;a href="http://www.lhotka.net/weblog/SomeThoughtsOnWindowsAzure.aspx"&gt;Some
thoughts on Windows Azure&lt;/a&gt;) has generated some good comments. I was going to answer
with a comment, but I wrote enough that I thought I’d just do a follow-up post. 
&lt;p&gt;
Jamie says “Sounds akin to Architecture:"convention over configuration" I'm wholly
in favour of that.” 
&lt;p&gt;
Yes, this is very much a convention over configuration story, just at an arguably
larger scope that we’ve seen thus far. Or at least showing a glimpse of that larger
scope. Things like Rails are interesting, but I don't think they are as broad as the
potential we're seeing here. 
&lt;p&gt;
It is my view that the primary job of an architect is to eliminate choices. To create
artificial restrictions within which applications are created. Basically to pre-make
most of the hard choices so each application designer/developer doesn’t need to. 
&lt;p&gt;
What I’m saying with Azure, is that we’re seeing this effect at a platform level.
A platform that has already eliminated most choices, and that has created restrictions
on how applications are created – thus ensuring a high level of consistency, and potential
portability. 
&lt;p&gt;
Jason is confused by my previous post, in that I say Azure has a "lock-in problem",
but that the restricted architecture is a good thing. 
&lt;p&gt;
I understand your confusion, as I probably could have been more clear. I do think
Windows Azure has a lock-in problem - it doesn't scale down into my data center, or
onto my desktop. But the &lt;em&gt;concept&lt;/em&gt; of a restricted runtime is a good one, and
I suspect that concept may outlive this first run at Azure. A restricted architecture
(and runtime to support it) doesn't have to cause lock-in at the hosting level. Perhaps
at the vendor level - but those of us who live in the Microsoft space put &lt;em&gt;that &lt;/em&gt;concern
behind us many years ago. 
&lt;p&gt;
Roger suggests that most organizations may not have the technical savvy to host the
Azure platform in-house. 
&lt;p&gt;
That may be a valid point – the current Azure implementation might be too complex
for most organizations to administer. Microsoft didn't build it as a server product,
so they undoubtedly made implementation choices that create complexity for hosting.
This doesn’t mean the &lt;em&gt;idea&lt;/em&gt; of a restricted runtime is bad. Nor does it mean
that someone (possibly Microsoft) could create such a restricted runtime that could
be deployed within an organization, or in the cloud. Consider that there is a version
of Azure that runs on a developer's workstation already - so it isn't hard to imagine
a version of Azure that I could run in my data center. 
&lt;p&gt;
Remember that we’re talking about a restricted runtime, with a restricted architecture
and API. Basically a controlled subset of .NET. We’re already seeing this work – in
the form of Silverlight. Silverlight is largely compatible with .NET, even though
they are totally separate implementations. And Moonlight demonstrates that the abstraction
can carry to yet another implementation. 
&lt;p&gt;
Silverlight has demonstrated that most business applications only use 5 of the 197
megabytes in the .NET 3.5 framework download to build the client. Just how much is
really required to build the server parts? A different 5 megabytes? 10? Maybe 20 tops?
&lt;/p&gt;
&lt;p&gt;
If someone had a defined runtime for server code, like Silverlight is for the client,
I think it becomes equally possible to have numerous physical implementations of the
same runtime. One for my laptop, one for my enterprise servers and one for Microsoft
to host in the cloud. Now I can write my app in this .NET subset, and I can not only
scale out, but I can scale up or down too.
&lt;/p&gt;
&lt;p&gt;
That’s where I suspect this will all end up, and spurring this type of thinking is
(to me) the real value of Azure in the short term. 
&lt;p&gt;
Finally, Justin rightly suggests that we can use our own abstraction layer to be portable
to/from Azure even today. 
&lt;p&gt;
That's absolutely true. What I'm saying is that I think Azure could light the way
to a &lt;em&gt;platform&lt;/em&gt; that already does that abstraction. 
&lt;p&gt;
Many, many years ago I worked on a project to port some software from a Prime to a
VAX. It was only possible because the original developers had (and I am not exaggerating)
abstracted every point of interaction with the OS. Everything that wasn't part of
the FORTRAN-77 spec was in an abstraction layer. I shudder to think of the expense
of doing that today - of abstracting everything outside the C# language spec - basically
all of .NET - so you could be portable. 
&lt;p&gt;
So what we need, I think, is this server equivalent to Silverlight. Azure is not that
- not today - but I think it may start us down that path, and that'd be cool!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=49a43b5c-4788-451d-bd9a-2e2ebd6a4c1c" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,49a43b5c-4788-451d-bd9a-2e2ebd6a4c1c.aspx</comments>
      <category>Architecture</category>
      <category>Windows Azure</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=346fbda0-3ff7-4e10-8e9e-a9c548299bf6</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,346fbda0-3ff7-4e10-8e9e-a9c548299bf6.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,346fbda0-3ff7-4e10-8e9e-a9c548299bf6.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=346fbda0-3ff7-4e10-8e9e-a9c548299bf6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
At PDC, Microsoft announced Windows Azure - their Windows platform for cloud computing.
There's a lot we don't know about Azure, including the proper way to pronounce the
word. But that doesn't stop me from being both impressed and skeptical and about what
I <em>do</em> know.
</p>
        <p>
In the rest of this post, as I talk about Azure, I'm talking about the "real Azure".
One part of Azure is the idea that Microsoft would host my virtual machine in their
cloud - but to me that's not overly interesting, because that's already a commodity
market (my local ISP does this, Amazon does this - who doesn't do this??). What I
do think is interesting is the more abstract Azure platform, where my code runs in
a "role" and has access to a limited set of pre-defined resources. This is the Azure
that forces the use of a scale-out architecture.
</p>
        <p>
I was impressed by just how much Microsoft was able to show and demo at the PDC. For
a fledgling technology that is only partially defined, it was quite amazing to see
end-to-end applications built on stage, from the UI to business logic to data storage.
That was unexpected and fun to watch.
</p>
        <p>
I am skeptical as to whether anyone will actually care. I think the primary determination
about whether people care will be determined by the price point Microsoft sets. But
I also think it will be determined by how Microsoft addresses the "lock-in question".
</p>
        <p>
I expect the pricing to end up in one of three basic scenarios:
</p>
        <ol>
          <li>
Azure is priced for the Fortune 500 (or 100) - in which case the vast majority of
us won't care about it</li>
          <li>
Azure is priced for the small to mid-sized company space (SMB) - in which case quite
a lot of us might be interested</li>
          <li>
Azure is priced to be accessible for hosting your blog, or my blog, or <a href="http://www.lhotka.net">www.lhotka.net</a> or
other small/personal web sites - in which case the vast majority of us may care a
lot about it</li>
        </ol>
        <p>
These aren't entirely mutually exclusive. I think 2 and 3 could both happen, but I
think 1 is by itself. Big enterprises have such different needs than people or SMB,
and they do business in such different ways compared to most businesses or people,
that I suspect we'll see Microsoft either pursue 1 (which I think would be sad) or
2 and maybe 3.
</p>
        <p>
But there's also the lock-in question. If I built my application for Azure, Microsoft
has made it very clear that I will not be able to run my app on my servers. If I need
to downsize, or scale back, I really can't. Once you go to Azure, you are there permanently.
I suspect this will be a major sticking point for many organizations. I've seen quotes
by Microsoft people suggesting that we should all factor our applications into "the
part we host" and "the part they host". But even assuming we're all willing to go
to that work, and introduce that complexity, this still means that part of my app
can <em>never</em> run anywhere but on Microsoft's servers.
</p>
        <p>
I suspect this lock-in issue will be the biggest single roadblock to adoption for
most organizations (assuming reasonable pricing - which I think is a given).
</p>
        <p>
But I must say that even if Microsoft doesn't back down on this. And even if it does
block the success of "Windows Azure" as we see it now, that's probably OK.
</p>
        <p>
Why?
</p>
        <p>
Because I think the <em>biggest benefit</em> to Azure is one important concept: an
abstract runtime.
</p>
        <p>
If you or I write a .NET web app today, what are the odds that we can just throw it
on a random Windows Server 200x box and have it work? Pretty darn small. The same
is true for apps written for Unix, Linux or any other platform.
</p>
        <p>
The reason apps can't just "run anywhere" is because they are built for a very broad
and ill-defined platform, with no consistently defined architecture. Sure <em>you</em> might
have an architecture. And I might have one too. But they are probably not the same.
The resulting applications probably use different parts of the platform, in different
ways, with different dependencies, different configuration requirements and so forth.
The end result is that a high level of expertise is required to deploy any one of
our apps.
</p>
        <p>
This is one reason the "host a virtual machine" model is becoming so popular. I can
build my app however I choose. I can get it running on a VM. Then I can deploy the
whole darn VM, preconfigured, to some host. This is one solution to the problem, but
it is not very elegant, and it is certainly not very efficient.
</p>
        <p>
I think Azure (whether it succeeds or fails) illustrates a different solution to the
problem. Azure defines a limited architecture for applications. It isn't a new architecture,
and it isn't the simplest architecture. But it is an architecture that is <em>known
to scale</em>. And Azure basically says "if you want to play, you play my way". None
of this random use of platform features. There are few platform features, and they
all fit within this narrow architecture that is known to work.
</p>
        <p>
To me, this idea is the real future of the cloud. We need to quit pretending that
every application needs a "unique architecture" and realize that there are just a
very few architectures that are known to work. And if we pick a good one for most
or all apps, we might suffer a little in the short term (to get onto that architecture),
but we win in the long run because our apps really <em>can</em> run anywhere. At least
anywhere that can host that architecture.
</p>
        <p>
Now in reality, it is not just the architecture. It is a runtime and platform and
compilers and tools that support that architecture. Which brings us back to Windows
Azure as we know it. But even if Azure fails, I suspect we'll see the rise of similar
"restricted runtimes". Runtimes that may leverage parts of .NET (or Java or whatever),
but disallow the use of large regions of functionality, and disallow the use of native
platform features (from Windows, Linux, etc). Runtimes that <em>force a specific architecture</em>,
and thus ensure that the resulting apps are far more portable than the typical app
is today.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=346fbda0-3ff7-4e10-8e9e-a9c548299bf6" />
      </body>
      <title>Some thoughts on Windows Azure</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,346fbda0-3ff7-4e10-8e9e-a9c548299bf6.aspx</guid>
      <link>http://www.lhotka.net/weblog/SomeThoughtsOnWindowsAzure.aspx</link>
      <pubDate>Fri, 12 Dec 2008 00:31:31 GMT</pubDate>
      <description>&lt;p&gt;
At PDC, Microsoft announced Windows Azure - their Windows platform for cloud computing.
There's a lot we don't know about Azure, including the proper way to pronounce the
word. But that doesn't stop me from being both impressed and skeptical and about what
I &lt;em&gt;do&lt;/em&gt; know.
&lt;/p&gt;
&lt;p&gt;
In the rest of this post, as I talk about Azure, I'm talking about the "real Azure".
One part of Azure is the idea that Microsoft would host my virtual machine in their
cloud - but to me that's not overly interesting, because that's already a commodity
market (my local ISP does this, Amazon does this - who doesn't do this??). What I
do think is interesting is the more abstract Azure platform, where my code runs in
a "role" and has access to a limited set of pre-defined resources. This is the Azure
that forces the use of a scale-out architecture.
&lt;/p&gt;
&lt;p&gt;
I was impressed by just how much Microsoft was able to show and demo at the PDC. For
a fledgling technology that is only partially defined, it was quite amazing to see
end-to-end applications built on stage, from the UI to business logic to data storage.
That was unexpected and fun to watch.
&lt;/p&gt;
&lt;p&gt;
I am skeptical as to whether anyone will actually care. I think the primary determination
about whether people care will be determined by the price point Microsoft sets. But
I also think it will be determined by how Microsoft addresses the "lock-in question".
&lt;/p&gt;
&lt;p&gt;
I expect the pricing to end up in one of three basic scenarios:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Azure is priced for the Fortune 500 (or 100) - in which case the vast majority of
us won't care about it&lt;/li&gt;
&lt;li&gt;
Azure is priced for the small to mid-sized company space (SMB) - in which case quite
a lot of us might be interested&lt;/li&gt;
&lt;li&gt;
Azure is priced to be accessible for hosting your blog, or my blog, or &lt;a href="http://www.lhotka.net"&gt;www.lhotka.net&lt;/a&gt; or
other small/personal web sites - in which case the vast majority of us may care a
lot about it&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
These aren't entirely mutually exclusive. I think 2 and 3 could both happen, but I
think 1 is by itself. Big enterprises have such different needs than people or SMB,
and they do business in such different ways compared to most businesses or people,
that I suspect we'll see Microsoft either pursue 1 (which I think would be sad) or
2 and maybe 3.
&lt;/p&gt;
&lt;p&gt;
But there's also the lock-in question. If I built my application for Azure, Microsoft
has made it very clear that I will not be able to run my app on my servers. If I need
to downsize, or scale back, I really can't. Once you go to Azure, you are there permanently.
I suspect this will be a major sticking point for many organizations. I've seen quotes
by Microsoft people suggesting that we should all factor our applications into "the
part we host" and "the part they host". But even assuming we're all willing to go
to that work, and introduce that complexity, this still means that part of my app
can &lt;em&gt;never&lt;/em&gt; run anywhere but on Microsoft's servers.
&lt;/p&gt;
&lt;p&gt;
I suspect this lock-in issue will be the biggest single roadblock to adoption for
most organizations (assuming reasonable pricing - which I think is a given).
&lt;/p&gt;
&lt;p&gt;
But I must say that even if Microsoft doesn't back down on this. And even if it does
block the success of "Windows Azure" as we see it now, that's probably OK.
&lt;/p&gt;
&lt;p&gt;
Why?
&lt;/p&gt;
&lt;p&gt;
Because I think the &lt;em&gt;biggest benefit&lt;/em&gt; to Azure is one important concept: an
abstract runtime.
&lt;/p&gt;
&lt;p&gt;
If you or I write a .NET web app today, what are the odds that we can just throw it
on a random Windows Server 200x box and have it work? Pretty darn small. The same
is true for apps written for Unix, Linux or any other platform.
&lt;/p&gt;
&lt;p&gt;
The reason apps can't just "run anywhere" is because they are built for a very broad
and ill-defined platform, with no consistently defined architecture. Sure &lt;em&gt;you&lt;/em&gt; might
have an architecture. And I might have one too. But they are probably not the same.
The resulting applications probably use different parts of the platform, in different
ways, with different dependencies, different configuration requirements and so forth.
The end result is that a high level of expertise is required to deploy any one of
our apps.
&lt;/p&gt;
&lt;p&gt;
This is one reason the "host a virtual machine" model is becoming so popular. I can
build my app however I choose. I can get it running on a VM. Then I can deploy the
whole darn VM, preconfigured, to some host. This is one solution to the problem, but
it is not very elegant, and it is certainly not very efficient.
&lt;/p&gt;
&lt;p&gt;
I think Azure (whether it succeeds or fails) illustrates a different solution to the
problem. Azure defines a limited architecture for applications. It isn't a new architecture,
and it isn't the simplest architecture. But it is an architecture that is &lt;em&gt;known
to scale&lt;/em&gt;. And Azure basically says "if you want to play, you play my way". None
of this random use of platform features. There are few platform features, and they
all fit within this narrow architecture that is known to work.
&lt;/p&gt;
&lt;p&gt;
To me, this idea is the real future of the cloud. We need to quit pretending that
every application needs a "unique architecture" and realize that there are just a
very few architectures that are known to work. And if we pick a good one for most
or all apps, we might suffer a little in the short term (to get onto that architecture),
but we win in the long run because our apps really &lt;em&gt;can&lt;/em&gt; run anywhere. At least
anywhere that can host that architecture.
&lt;/p&gt;
&lt;p&gt;
Now in reality, it is not just the architecture. It is a runtime and platform and
compilers and tools that support that architecture. Which brings us back to Windows
Azure as we know it. But even if Azure fails, I suspect we'll see the rise of similar
"restricted runtimes". Runtimes that may leverage parts of .NET (or Java or whatever),
but disallow the use of large regions of functionality, and disallow the use of native
platform features (from Windows, Linux, etc). Runtimes that &lt;em&gt;force a specific architecture&lt;/em&gt;,
and thus ensure that the resulting apps are far more portable than the typical app
is today.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=346fbda0-3ff7-4e10-8e9e-a9c548299bf6" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,346fbda0-3ff7-4e10-8e9e-a9c548299bf6.aspx</comments>
      <category>Architecture</category>
      <category>Windows Azure</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=9efcafc7-68a2-4f8f-bc64-66174453adfd</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,9efcafc7-68a2-4f8f-bc64-66174453adfd.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,9efcafc7-68a2-4f8f-bc64-66174453adfd.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=9efcafc7-68a2-4f8f-bc64-66174453adfd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
One of the topic areas I get asked about frequently is authorization. Specifically
role-based authorization as supported by .NET, and how to make that work in the "real
world".
</p>
        <p>
I get asked about this because CSLA .NET (for Windows and Silverlight) follow the
standard role-based .NET model. In fact, CSLA .NET rests directly on the existing
.NET infrastructure.
</p>
        <p>
So what's the problem? Why doesn't the role-based model work in the real world?
</p>
        <p>
First off, it is important to realize that it <em>does work</em> for some scenarios.
It isn't bad for course-grained models where users are authorized at the page or form
level. ASP.NET directly uses this model for its authorization, and many people are
happy with that.
</p>
        <p>
But it doesn't match the requirements of a lot of organizations in my experience.
Many organizations have a slightly more complex structure that provides better administrative
control and manageability.
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Permissionbasedauthorizationvsrolebaseda_9EEA/image_2.png">
            <img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="274" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Permissionbasedauthorizationvsrolebaseda_9EEA/image_thumb.png" width="497" border="0" />
          </a>
        </p>
        <p>
Whether a user can get to a page/form, or can view a property or edit a property is
often controlled by a <em>permission</em>, not a role. In other words, users are in
roles, and a role is essentially a <em>permission set</em>: a list of permissions
the role has (or doesn't have).
</p>
        <p>
This doesn't map real well into the .NET IPrincipal interface, which only exposes
an IsInRole() method. Finding out if the user is in a role isn't particularly useful,
because the application really needs to call some sort of HasPermission() method.
</p>
        <p>
In my view the answer is relatively simple.
</p>
        <p>
The first step is understanding that there are two concerns here: the administrative
issues, and the runtime issues.
</p>
        <p>
At administration time the concepts of "user", "role" and "permission" are all important.
Admins will associate permissions with roles, and roles with users. This gives them
the kind of control and manageability they require.
</p>
        <p>
At <em>runtime</em>, when the user is actually using the application, the roles are <em>entirely
meaningless</em>. However, if you consider that IsInRole() can be <em>thought of as
"HasPermission()"</em>, then there's a solution. When you load the .NET principal
with a list of "roles", you really load it with a list of permissions. So when your
application asks "IsInRole()", it does it like this:
</p>
        <blockquote>
          <p>
bool result = currentPrincipal.IsInRole(requiredPermission);
</p>
        </blockquote>
        <p>
Notice that I am "misusing" the IsInRole() method by passing in the name of a permission,
not the name of a role. But that's ok, assuming that I've loaded my principal object
with a list of permissions instead of a list of roles. Remember, the IsInRole() method
typically does nothing more than determine whether the string parameter value is in
a list of known values. It doesn't really matter if that list of values are "roles"
or "permissions".
</p>
        <p>
And since, at runtime, no one cares about roles at all, there's no sense loading them
into memory. This means the list of "roles" can instead be a list of "permissions".
</p>
        <p>
The great thing is that many people store their users, roles and permissions in some
sort of relational store (like SQL Server). In that case it is a simple JOIN statement
to retrieve all permissions for a user, merging all the user's roles together to get
that list, and not returning the actual role values at all (because they are only
useful at admin time).
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=9efcafc7-68a2-4f8f-bc64-66174453adfd" />
      </body>
      <title>Permission-based authorization vs role-based authorization</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,9efcafc7-68a2-4f8f-bc64-66174453adfd.aspx</guid>
      <link>http://www.lhotka.net/weblog/PermissionbasedAuthorizationVsRolebasedAuthorization.aspx</link>
      <pubDate>Wed, 03 Dec 2008 17:19:01 GMT</pubDate>
      <description>&lt;p&gt;
One of the topic areas I get asked about frequently is authorization. Specifically
role-based authorization as supported by .NET, and how to make that work in the "real
world".
&lt;/p&gt;
&lt;p&gt;
I get asked about this because CSLA .NET (for Windows and Silverlight) follow the
standard role-based .NET model. In fact, CSLA .NET rests directly on the existing
.NET infrastructure.
&lt;/p&gt;
&lt;p&gt;
So what's the problem? Why doesn't the role-based model work in the real world?
&lt;/p&gt;
&lt;p&gt;
First off, it is important to realize that it &lt;em&gt;does work&lt;/em&gt; for some scenarios.
It isn't bad for course-grained models where users are authorized at the page or form
level. ASP.NET directly uses this model for its authorization, and many people are
happy with that.
&lt;/p&gt;
&lt;p&gt;
But it doesn't match the requirements of a lot of organizations in my experience.
Many organizations have a slightly more complex structure that provides better administrative
control and manageability.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Permissionbasedauthorizationvsrolebaseda_9EEA/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="274" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/Permissionbasedauthorizationvsrolebaseda_9EEA/image_thumb.png" width="497" border="0"&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Whether a user can get to a page/form, or can view a property or edit a property is
often controlled by a &lt;em&gt;permission&lt;/em&gt;, not a role. In other words, users are in
roles, and a role is essentially a &lt;em&gt;permission set&lt;/em&gt;: a list of permissions
the role has (or doesn't have).
&lt;/p&gt;
&lt;p&gt;
This doesn't map real well into the .NET IPrincipal interface, which only exposes
an IsInRole() method. Finding out if the user is in a role isn't particularly useful,
because the application really needs to call some sort of HasPermission() method.
&lt;/p&gt;
&lt;p&gt;
In my view the answer is relatively simple.
&lt;/p&gt;
&lt;p&gt;
The first step is understanding that there are two concerns here: the administrative
issues, and the runtime issues.
&lt;/p&gt;
&lt;p&gt;
At administration time the concepts of "user", "role" and "permission" are all important.
Admins will associate permissions with roles, and roles with users. This gives them
the kind of control and manageability they require.
&lt;/p&gt;
&lt;p&gt;
At &lt;em&gt;runtime&lt;/em&gt;, when the user is actually using the application, the roles are &lt;em&gt;entirely
meaningless&lt;/em&gt;. However, if you consider that IsInRole() can be &lt;em&gt;thought of as
"HasPermission()"&lt;/em&gt;, then there's a solution. When you load the .NET principal
with a list of "roles", you really load it with a list of permissions. So when your
application asks "IsInRole()", it does it like this:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
bool result = currentPrincipal.IsInRole(requiredPermission);
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Notice that I am "misusing" the IsInRole() method by passing in the name of a permission,
not the name of a role. But that's ok, assuming that I've loaded my principal object
with a list of permissions instead of a list of roles. Remember, the IsInRole() method
typically does nothing more than determine whether the string parameter value is in
a list of known values. It doesn't really matter if that list of values are "roles"
or "permissions".
&lt;/p&gt;
&lt;p&gt;
And since, at runtime, no one cares about roles at all, there's no sense loading them
into memory. This means the list of "roles" can instead be a list of "permissions".
&lt;/p&gt;
&lt;p&gt;
The great thing is that many people store their users, roles and permissions in some
sort of relational store (like SQL Server). In that case it is a simple JOIN statement
to retrieve all permissions for a user, merging all the user's roles together to get
that list, and not returning the actual role values at all (because they are only
useful at admin time).
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=9efcafc7-68a2-4f8f-bc64-66174453adfd" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,9efcafc7-68a2-4f8f-bc64-66174453adfd.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Microsoft .NET</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=2aef911a-1082-4f5b-9db2-eaf1aefe851d</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,2aef911a-1082-4f5b-9db2-eaf1aefe851d.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,2aef911a-1082-4f5b-9db2-eaf1aefe851d.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=2aef911a-1082-4f5b-9db2-eaf1aefe851d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
In preparation for the next public release of CSLA Light (CSLA .NET for Silverlight),
I'm going to do a series of posts describing the basic process of creating a CSLA
Light application. This first post will provide a high-level overview of the project
structure and some concepts.
</p>
        <p>
First, it is important to realize that CSLA Light will support three primary physical
architectures: a 3-tier (or SOA) model, a 3-tier mobile objects model and a 4-tier
mobile objects model. At all times CSLA Light follows the same n-layer <em>logical
architecture</em> of CSLA .NET, where the application has the following layers:
</p>
        <ol>
          <li>
Presentation/UI 
</li>
          <li>
Business 
</li>
          <li>
Data Access 
</li>
          <li>
Data Storage</li>
        </ol>
        <p>
The primary goal of CSLA Light and CSLA .NET is to support the creation of the Business
layer in such a way that the interface points to the Presentation/UI layer and to
the Data Access layer are clearly defined. 
</p>
        <p>
To a small degree, CSLA Light will assist in the creation of the Presentation/UI layer
by providing some custom Silverlight controls that solve common issues and reduce
UI code.
</p>
        <p>
Like CSLA .NET, CSLA Light is <em>not</em> an ORM and does not really care how you
talk to your database. It simply defines a set of CRUD operators - locations where
you should invoke your Data Access layer to retrieve and update data.
</p>
        <h3>3-Tier or SOA Model
</h3>
        <p>
If you use CSLA Light in a 3-tier (or SOA) model, your physical tiers are:
</p>
        <ol>
          <li>
Silverlight 
</li>
          <li>
Service 
</li>
          <li>
Database</li>
        </ol>
        <p>
You can treat these as tiers, or as separate applications where you use SOA concepts
for communication between the applications. That's really up to you. In this case
the focus of CSLA Light is <em>entirely on the Silverlight tier</em>. In that Silverlight
tier, you'll have the following logical layers:
</p>
        <ol>
          <li>
Presentation/UI 
</li>
          <li>
Business 
</li>
          <li>
Data Access/Service Facade</li>
        </ol>
        <p>
To do this, you configure the CSLA Light data portal to run in <em>local mode</em> and
it calls the DataPortal_XYZ methods right there in the Silverlight client tier. You
implement the DataPortal_XYZ methods to invoke remote services in the Service tier.
CSLA Light doesn't care what those services look like or how they are implemented.
They could be asmx, WCF, RSS, JSON, RESTful, SOAP-based - it just doesn't matter.
If you can call it from Silverlight, you can use it.
</p>
        <p>
The CSLA Light data portal is designed to be asynchronous, because any calls to remote
services in Silverlight will be an asynchronous operation. In other words, the data
portal is designed to support you as you call these remote services asynchronously.
</p>
        <p>
The only requirement is that by the time your async DataPortal_XYZ method completes,
that the object's data be created, retrieved, updated or deleted.
</p>
        <p>
This is the simplest of the CSLA Light architectures (assuming the services and database
already exist) because you just create one project, a Silverlight Application, and
all your code goes into that project. Or perhaps you create two projects, a Silverlight
Application for the UI and a Silverlight Class Library for your business objects,
but even that is pretty straightforward.
</p>
        <h3>3-Tier Mobile Objects Model
</h3>
        <p>
If you use CSLA Light in a 3-tier mobile objects model, your physical tiers are:
</p>
        <ol>
          <li>
Silverlight 
</li>
          <li>
Data portal server 
</li>
          <li>
Database</li>
        </ol>
        <p>
This is more like a traditional CSLA .NET model, because the data portal is used to
communicate between the Business layer on the Silverlight tier and the Business layer
on the Data portal server tier. Your business objects literally move back and forth
between those two tiers - just like they do between the client and server tiers in
a CSLA .NET 3-tier model.
</p>
        <p>
One interesting bit of information here though, is that your business objects are
not just moving between tiers, but they are moving between <em>platforms</em>. On
Silverlight they are CSLA Light objects in the Silverlight runtime, and on the Data
portal server they are CSLA .NET objects in the .NET runtime. The CSLA Light data
portal makes this possible, and the result is really very cool, because most of your
business object code is written <em>one time</em> and yet runs in both locations!
</p>
        <p>
The Data Access layer only exists on the Data portal server, in .NET. So the Silverlight
tier relies on the data portal, and the .NET server, for all create, fetch, update
and delete behaviors. Also, that data access code is not even deployed to the client.
</p>
        <p>
However, the client does have most business and validation and authorization logic.
So the user experience is rich, interactive and immediate - just like a WPF or Windows
Forms user experience.
</p>
        <p>
This architecture is a little more complex, and requires that you create several projects.
The following figure shows a simple solution with the required projects:
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/UsingCSLALightPart1_9F1F/image3.png">
            <img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="334" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/UsingCSLALightPart1_9F1F/image3_thumb.png" width="248" border="0" />
          </a>
        </p>
        <p>
Here's an explanation of the projects:
</p>
        <ul>
          <li>
SimpleAppWeb: web app hosting the Silverlight xap file and the data portal service 
</li>
          <li>
Library.Client: Silverlight Class Library containing business classes 
</li>
          <li>
Library.Server: .NET Class Library containing business classes 
</li>
          <li>
SimpleApp: Silverlight Application containing the Silverlight UI application</li>
        </ul>
        <p>
The big thing to notice here, is that the CustomerEdit.vb class exists in both Library.Client
and Library.Server. In Library.Server it is a <em>linked file</em>, meaning that the
project merely links to the file that exists in Library.Client. You can tell this
by the different icon glyph in Solution Explorer.
</p>
        <p>
The reason for this is that CustomerEdit.vb contains code for a business object that
moves between the Silverlight client and the .NET server. It contains code that compiles
in both environments.
</p>
        <p>
You can then use compiler directives or partial classes to implement code in that
class that is Silverlight-only or .NET-only. I started a <a href="http://forums.lhotka.net/forums/thread/24921.aspx">thread
on the forum</a> about which is better - people seem to prefer partial classes, though
compiler directives is certainly a clean solution as well.
</p>
        <h3>4-Tier Mobile Objects Model
</h3>
        <p>
If you use CSLA Light in a 4-tier mobile objects model, your physical tiers are:
</p>
        <ol>
          <li>
Silverlight 
</li>
          <li>
Data portal server (web) 
</li>
          <li>
Data portal server (application) 
</li>
          <li>
Database</li>
        </ol>
        <p>
From a Silverlight perspective this is <em>exactly the same as the 3-tier model</em>.
The difference is purely in how the CSLA .NET data portal is configured on the web
server (#2). In this case, the CSLA .NET data portal is configured to be in remote
mode, so all data portal calls on machine 2 are relayed to machine 3.
</p>
        <p>
This is totally normal CSLA .NET behavior, and doesn't change how anything else works.
But it can be a useful physical architecture in the case that the web server (#2)
that is exposed to the Internet so the Silverlight client can interact with it, is
not allowed to talk to the database. In other words, you could have an external firewall
between 1 and 2, and then an internal firewall between 2 and 3. So machine 2 is in
a DMZ, and machine 3 is the only one allowed to talk to the database.
</p>
        <p>
What I'm describing is a pretty standard web deployment model for CSLA .NET - but
with a CSLA Light client out there, instead of a simple web page.
</p>
        <p>
As I continue this series I'll dig into the code of this simple application, showing
how to create the business class, configure the data portal and set up the Silverlight
UI project. 
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=2aef911a-1082-4f5b-9db2-eaf1aefe851d" />
      </body>
      <title>Using CSLA Light, Part 1</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,2aef911a-1082-4f5b-9db2-eaf1aefe851d.aspx</guid>
      <link>http://www.lhotka.net/weblog/UsingCSLALightPart1.aspx</link>
      <pubDate>Mon, 28 Jul 2008 16:26:08 GMT</pubDate>
      <description>&lt;p&gt;
In preparation for the next public release of CSLA Light (CSLA .NET for Silverlight),
I'm going to do a series of posts describing the basic process of creating a CSLA
Light application. This first post will provide a high-level overview of the project
structure and some concepts.
&lt;/p&gt;
&lt;p&gt;
First, it is important to realize that CSLA Light will support three primary physical
architectures: a 3-tier (or SOA) model, a 3-tier mobile objects model and a 4-tier
mobile objects model. At all times CSLA Light follows the same n-layer &lt;em&gt;logical
architecture&lt;/em&gt; of CSLA .NET, where the application has the following layers:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Presentation/UI 
&lt;li&gt;
Business 
&lt;li&gt;
Data Access 
&lt;li&gt;
Data Storage&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The primary goal of CSLA Light and CSLA .NET is to support the creation of the Business
layer in such a way that the interface points to the Presentation/UI layer and to
the Data Access layer are clearly defined. 
&lt;/p&gt;
&lt;p&gt;
To a small degree, CSLA Light will assist in the creation of the Presentation/UI layer
by providing some custom Silverlight controls that solve common issues and reduce
UI code.
&lt;/p&gt;
&lt;p&gt;
Like CSLA .NET, CSLA Light is &lt;em&gt;not&lt;/em&gt; an ORM and does not really care how you
talk to your database. It simply defines a set of CRUD operators - locations where
you should invoke your Data Access layer to retrieve and update data.
&lt;/p&gt;
&lt;h3&gt;3-Tier or SOA Model
&lt;/h3&gt;
&lt;p&gt;
If you use CSLA Light in a 3-tier (or SOA) model, your physical tiers are:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Silverlight 
&lt;li&gt;
Service 
&lt;li&gt;
Database&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
You can treat these as tiers, or as separate applications where you use SOA concepts
for communication between the applications. That's really up to you. In this case
the focus of CSLA Light is &lt;em&gt;entirely on the Silverlight tier&lt;/em&gt;. In that Silverlight
tier, you'll have the following logical layers:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Presentation/UI 
&lt;li&gt;
Business 
&lt;li&gt;
Data Access/Service Facade&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
To do this, you configure the CSLA Light data portal to run in &lt;em&gt;local mode&lt;/em&gt; and
it calls the DataPortal_XYZ methods right there in the Silverlight client tier. You
implement the DataPortal_XYZ methods to invoke remote services in the Service tier.
CSLA Light doesn't care what those services look like or how they are implemented.
They could be asmx, WCF, RSS, JSON, RESTful, SOAP-based - it just doesn't matter.
If you can call it from Silverlight, you can use it.
&lt;/p&gt;
&lt;p&gt;
The CSLA Light data portal is designed to be asynchronous, because any calls to remote
services in Silverlight will be an asynchronous operation. In other words, the data
portal is designed to support you as you call these remote services asynchronously.
&lt;/p&gt;
&lt;p&gt;
The only requirement is that by the time your async DataPortal_XYZ method completes,
that the object's data be created, retrieved, updated or deleted.
&lt;/p&gt;
&lt;p&gt;
This is the simplest of the CSLA Light architectures (assuming the services and database
already exist) because you just create one project, a Silverlight Application, and
all your code goes into that project. Or perhaps you create two projects, a Silverlight
Application for the UI and a Silverlight Class Library for your business objects,
but even that is pretty straightforward.
&lt;/p&gt;
&lt;h3&gt;3-Tier Mobile Objects Model
&lt;/h3&gt;
&lt;p&gt;
If you use CSLA Light in a 3-tier mobile objects model, your physical tiers are:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Silverlight 
&lt;li&gt;
Data portal server 
&lt;li&gt;
Database&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
This is more like a traditional CSLA .NET model, because the data portal is used to
communicate between the Business layer on the Silverlight tier and the Business layer
on the Data portal server tier. Your business objects literally move back and forth
between those two tiers - just like they do between the client and server tiers in
a CSLA .NET 3-tier model.
&lt;/p&gt;
&lt;p&gt;
One interesting bit of information here though, is that your business objects are
not just moving between tiers, but they are moving between &lt;em&gt;platforms&lt;/em&gt;. On
Silverlight they are CSLA Light objects in the Silverlight runtime, and on the Data
portal server they are CSLA .NET objects in the .NET runtime. The CSLA Light data
portal makes this possible, and the result is really very cool, because most of your
business object code is written &lt;em&gt;one time&lt;/em&gt; and yet runs in both locations!
&lt;/p&gt;
&lt;p&gt;
The Data Access layer only exists on the Data portal server, in .NET. So the Silverlight
tier relies on the data portal, and the .NET server, for all create, fetch, update
and delete behaviors. Also, that data access code is not even deployed to the client.
&lt;/p&gt;
&lt;p&gt;
However, the client does have most business and validation and authorization logic.
So the user experience is rich, interactive and immediate - just like a WPF or Windows
Forms user experience.
&lt;/p&gt;
&lt;p&gt;
This architecture is a little more complex, and requires that you create several projects.
The following figure shows a simple solution with the required projects:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/UsingCSLALightPart1_9F1F/image3.png"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=334 alt=image src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/UsingCSLALightPart1_9F1F/image3_thumb.png" width=248 border=0&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Here's an explanation of the projects:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
SimpleAppWeb: web app hosting the Silverlight xap file and the data portal service 
&lt;li&gt;
Library.Client: Silverlight Class Library containing business classes 
&lt;li&gt;
Library.Server: .NET Class Library containing business classes 
&lt;li&gt;
SimpleApp: Silverlight Application containing the Silverlight UI application&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The big thing to notice here, is that the CustomerEdit.vb class exists in both Library.Client
and Library.Server. In Library.Server it is a &lt;em&gt;linked file&lt;/em&gt;, meaning that the
project merely links to the file that exists in Library.Client. You can tell this
by the different icon glyph in Solution Explorer.
&lt;/p&gt;
&lt;p&gt;
The reason for this is that CustomerEdit.vb contains code for a business object that
moves between the Silverlight client and the .NET server. It contains code that compiles
in both environments.
&lt;/p&gt;
&lt;p&gt;
You can then use compiler directives or partial classes to implement code in that
class that is Silverlight-only or .NET-only. I started a &lt;a href="http://forums.lhotka.net/forums/thread/24921.aspx"&gt;thread
on the forum&lt;/a&gt; about which is better - people seem to prefer partial classes, though
compiler directives is certainly a clean solution as well.
&lt;/p&gt;
&lt;h3&gt;4-Tier Mobile Objects Model
&lt;/h3&gt;
&lt;p&gt;
If you use CSLA Light in a 4-tier mobile objects model, your physical tiers are:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Silverlight 
&lt;li&gt;
Data portal server (web) 
&lt;li&gt;
Data portal server (application) 
&lt;li&gt;
Database&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
From a Silverlight perspective this is &lt;em&gt;exactly the same as the 3-tier model&lt;/em&gt;.
The difference is purely in how the CSLA .NET data portal is configured on the web
server (#2). In this case, the CSLA .NET data portal is configured to be in remote
mode, so all data portal calls on machine 2 are relayed to machine 3.
&lt;/p&gt;
&lt;p&gt;
This is totally normal CSLA .NET behavior, and doesn't change how anything else works.
But it can be a useful physical architecture in the case that the web server (#2)
that is exposed to the Internet so the Silverlight client can interact with it, is
not allowed to talk to the database. In other words, you could have an external firewall
between 1 and 2, and then an internal firewall between 2 and 3. So machine 2 is in
a DMZ, and machine 3 is the only one allowed to talk to the database.
&lt;/p&gt;
&lt;p&gt;
What I'm describing is a pretty standard web deployment model for CSLA .NET - but
with a CSLA Light client out there, instead of a simple web page.
&lt;/p&gt;
&lt;p&gt;
As I continue this series I'll dig into the code of this simple application, showing
how to create the business class, configure the data portal and set up the Silverlight
UI project. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=2aef911a-1082-4f5b-9db2-eaf1aefe851d" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,2aef911a-1082-4f5b-9db2-eaf1aefe851d.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=edd4adbe-6009-4503-9a22-eb6897e76621</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,edd4adbe-6009-4503-9a22-eb6897e76621.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,edd4adbe-6009-4503-9a22-eb6897e76621.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=edd4adbe-6009-4503-9a22-eb6897e76621</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <em>I've been engaged in a discussion around CSLA .NET on an MSDN architecture forum -
you can </em>
          <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3264097&amp;SiteID=1">
            <em>see
the thread here</em>
          </a>
          <em>. I put quite a bit of time/effort into one of my replies,
and I wanted to repost it here for broader distribution:</em>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">I don’t think it is really fair to relate CSLA .NET
to CSLA Classic. I totally rewrote the framework for .NET (at least 4 times actually
– trying different approaches/concepts), and the only way in which CSLA .NET relates
to CSLA Classic is through some of the high level architectural goals around the use
of mobile objects and the minimization of UI code.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">The use of LSet in VB5/6, btw, was the closest approximation
to the concept of a union struct from C or Pascal or a common block from FORTRAN possible
in VB. LSet actually did a memcopy operation, and so wasn’t as good as a union struct,
but was radically faster than any other serialization option available in VB at the
time. So while it was far from ideal, it was the best option available back then.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">Obviously .NET provides superior options for serialization
through the BinaryFormatter and NetDataContractSerializer, and CSLA .NET makes use
of them. To be fair though, a union struct would still be radically faster <img alt="Smile" src="http://forums.microsoft.com/MSDN/emoticons/emotion-1.gif" /></font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">Before I go any further, it is very important to understand
the distinction between ‘layers’ and ‘tiers’. Clarity of wording is important when
having this kind of discussion. I discuss the difference in Chapter 1 of my Expert
2005 Business Objects book, and in several blog posts – perhaps this one is best:</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <a title="http://www.lhotka.net/weblog/MiddletierHostingEnterpriseServicesIISDCOMWebServicesAndRemoting.aspx" href="http://www.lhotka.net/weblog/MiddletierHostingEnterpriseServicesIISDCOMWebServicesAndRemoting.aspx">
            <font face="Calibri" color="#0000ff" size="3">http://www.lhotka.net/weblog/MiddletierHostingEnterpriseServicesIISDCOMWebServicesAndRemoting.aspx</font>
          </a>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">The key thing is that a layer is a <i>logical separation
of concerns</i>, and a tier directly implies a process or network boundary. Layers
are a design constraint, tiers are a deployment artifact. </font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">How you layer your code is up to you. Many people, including
myself, often use assemblies to separate layers. But that is really just a crutch
– a reminder to have discipline. Any clear separation is sufficient. But you are absolutely
correct, in that a great many developers have trouble maintaining that discipline
without the clear separation provided by having different code in different projects
(assemblies).</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">1)</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">CSLA doesn’t group all layers into a single assembly.
Your business objects belong in one layer – often one assembly – and so all your business
logic (validation, calculation, data manipulation, authorization, etc) are in that
assembly.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">Also, because CSLA encourages the use of object-oriented
design and programming, encapsulation is important. And other OO concepts like data
hiding are encouraged. This means that the object must manage its own fields. Any
DAL will be working with data from the <i>object’s fields</i>. So the trick is to
get the data into and out of the private fields of the business object without breaking
encapsulation. I discussed the various options around this issue in my previous post.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">Ultimately the solution in most cases is for the DAL
to provide and consume the data through some clearly defined interface (ADO.NET objects
or DTOs) so the business object can manage its own fields, and can invoke the DAL
to handle the persistence of the data.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <b>
            <font size="3">
              <font face="Calibri">To be very clear then, CSLA enables separation
of the business logic into one assembly and the data access code into a separate assembly.</font>
            </font>
          </b>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">However, it doesn’t <i>force</i> you to do this, and
many people find it simpler to put the DAL code directly into the DataPortal_XYZ methods
of their business classes. That’s fine – there’s still <i>logical separation of concerns</i> and
logical layering – it just isn’t as explicit as putting that code in a separate assembly.
Some people have the discipline to make that work, and if they do have that discipline
then there’s nothing wrong with the approach imo.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">2)</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">I have no problem writing business rules in code. I
realize that some applications have rules that vary so rapidly or widely that the
only real solution is to use a metadata-driven rules engine, and in that case CSLA
isn’t a great match.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">But let’s face it, most applications don’t change that
fast. Most applications consist of business logic written in C#/VB/Java/etc. CSLA
simply helps formalize what most people already do, by providing a standardized approach
for implementing business and validation rules such that they are invoked efficiently
and automatically as needed.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">Also consider that CSLA’s approach separates the concept
of a business rule from the object itself. You then link properties on an object to
the rules that apply to that object. This linkage can be dynamic – metadata-driven.
Though the rules themselves are written as code, you can use a table-driven scheme
to link rules to properties, allowing for SaaS scenarios, etc.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">3)</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">This is an inaccurate assumption. CSLA .NET requires
a strong separation between the UI and business layers, and allows for a very clear
separation between the business and data access layers, and you can obviously achieve
separation between the data access and data storage layers.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">This means that you can easily have UI specialists that
know little or nothing about OO design or other business layer concepts. In fact,
when using WPF it is possible for the UI to only have UI-specific code – the separation
is cleaner than is possible with Windows Forms or Web Forms thanks to the improvements
in data binding.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">Also, when using ASP.NET MVC (in its present form at
least), the separation is extremely clear. Because the CSLA-based business objects
implement all business logic, the view and controller are both very trivial to create
and maintain. A controller method is typically just the couple lines of code necessary
to call the object’s factory and connect it to the view, or to call the MVC helper
to copy data from the postback into the object and to have the object save itself.
I’m really impressed with the MVC framework when used in conjunction with CSLA .NET.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">And it means that you can have data access specialists
that only focus on ADO.NET, LINQ to SQL, EF, nHibernate or whatever. In my experience
this is quite rare – very few developers are willing to be pigeonholed into such a
singularly uninteresting aspect of software – but perhaps your experiences have been
different.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">Obviously it is always possible to have database experts
who design and implement physical and logical database designs.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">4)</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">I entirely agree that the DTO design pattern is incredibly
valuable when building services. But no one pattern is a silver bullet and all patterns
have both positive and negative consequences. It is the responsibility of professional
software architects, designers and developers to use the appropriate patterns at the
appropriate times to achieve the best end results.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">CSLA .NET enables, but does not require, the concept
of <i>mobile objects</i>. This concept is incredibly powerful, and is in use by a
great many developers. Anyone passing disconnection ADO recordsets, or DataSets or
hashtables/dictionaries/lists across the network uses a form of mobile objects. CSLA
simply wraps a pre-existing feature of .NET and makes it easier for you to pass <i>your
own rich objects</i> across the network.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">Obviously only the object’s field values travel across
the network. This means that a business object consumes no more network bandwidth
than a DTO. But mobile objects provide a higher level of transparency in that the
developer can work with essentially the same object model, and the same behaviors,
on either side of the network.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">Is this appropriate for all scenarios? No. Decisions
about whether the pattern is appropriate for any scenario or application should be
based on serious consideration of the positive and negative consequences of the pattern.
Like any pattern, mobile objects has both types of consequence.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">If you look at my blog over the past few years, I’ve
frequently discussed the pros and cons of using a pure service-oriented approach vs
an n-tier approach. Typically my n-tier arguments pre-suppose the use of mobile objects,
and there are some discussions explicitly covering mobile objects.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">The DTO pattern is a part of any service-oriented approach,
virtually by definition. Though it is quite possible to manipulate your XML messages
directly, most people find that unproductive and prefer to use a DTO as an intermediary
– which makes sense for productivity even if it isn’t necessarily ideal for performance
or control.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">The DTO pattern can be used for n-tier approaches as
well, but it is entirely optional. And when compared to other n-tier techniques involving
things like the DataSet or mobile objects the DTO pattern’s weaknesses become much
more noticeable.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">The mobile object pattern is not useful for any true
service-oriented scenario (note that I’m not talking about web services here, but
rather true message-based SOA). This is because your business objects are your internal
implementation and should never be directly exposed as part of your external contract.
That sort of coupling between your external interface contract and your internal implementation
is always bad – and is obviously inappropriate when using DTOs as well. DTOs can comprise
part of your external contract, but should never be part of your internal implementation.</font>
        </p>
        <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
          <font face="Calibri" size="3">The mobile object pattern is very useful for n-tier
scenarios because it enables some very powerful application models. Most notably,
the way it is done in CSLA, it allows the application to switch between a 1-, 2- and
3-tier physical deployment merely by changing a configuration file. The UI, business
and data developers do not need to change any code or worry about the details – assuming
they’ve followed the rules for building proper CSLA-based business objects.</font>
        </p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=edd4adbe-6009-4503-9a22-eb6897e76621" />
      </body>
      <title>Repost from an MSDN forum discussion</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,edd4adbe-6009-4503-9a22-eb6897e76621.aspx</guid>
      <link>http://www.lhotka.net/weblog/RepostFromAnMSDNForumDiscussion.aspx</link>
      <pubDate>Thu, 12 Jun 2008 14:58:29 GMT</pubDate>
      <description>&lt;p&gt;
&lt;em&gt;I've been engaged in a discussion around CSLA .NET on an MSDN architecture forum&amp;nbsp;-
you can &lt;/em&gt;&lt;a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=3264097&amp;amp;SiteID=1"&gt;&lt;em&gt;see
the thread here&lt;/em&gt;&lt;/a&gt;&lt;em&gt;. I put quite a bit of time/effort into one of my replies,
and I wanted to repost it here for broader distribution:&lt;/em&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;I don’t think it is really fair to relate CSLA .NET to CSLA
Classic. I totally rewrote the framework for .NET (at least 4 times actually – trying
different approaches/concepts), and the only way in which CSLA .NET relates to CSLA
Classic is through some of the high level architectural goals around the use of mobile
objects and the minimization of UI code.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;The use of LSet in VB5/6, btw, was the closest approximation
to the concept of a union struct from C or Pascal or a common block from FORTRAN possible
in VB. LSet actually did a memcopy operation, and so wasn’t as good as a union struct,
but was radically faster than any other serialization option available in VB at the
time. So while it was far from ideal, it was the best option available back then.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;Obviously .NET provides superior options for serialization
through the BinaryFormatter and NetDataContractSerializer, and CSLA .NET makes use
of them. To be fair though, a union struct would still be radically faster &lt;img alt=Smile src="http://forums.microsoft.com/MSDN/emoticons/emotion-1.gif"&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;Before I go any further, it is very important to understand
the distinction between ‘layers’ and ‘tiers’. Clarity of wording is important when
having this kind of discussion. I discuss the difference in Chapter 1 of my Expert
2005 Business Objects book, and in several blog posts – perhaps this one is best:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;a title=http://www.lhotka.net/weblog/MiddletierHostingEnterpriseServicesIISDCOMWebServicesAndRemoting.aspx href="http://www.lhotka.net/weblog/MiddletierHostingEnterpriseServicesIISDCOMWebServicesAndRemoting.aspx"&gt;&lt;font face=Calibri color=#0000ff size=3&gt;http://www.lhotka.net/weblog/MiddletierHostingEnterpriseServicesIISDCOMWebServicesAndRemoting.aspx&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;The key thing is that a layer is a &lt;i&gt;logical separation
of concerns&lt;/i&gt;, and a tier directly implies a process or network boundary. Layers
are a design constraint, tiers are a deployment artifact. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;How you layer your code is up to you. Many people, including
myself, often use assemblies to separate layers. But that is really just a crutch
– a reminder to have discipline. Any clear separation is sufficient. But you are absolutely
correct, in that a great many developers have trouble maintaining that discipline
without the clear separation provided by having different code in different projects
(assemblies).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;1)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;CSLA doesn’t group all layers into a single assembly. Your
business objects belong in one layer – often one assembly – and so all your business
logic (validation, calculation, data manipulation, authorization, etc) are in that
assembly.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;Also, because CSLA encourages the use of object-oriented
design and programming, encapsulation is important. And other OO concepts like data
hiding are encouraged. This means that the object must manage its own fields. Any
DAL will be working with data from the &lt;i&gt;object’s fields&lt;/i&gt;. So the trick is to
get the data into and out of the private fields of the business object without breaking
encapsulation. I discussed the various options around this issue in my previous post.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;Ultimately the solution in most cases is for the DAL to
provide and consume the data through some clearly defined interface (ADO.NET objects
or DTOs) so the business object can manage its own fields, and can invoke the DAL
to handle the persistence of the data.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;b&gt;&lt;font size=3&gt;&lt;font face=Calibri&gt;To be very clear then, CSLA enables separation
of the business logic into one assembly and the data access code into a separate assembly.&lt;/font&gt;&lt;/font&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;However, it doesn’t &lt;i&gt;force&lt;/i&gt; you to do this, and many
people find it simpler to put the DAL code directly into the DataPortal_XYZ methods
of their business classes. That’s fine – there’s still &lt;i&gt;logical separation of concerns&lt;/i&gt; and
logical layering – it just isn’t as explicit as putting that code in a separate assembly.
Some people have the discipline to make that work, and if they do have that discipline
then there’s nothing wrong with the approach imo.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;2)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;I have no problem writing business rules in code. I realize
that some applications have rules that vary so rapidly or widely that the only real
solution is to use a metadata-driven rules engine, and in that case CSLA isn’t a great
match.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;But let’s face it, most applications don’t change that fast.
Most applications consist of business logic written in C#/VB/Java/etc. CSLA simply
helps formalize what most people already do, by providing a standardized approach
for implementing business and validation rules such that they are invoked efficiently
and automatically as needed.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;Also consider that CSLA’s approach separates the concept
of a business rule from the object itself. You then link properties on an object to
the rules that apply to that object. This linkage can be dynamic – metadata-driven.
Though the rules themselves are written as code, you can use a table-driven scheme
to link rules to properties, allowing for SaaS scenarios, etc.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;3)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;This is an inaccurate assumption. CSLA .NET requires a strong
separation between the UI and business layers, and allows for a very clear separation
between the business and data access layers, and you can obviously achieve separation
between the data access and data storage layers.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;This means that you can easily have UI specialists that
know little or nothing about OO design or other business layer concepts. In fact,
when using WPF it is possible for the UI to only have UI-specific code – the separation
is cleaner than is possible with Windows Forms or Web Forms thanks to the improvements
in data binding.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;Also, when using ASP.NET MVC (in its present form at least),
the separation is extremely clear. Because the CSLA-based business objects implement
all business logic, the view and controller are both very trivial to create and maintain.
A controller method is typically just the couple lines of code necessary to call the
object’s factory and connect it to the view, or to call the MVC helper to copy data
from the postback into the object and to have the object save itself. I’m really impressed
with the MVC framework when used in conjunction with CSLA .NET.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;And it means that you can have data access specialists that
only focus on ADO.NET, LINQ to SQL, EF, nHibernate or whatever. In my experience this
is quite rare – very few developers are willing to be pigeonholed into such a singularly
uninteresting aspect of software – but perhaps your experiences have been different.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;Obviously it is always possible to have database experts
who design and implement physical and logical database designs.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;4)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;I entirely agree that the DTO design pattern is incredibly
valuable when building services. But no one pattern is a silver bullet and all patterns
have both positive and negative consequences. It is the responsibility of professional
software architects, designers and developers to use the appropriate patterns at the
appropriate times to achieve the best end results.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;CSLA .NET enables, but does not require, the concept of &lt;i&gt;mobile
objects&lt;/i&gt;. This concept is incredibly powerful, and is in use by a great many developers.
Anyone passing disconnection ADO recordsets, or DataSets or hashtables/dictionaries/lists
across the network uses a form of mobile objects. CSLA simply wraps a pre-existing
feature of .NET and makes it easier for you to pass &lt;i&gt;your own rich objects&lt;/i&gt; across
the network.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;Obviously only the object’s field values travel across the
network. This means that a business object consumes no more network bandwidth than
a DTO. But mobile objects provide a higher level of transparency in that the developer
can work with essentially the same object model, and the same behaviors, on either
side of the network.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;Is this appropriate for all scenarios? No. Decisions about
whether the pattern is appropriate for any scenario or application should be based
on serious consideration of the positive and negative consequences of the pattern.
Like any pattern, mobile objects has both types of consequence.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;If you look at my blog over the past few years, I’ve frequently
discussed the pros and cons of using a pure service-oriented approach vs an n-tier
approach. Typically my n-tier arguments pre-suppose the use of mobile objects, and
there are some discussions explicitly covering mobile objects.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;The DTO pattern is a part of any service-oriented approach,
virtually by definition. Though it is quite possible to manipulate your XML messages
directly, most people find that unproductive and prefer to use a DTO as an intermediary
– which makes sense for productivity even if it isn’t necessarily ideal for performance
or control.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;The DTO pattern can be used for n-tier approaches as well,
but it is entirely optional. And when compared to other n-tier techniques involving
things like the DataSet or mobile objects the DTO pattern’s weaknesses become much
more noticeable.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;The mobile object pattern is not useful for any true service-oriented
scenario (note that I’m not talking about web services here, but rather true message-based
SOA). This is because your business objects are your internal implementation and should
never be directly exposed as part of your external contract. That sort of coupling
between your external interface contract and your internal implementation is always
bad – and is obviously inappropriate when using DTOs as well. DTOs can comprise part
of your external contract, but should never be part of your internal implementation.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri size=3&gt;The mobile object pattern is very useful for n-tier scenarios
because it enables some very powerful application models. Most notably, the way it
is done in CSLA, it allows the application to switch between a 1-, 2- and 3-tier physical
deployment merely by changing a configuration file. The UI, business and data developers
do not need to change any code or worry about the details – assuming they’ve followed
the rules for building proper CSLA-based business objects.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=edd4adbe-6009-4503-9a22-eb6897e76621" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,edd4adbe-6009-4503-9a22-eb6897e76621.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=058245e1-17e9-453c-bff2-b7f3200a1ed4</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,058245e1-17e9-453c-bff2-b7f3200a1ed4.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,058245e1-17e9-453c-bff2-b7f3200a1ed4.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=058245e1-17e9-453c-bff2-b7f3200a1ed4</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've been prototyping various aspects of CSLA Light (CSLA for Silverlight) for some
time now. Enough to be confident that a decent subset of CSLA functionality will work
just fine in Silverlight - which is very exciting!
</p>
        <p>
The primary area of my focus is serialization of object graphs, and I've blogged about
this before. This one issue is directly on the critical path, because a resolution
is required for the data portal, object cloning and n-level undo.
</p>
        <p>
And I've come to a final decision regarding object serialization: I'm not going to
try and use reflection. Silverlight turns out to have some reasonable support for
reflection - enough for Microsoft to create a subset of the WCF DataContractSerializer.
Unfortunately it isn't enough to create something like the BinaryFormatter or NetDataContractSerializer,
primarily due to the limitations around reflecting against non-public fields.
</p>
        <p>
One option I considered is to say that only business objects with public read-write
properties are allowed. But that's a major constraint on OO design, and still doesn't
resolve issues around calling a property setter to load values into the object - because
object setters typically invoke authorization and validation logic.
</p>
        <p>
Another option I considered is to actually use reflection. I discussed this in a previous
blog post - because you <em>can</em> make it work as long as you insert about a dozen
lines of code <em>into every class you write</em>. But I've decided this is too onerous
and bug-prone. So while reflection could be made to work, I think the cost is too
high.
</p>
        <p>
Another option is to require that the business developer create a DTO (data transfer
object) for each business object type. And all field values would be stored in this
DTO rather than in normal fields. While this is a workable solution, it imposes a
coding burden not unlike that of using the struct concepts from my CSLA Classic days
in the 1990's. I'm not eager to repeat that model...
</p>
        <p>
Yet another option is to rely on the concept of <em>managed backing fields </em>that
I introduced in CSLA .NET 3.5. In CSLA .NET 3.5 I introduced the idea that you could
choose not to declare backing fields for your properties, and that you could allow
CSLA to manage the values for you in something called the FieldManager. Conceptually
this is similar to the concept of a DependencyProperty introduced by Microsoft for
WF and WPF.
</p>
        <p>
The reason I introduced managed backing fields is that I didn't expect Silverlight
to have reflection against private fields <em>at all</em>. I was excited when it turned
out to have a level of reflection, but now that I've done all this research and prototyping,
I've decided it isn't useful in the end. So I'm returning to my original plan - using
managed backing fields to avoid the use of reflection when serializing business objects.
</p>
        <p>
The idea is relatively simple. The FieldManager stores the property values in a dictionary
(it is actually a bit more complex than that for performance reasons, but conceptually
it is a dictionary). Because of this, it is entirely possible to write code to loop
through the values in the field manager and to copy them into a well-defined data
contract (DTO). In fact, it is possible to define one DTO that can handle any BusinessBase-derived
object, and other for any BusinessListBase-derived object and so forth. Basically
one DTO per CSLA base class.
</p>
        <p>
The MobileFormatter (the serializer I'm creating) can simply call Serialize() and
Deserialize() methods on the CSLA base classes (defined by an IMobileObject interface
that is implemented by BusinessBase, etc.) and the base class can get/set its data
into/out of the DTO supplied by the MobileFormatter.
</p>
        <p>
In the end, the MobileFormatter will have one DTO for each business object in the
object graph, all in a single list of DTOs. The DataContractSerializer can then be
used to convert that list of DTOs into an XML byte stream, as shown here:
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/CSLALightobjectserialization_12749/image_2.png">
            <img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="230" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/CSLALightobjectserialization_12749/image_thumb.png" width="260" border="0" />
          </a>
        </p>
        <p>
The XML byte stream can later be deserialized into a list of DTOs, and then into a
clone of the original object graph, as shown here:
</p>
        <p>
          <a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/CSLALightobjectserialization_12749/image_4.png">
            <img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height="197" alt="image" src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/CSLALightobjectserialization_12749/image_thumb_1.png" width="260" border="0" />
          </a>
        </p>
        <p>
Notice that the object graph shape is preserved (something the DataContractSerializer
in Silverlight can't do at all), and that the object graph is truly cloned.
</p>
        <p>
This decision does impose an important constraint on business objects created for
CSLA Light, in that they <em>must use managed backing fields</em>. Private backing
fields will not be supported. I prefer not to impose constraints, but this one seems
reasonable because the alternatives are all worse than this particular constraint.
</p>
        <p>
My goal is to allow you to write your properties, validation rules, business rules
and authorization rules exactly one time, and to have that code run on both the Silverlight
client and on your web/app server. To have that code compile into the Silverlight
runtime and the .NET runtime. To have CSLA .NET and CSLA Light provide the same set
of public and protected members so you get the same CSLA services in both environments.
</p>
        <p>
By restricting CSLA Light to only support managed backing fields, I can accomplish
that goal without imposing requirements for extra coding behind every business object,
or the insertion of arcane reflection code into every business class.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=058245e1-17e9-453c-bff2-b7f3200a1ed4" />
      </body>
      <title>CSLA Light object serialization</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,058245e1-17e9-453c-bff2-b7f3200a1ed4.aspx</guid>
      <link>http://www.lhotka.net/weblog/CSLALightObjectSerialization.aspx</link>
      <pubDate>Wed, 11 Jun 2008 02:01:50 GMT</pubDate>
      <description>&lt;p&gt;
I've been prototyping various aspects of CSLA Light (CSLA for Silverlight) for some
time now. Enough to be confident that a decent subset of CSLA functionality will work
just fine in Silverlight - which is very exciting!
&lt;/p&gt;
&lt;p&gt;
The primary area of my focus is serialization of object graphs, and I've blogged about
this before. This one issue is directly on the critical path, because a resolution
is required for the data portal, object cloning and n-level undo.
&lt;/p&gt;
&lt;p&gt;
And I've come to a final decision regarding object serialization: I'm not going to
try and use reflection. Silverlight turns out to have some reasonable support for
reflection - enough for Microsoft to create a subset of the WCF DataContractSerializer.
Unfortunately it isn't enough to create something like the BinaryFormatter or NetDataContractSerializer,
primarily due to the limitations around reflecting against non-public fields.
&lt;/p&gt;
&lt;p&gt;
One option I considered is to say that only business objects with public read-write
properties are allowed. But that's a major constraint on OO design, and still doesn't
resolve issues around calling a property setter to load values into the object - because
object setters typically invoke authorization and validation logic.
&lt;/p&gt;
&lt;p&gt;
Another option I considered is to actually use reflection. I discussed this in a previous
blog post - because you &lt;em&gt;can&lt;/em&gt; make it work as long as you insert about a dozen
lines of code &lt;em&gt;into every class you write&lt;/em&gt;. But I've decided this is too onerous
and bug-prone. So while reflection could be made to work, I think the cost is too
high.
&lt;/p&gt;
&lt;p&gt;
Another option is to require that the business developer create a DTO (data transfer
object) for each business object type. And all field values would be stored in this
DTO rather than in normal fields. While this is a workable solution, it imposes a
coding burden not unlike that of using the struct concepts from my CSLA Classic days
in the 1990's. I'm not eager to repeat that model...
&lt;/p&gt;
&lt;p&gt;
Yet another option is to rely on the concept of &lt;em&gt;managed backing fields &lt;/em&gt;that
I introduced in CSLA .NET 3.5. In CSLA .NET 3.5 I introduced the idea that you could
choose not to declare backing fields for your properties, and that you could allow
CSLA to manage the values for you in something called the FieldManager. Conceptually
this is similar to the concept of a DependencyProperty introduced by Microsoft for
WF and WPF.
&lt;/p&gt;
&lt;p&gt;
The reason I introduced managed backing fields is that I didn't expect Silverlight
to have reflection against private fields &lt;em&gt;at all&lt;/em&gt;. I was excited when it turned
out to have a level of reflection, but now that I've done all this research and prototyping,
I've decided it isn't useful in the end. So I'm returning to my original plan - using
managed backing fields to avoid the use of reflection when serializing business objects.
&lt;/p&gt;
&lt;p&gt;
The idea is relatively simple. The FieldManager stores the property values in a dictionary
(it is actually a bit more complex than that for performance reasons, but conceptually
it is a dictionary). Because of this, it is entirely possible to write code to loop
through the values in the field manager and to copy them into a well-defined data
contract (DTO). In fact, it is possible to define one DTO that can handle any BusinessBase-derived
object, and other for any BusinessListBase-derived object and so forth. Basically
one DTO per CSLA base class.
&lt;/p&gt;
&lt;p&gt;
The MobileFormatter (the serializer I'm creating) can simply call Serialize() and
Deserialize() methods on the CSLA base classes (defined by an IMobileObject interface
that is implemented by BusinessBase, etc.) and the base class can get/set its data
into/out of the DTO supplied by the MobileFormatter.
&lt;/p&gt;
&lt;p&gt;
In the end, the MobileFormatter will have one DTO for each business object in the
object graph, all in a single list of DTOs. The DataContractSerializer can then be
used to convert that list of DTOs into an XML byte stream, as shown here:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/CSLALightobjectserialization_12749/image_2.png"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=230 alt=image src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/CSLALightobjectserialization_12749/image_thumb.png" width=260 border=0&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
The XML byte stream can later be deserialized into a list of DTOs, and then into a
clone of the original object graph, as shown here:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/CSLALightobjectserialization_12749/image_4.png"&gt;&lt;img style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=197 alt=image src="http://www.lhotka.net/weblog/content/binary/WindowsLiveWriter/CSLALightobjectserialization_12749/image_thumb_1.png" width=260 border=0&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Notice that the object graph shape is preserved (something the DataContractSerializer
in Silverlight can't do at all), and that the object graph is truly cloned.
&lt;/p&gt;
&lt;p&gt;
This decision does impose an important constraint on business objects created for
CSLA Light, in that they &lt;em&gt;must use managed backing fields&lt;/em&gt;. Private backing
fields will not be supported. I prefer not to impose constraints, but this one seems
reasonable because the alternatives are all worse than this particular constraint.
&lt;/p&gt;
&lt;p&gt;
My goal is to allow you to write your properties, validation rules, business rules
and authorization rules exactly one time, and to have that code run on both the Silverlight
client and on your web/app server. To have that code compile into the Silverlight
runtime and the .NET runtime. To have CSLA .NET and CSLA Light provide the same set
of public and protected members so you get the same CSLA services in both environments.
&lt;/p&gt;
&lt;p&gt;
By restricting CSLA Light to only support managed backing fields, I can accomplish
that goal without imposing requirements for extra coding behind every business object,
or the insertion of arcane reflection code into every business class.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=058245e1-17e9-453c-bff2-b7f3200a1ed4" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,058245e1-17e9-453c-bff2-b7f3200a1ed4.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=ecb3a101-8708-4ab4-a825-af418036afd6</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,ecb3a101-8708-4ab4-a825-af418036afd6.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,ecb3a101-8708-4ab4-a825-af418036afd6.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=ecb3a101-8708-4ab4-a825-af418036afd6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I spent some time over the past few days using my prototype Silverlight serializer
to build a prototype Silverlight data portal. It is still fairly far from complete,
but at least I've proved out the basic concept and uncovered some interesting side-effects
of living in Silverlight.
</p>
        <p>
The good news is that the basic concept of the data portal works. Defining objects
that physically move between the Silverlight client and a .NET web server is practical,
and works in a manner similar to the pure .NET data portal.
</p>
        <p>
The bad news is that it can't work <em>exactly</em> like the pure .NET data portal,
and the technique does require some manual effort when creating the business assemblies
(yes, plural).
</p>
        <p>
The approach I'm taking involves having two business assemblies (VS projects) that
share many of the same code files. Suppose you want to have a Person object move between
the client and server. You need Person in a Silverlight class library <em>and in a
.NET class library</em>. This means two projects are required, even if they have the
same code file.
</p>
        <p>
Visual Studio makes this reasonable, because you can create the file in one project
(say the Silverlight class library) and then Add Existing Item and use the <em>Link</em> feature
to get that same file included into a .NET class library project.
</p>
        <p>
I also make the class be a partial class, so I can add extra code to the .NET class
library implementation. The result is:
</p>
        <blockquote>
          <p>
BusinessLibrary.Client (Silverlight class library) 
<br />
  -&gt; Person.cs
</p>
          <p>
BusinessLibrary.Server (.NET class library) 
<br />
  -&gt; Person.cs (linked from BusinessLibrary.Client) 
<br />
  -&gt; Person.Server.cs
</p>
        </blockquote>
        <p>
One key thing is that <em>both projects build a file called BusinessLibrary.dll</em>.
Also, because Person.cs is a shared file, it obviously has the same namespace. This
is all very important, because the serializer requires that the fully qualified type
name ("namespace.type,assembly") be the same on client and server. In my case it is
"BusinessLibrary.Person,BusinessLibrary".
</p>
        <p>
The Person.Server.cs file contains the server-only parts of the Person class - it
is just the rest of the partial class. The only catch here is that it <em>can not
define any fields</em> because that would obviously confuse the serializer since those
fields wouldn't exist on the client. Well, actually it could define fields as long
as they were marked as NonSerialized.
</p>
        <p>
Of course you could also have a partial Person.Client.cs in the Silverlight class
library - though I haven't found a need for that just yet.
</p>
        <p>
One thing I'm debating is whether the .NET side of the data portal should just directly
delegate Silverlight calls into the "real" data portal - effectively acting as a passive
router between Silverlight and the .NET objects. OR the .NET side of the data portal
could invoke specific methods (like Silverlight_Create(), Silverlight_Update(), etc)
so the business developer can include code to decide whether the calls should be processed
on the server at all.
</p>
        <p>
The first approach is simple, and certainly makes for a compelling story because it
works very much like CSLA today. The Silverlight client gets/updates objects in a
very direct manner.
</p>
        <p>
The second approach is a little more complex, but might be better because I'm not
sure you should blindly trust anything coming from the Silverlight client. You can
make a good argument that Silverlight is always outside the trust boundary of your
server application, so blindly passing calls from the client through the data portal
may not be advisable.
</p>
        <p>
Either way, what's really cool is that the original .NET data portal <em>remains fully
intact</em>. This means that the following two physical deployment scenarios are available:
</p>
        <blockquote>
          <p>
Silverlight -&gt; Web server -&gt; database 
<br />
Silverlight -&gt; Web server -&gt; App server -&gt; database
</p>
        </blockquote>
        <p>
Whether the web/app server is in 2- or 3-tier configuration is just a matter of how
the original .NET data portal (running on the web server) is configured. I think that's
awesome, as it easily enables two very common web server configurations.
</p>
        <p>
The big difference in how the Silverlight data portal works as compared to the .NET
data portal is on the client. In Silverlight you should never block the main UI thread,
which means calls to the server should be asynchronous. Which means the UI code can't
just do this:
</p>
        <blockquote>
          <p>
var person = Person.GetPerson(123);
</p>
        </blockquote>
        <p>
That sort of synchronous call would block the UI thread and lock the browser. Instead,
my current approach requires the UI developer to write code like this:
</p>
        <blockquote>
          <p>
var dp = new Csla.DataPortal(); 
<br />
dp.FetchCompleted += 
<br />
  new EventHandler&lt;Csla.DataPortalResult&lt;Person&gt;&gt;(dp_FetchCompleted); 
<br />
dp.BeginFetch&lt;Person&gt;(new SingleCriteria&lt;int&gt;(123));
</p>
        </blockquote>
        <p>
with a dp_FetchCompleted() method like:
</p>
        <blockquote>
          <p>
private void dp_FetchCompleted(object sender, Csla.DataPortalResult&lt;Person&gt;
e) 
<br />
{ 
<br />
  if (e.Error != null) 
<br />
    // e.Error is an exception - deal with the issue 
<br />
  else 
<br />
    // e.Object is your result - use it 
<br />
}
</p>
        </blockquote>
        <p>
So the UI code is more cumbersome than in .NET, but it follows the basic service-calling
technique used in any current Silverlight code, and I don't think it is too bad. It
isn't clear how to make this any simpler really.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=ecb3a101-8708-4ab4-a825-af418036afd6" />
      </body>
      <title>Prototype Silverlight data portal</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,ecb3a101-8708-4ab4-a825-af418036afd6.aspx</guid>
      <link>http://www.lhotka.net/weblog/PrototypeSilverlightDataPortal.aspx</link>
      <pubDate>Wed, 23 Apr 2008 14:08:36 GMT</pubDate>
      <description>&lt;p&gt;
I spent some time over the past few days using my prototype Silverlight serializer
to build a prototype Silverlight data portal. It is still fairly far from complete,
but at least I've proved out the basic concept and uncovered some interesting side-effects
of living in Silverlight.
&lt;/p&gt;
&lt;p&gt;
The good news is that the basic concept of the data portal works. Defining objects
that physically move between the Silverlight client and a .NET web server is practical,
and works in a manner similar to the pure .NET data portal.
&lt;/p&gt;
&lt;p&gt;
The bad news is that it can't work &lt;em&gt;exactly&lt;/em&gt; like the pure .NET data portal,
and the technique does require some manual effort when creating the business assemblies
(yes, plural).
&lt;/p&gt;
&lt;p&gt;
The approach I'm taking involves having two business assemblies (VS projects) that
share many of the same code files. Suppose you want to have a Person object move between
the client and server. You need Person in a Silverlight class library &lt;em&gt;and in a
.NET class library&lt;/em&gt;. This means two projects are required, even if they have the
same code file.
&lt;/p&gt;
&lt;p&gt;
Visual Studio makes this reasonable, because you can create the file in one project
(say the Silverlight class library) and then Add Existing Item and use the &lt;em&gt;Link&lt;/em&gt; feature
to get that same file included into a .NET class library project.
&lt;/p&gt;
&lt;p&gt;
I also make the class be a partial class, so I can add extra code to the .NET class
library implementation. The result is:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
BusinessLibrary.Client (Silverlight class library) 
&lt;br&gt;
&amp;nbsp; -&amp;gt; Person.cs
&lt;/p&gt;
&lt;p&gt;
BusinessLibrary.Server (.NET class library) 
&lt;br&gt;
&amp;nbsp; -&amp;gt; Person.cs (linked from BusinessLibrary.Client) 
&lt;br&gt;
&amp;nbsp; -&amp;gt; Person.Server.cs
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
One key thing is that &lt;em&gt;both projects build a file called BusinessLibrary.dll&lt;/em&gt;.
Also, because Person.cs is a shared file, it obviously has the same namespace. This
is all very important, because the serializer requires that the fully qualified type
name ("namespace.type,assembly") be the same on client and server. In my case it is
"BusinessLibrary.Person,BusinessLibrary".
&lt;/p&gt;
&lt;p&gt;
The Person.Server.cs file contains the server-only parts of the Person class - it
is just the rest of the partial class. The only catch here is that it &lt;em&gt;can not
define any fields&lt;/em&gt; because that would obviously confuse the serializer since those
fields wouldn't exist on the client. Well, actually it could define fields as long
as they were marked as NonSerialized.
&lt;/p&gt;
&lt;p&gt;
Of course you could also have a partial Person.Client.cs in the Silverlight class
library - though I haven't found a need for that just yet.
&lt;/p&gt;
&lt;p&gt;
One thing I'm debating is whether the .NET side of the data portal should just directly
delegate Silverlight calls into the "real" data portal - effectively acting as a passive
router between Silverlight and the .NET objects. OR the .NET side of the data portal
could invoke specific methods (like Silverlight_Create(), Silverlight_Update(), etc)
so the business developer can include code to decide whether the calls should be processed
on the server at all.
&lt;/p&gt;
&lt;p&gt;
The first approach is simple, and certainly makes for a compelling story because it
works very much like CSLA today. The Silverlight client gets/updates objects in a
very direct manner.
&lt;/p&gt;
&lt;p&gt;
The second approach is a little more complex, but might be better because I'm not
sure you should blindly trust anything coming from the Silverlight client. You can
make a good argument that Silverlight is always outside the trust boundary of your
server application, so blindly passing calls from the client through the data portal
may not be advisable.
&lt;/p&gt;
&lt;p&gt;
Either way, what's really cool is that the original .NET data portal &lt;em&gt;remains fully
intact&lt;/em&gt;. This means that the following two physical deployment scenarios are available:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
Silverlight -&amp;gt; Web server -&amp;gt; database 
&lt;br&gt;
Silverlight -&amp;gt; Web server -&amp;gt; App server -&amp;gt; database
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Whether the web/app server is in 2- or 3-tier configuration is just a matter of how
the original .NET data portal (running on the web server) is configured. I think that's
awesome, as it easily enables two very common web server configurations.
&lt;/p&gt;
&lt;p&gt;
The big difference in how the Silverlight data portal works as compared to the .NET
data portal is on the client. In Silverlight you should never block the main UI thread,
which means calls to the server should be asynchronous. Which means the UI code can't
just do this:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
var person = Person.GetPerson(123);
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
That sort of synchronous call would block the UI thread and lock the browser. Instead,
my current approach requires the UI developer to write code like this:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
var dp = new Csla.DataPortal(); 
&lt;br&gt;
dp.FetchCompleted += 
&lt;br&gt;
&amp;nbsp; new EventHandler&amp;lt;Csla.DataPortalResult&amp;lt;Person&amp;gt;&amp;gt;(dp_FetchCompleted); 
&lt;br&gt;
dp.BeginFetch&amp;lt;Person&amp;gt;(new SingleCriteria&amp;lt;int&amp;gt;(123));
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
with a dp_FetchCompleted() method like:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
private void dp_FetchCompleted(object sender, Csla.DataPortalResult&amp;lt;Person&amp;gt;
e) 
&lt;br&gt;
{ 
&lt;br&gt;
&amp;nbsp; if (e.Error != null) 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // e.Error is an exception - deal with the issue 
&lt;br&gt;
&amp;nbsp; else 
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; // e.Object is your result - use it 
&lt;br&gt;
}
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
So the UI code is more cumbersome than in .NET, but it follows the basic service-calling
technique used in any current Silverlight code, and I don't think it is too bad. It
isn't clear how to make this any simpler really.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=ecb3a101-8708-4ab4-a825-af418036afd6" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,ecb3a101-8708-4ab4-a825-af418036afd6.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=1ce9b2ba-7caa-4653-8049-94099fa60727</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,1ce9b2ba-7caa-4653-8049-94099fa60727.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,1ce9b2ba-7caa-4653-8049-94099fa60727.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=1ce9b2ba-7caa-4653-8049-94099fa60727</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Someone on the CSLA .NET discussion forum recently asked what new .NET 3.5 features
I used in CSLA .NET 3.5. The poster noted that there are a lot of new features in
.NET 3.5, which is true. They also included some .NET 3.0 features as "new", though
really those features have now been around for 15 months or so and were addressed
in CSLA .NET 3.0. CSLA .NET 3.0 already added support for WCF, WPF and WF, so those
technologies had very little impact on CSLA .NET 3.5.
</p>
        <p>
My philosophy is to use new technologies only if they provide value to me and my work.
In the case of CSLA .NET this is extended slightly, such that I try to make sure CSLA
.NET also <em>supports</em> new technologies that might be of value to people who
use CSLA .NET.
</p>
        <p>
While .NET 3.5 has a number of new technologies at various levels (UI, data, languages),
many of them required no changes to CSLA to support. I like to think this is because
I'm always trying to look into the future as I work on CSLA, anticipating at least
some of what is coming so I can make the transition smoother. For example, this is
why CSLA .NET 2.0 introduced a provider model for the data portal - because I knew
WCF was coming in a couple years and I wanted to be ready.
</p>
        <p>
Since CSLA .NET already supported data binding to WPF, Windows Forms and Web Forms,
there was no real work to do at the UI level for .NET 3.5. I actually <em>removed</em> Csla.Wpf.Validator
because WPF now directly supplies that behavior, but I really didn't <em>add</em> anything
for UI support because it is already there. 
</p>
        <p>
Looking forward beyond 3.5, it is possible I'll need to add support for ASP.NET MVC
because that technology eschews data binding in favor of other techniques to create
the view - but it is too early to know for sure what I'll do in that regard.
</p>
        <p>
Since CSLA .NET has always abstracted the business object concept from the data access
technique you choose, it automatically supported LINQ to SQL (and will automatically
support ADO.NET EF too). No changes required to do that were required, though I did
add Csla.Data.ContextManager to simplify the use of L2S data context objects (as a
companion to the new Csla.Data.ConnectionManager for raw ADO.NET connections). And
I enhanced Csla.Data.DataMapper to have some more powerful mapping options that may
be useful in some L2S or EF scenarios.
</p>
        <p>
LINQ to Objects did require some work. Technically this too was optional, but I felt
it was critical, and so there is now "LINQ to CSLA" functionality provided in 3.5
(thanks to my colleague Aaron Erickson). The primary feature of this is creating a
synchronized view of a BusinessListBase list when you do a non-projection query, which
means you can data bind the results of a non-projection query and allow the user to
add/remove items from the query result <em>and those changes are also reflected in
the original list</em>. As a cool option, LINQ to CSLA also implements indexed queries
against lists, so if you are doing many queries against the same list object you should
look into this as a performance booster!
</p>
        <p>
So all that's left are some of the language enhancements that exist to support LINQ.
And I do use some of them - mostly type inference (which I love). But I didn't go
through the entire body of existing code to use the new language features. The risk
of breaking functionality that has worked for 6-7 years is <em>way</em> too high!
I can't see where anyone would choose to take such a risk with a body of code, but
especially one like CSLA that is used by thousands of people world-wide.
</p>
        <p>
That means I used some of the new language features in new code, and in code I had
to rework anyway. And to be honest, I use those features sparingly and where I thought
they helped. 
</p>
        <p>
I think trying to force new technologies/concepts/patterns into code is a bad idea.
If a given pattern or technology obviously saves code/time/money or has other clear
benefits then I use it, but I try never to get attached to some idea such that I force
it into places where it doesn't fit with my overall goals.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=1ce9b2ba-7caa-4653-8049-94099fa60727" />
      </body>
      <title>My philosophy on using new technologies</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,1ce9b2ba-7caa-4653-8049-94099fa60727.aspx</guid>
      <link>http://www.lhotka.net/weblog/MyPhilosophyOnUsingNewTechnologies.aspx</link>
      <pubDate>Sat, 12 Apr 2008 21:11:52 GMT</pubDate>
      <description>&lt;p&gt;
Someone on the CSLA .NET discussion forum recently asked what new .NET 3.5 features
I used in CSLA .NET 3.5. The poster noted that there are a lot of new features in
.NET 3.5, which is true. They also included some .NET 3.0 features as "new", though
really those features have now been around for 15 months or so and were addressed
in CSLA .NET 3.0. CSLA .NET 3.0 already added support for WCF, WPF and WF, so those
technologies had very little impact on CSLA .NET 3.5.
&lt;/p&gt;
&lt;p&gt;
My philosophy is to use new technologies only if they provide value to me and my work.
In the case of CSLA .NET this is extended slightly, such that I try to make sure CSLA
.NET also &lt;em&gt;supports&lt;/em&gt; new technologies that might be of value to people who
use CSLA .NET.
&lt;/p&gt;
&lt;p&gt;
While .NET 3.5 has a number of new technologies at various levels (UI, data, languages),
many of them required no changes to CSLA to support. I like to think this is because
I'm always trying to look into the future as I work on CSLA, anticipating at least
some of what is coming so I can make the transition smoother. For example, this is
why CSLA .NET 2.0 introduced a provider model for the data portal - because I knew
WCF was coming in a couple years and I wanted to be ready.
&lt;/p&gt;
&lt;p&gt;
Since CSLA .NET already supported data binding to WPF, Windows Forms and Web Forms,
there was no real work to do at the UI level for .NET 3.5. I actually &lt;em&gt;removed&lt;/em&gt; Csla.Wpf.Validator
because WPF now directly supplies that behavior, but I really didn't &lt;em&gt;add&lt;/em&gt; anything
for UI support because it is already there. 
&lt;/p&gt;
&lt;p&gt;
Looking forward beyond 3.5, it is possible I'll need to add support for ASP.NET MVC
because that technology eschews data binding in favor of other techniques to create
the view - but it is too early to know for sure what I'll do in that regard.
&lt;/p&gt;
&lt;p&gt;
Since CSLA .NET has always abstracted the business object concept from the data access
technique you choose, it automatically supported LINQ to SQL (and will automatically
support ADO.NET EF too). No changes required to do that were required, though I did
add Csla.Data.ContextManager to simplify the use of L2S data context objects (as a
companion to the new Csla.Data.ConnectionManager for raw ADO.NET connections). And
I enhanced Csla.Data.DataMapper to have some more powerful mapping options that may
be useful in some L2S or EF scenarios.
&lt;/p&gt;
&lt;p&gt;
LINQ to Objects did require some work. Technically this too was optional, but I felt
it was critical, and so there is now "LINQ to CSLA" functionality provided in 3.5
(thanks to my colleague Aaron Erickson). The primary feature of this is creating a
synchronized view of a BusinessListBase list when you do a non-projection query, which
means you can data bind the results of a non-projection query and allow the user to
add/remove items from the query result &lt;em&gt;and those changes are also reflected in
the original list&lt;/em&gt;. As a cool option, LINQ to CSLA also implements indexed queries
against lists, so if you are doing many queries against the same list object you should
look into this as a performance booster!
&lt;/p&gt;
&lt;p&gt;
So all that's left are some of the language enhancements that exist to support LINQ.
And I do use some of them - mostly type inference (which I love). But I didn't go
through the entire body of existing code to use the new language features. The risk
of breaking functionality that has worked for 6-7 years is &lt;em&gt;way&lt;/em&gt; too high!
I can't see where anyone would choose to take such a risk with a body of code, but
especially one like CSLA that is used by thousands of people world-wide.
&lt;/p&gt;
&lt;p&gt;
That means I used some of the new language features in new code, and in code I had
to rework anyway. And to be honest, I use those features sparingly and where I thought
they helped. 
&lt;/p&gt;
&lt;p&gt;
I think trying to force new technologies/concepts/patterns into code is a bad idea.
If a given pattern or technology obviously saves code/time/money or has other clear
benefits then I use it, but I try never to get attached to some idea such that I force
it into places where it doesn't fit with my overall goals.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=1ce9b2ba-7caa-4653-8049-94099fa60727" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,1ce9b2ba-7caa-4653-8049-94099fa60727.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Microsoft .NET</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=255d7bf6-b739-4f1e-9244-c39d2afefe4f</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,255d7bf6-b739-4f1e-9244-c39d2afefe4f.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,255d7bf6-b739-4f1e-9244-c39d2afefe4f.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=255d7bf6-b739-4f1e-9244-c39d2afefe4f</wfw:commentRss>
      <title>Why enable the data portal behind a web service?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,255d7bf6-b739-4f1e-9244-c39d2afefe4f.aspx</guid>
      <link>http://www.lhotka.net/weblog/WhyEnableTheDataPortalBehindAWebService.aspx</link>
      <pubDate>Thu, 24 Jan 2008 14:01:56 GMT</pubDate>
      <description>&lt;p&gt;
I reader recently sent me an email asking why the PTWebService project in the CSLA
.NET ProjectTracker reference app has support for using the data portal to talk to
an application server. His understanding was that web services were end points, and
that they should just talk to the database directly. Here's my answer:
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;A
web service is just like any regular web application. The only meaningful difference
is that it exposes XML instead of HTML.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"&gt;Web
applications often need to talk to application servers. While you are correct – it
is ideal to build web apps in a 2-tier model, there are valid reasons (mostly around
security) why organizations choose to build them using a 3-tier model.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"&gt;The
most common scenario (probably used by 40% of all organizations) is to put a second
firewall between the web server and any internal servers. The web server is then never
allowed to talk to the database directly (for security reasons), and instead is required
to talk through that second firewall to an app server, which talks to the database.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"&gt;The
data portal in CSLA .NET helps address this issue, by allowing a web application to
talk to an app server using several possible technologies. Since different organizations
allow different technologies to penetrate that second firewall this flexibility is
important.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 11pt; COLOR: #1f497d; FONT-FAMILY: 'Calibri','sans-serif'; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-font-family: 'Times New Roman'; mso-bidi-theme-font: minor-bidi; mso-themecolor: dark2"&gt;Additionally,
the data portal exists for other scenarios, like Windows Forms or WPF applications.
It would be impractical for me to create different versions of CSLA for different
types of application interface. In fact that would defeat the whole point of the framework
– which is to provide a consistent and unified environment for building business layers
that support all valid interface types (Windows, Web, WPF, Workflow, web service,
WCF service, console, etc).&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=255d7bf6-b739-4f1e-9244-c39d2afefe4f" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,255d7bf6-b739-4f1e-9244-c39d2afefe4f.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Service-Oriented</category>
      <category>Web</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=d2783a8a-8b3e-4cc7-b964-918b8256b11b</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,d2783a8a-8b3e-4cc7-b964-918b8256b11b.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,d2783a8a-8b3e-4cc7-b964-918b8256b11b.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=d2783a8a-8b3e-4cc7-b964-918b8256b11b</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I recently received this email:
</p>
        <blockquote>
          <p>
            <em>Thank you very much for your insightful articles concerning 2 vs. 3 tier models. 
It’s very refreshing to hear a view point that I’m aligned with.  Here at work
I’m dealing with network Nazi’s who believe there is no cost of a middle tier and
that there is only huge security rewards to reap.  I use your articles to support
my point but I’m still not getting tremendously far.  I have yet to have anyone
explain to me exactly how that middle tier is going to really add a significant enough
amount of security that will warrant the high price to pay for employing a performance
blasting middle-man.</em>
          </p>
        </blockquote>
        <p>
There are two scenarios, though they are similar. 
</p>
        <p>
In the web, adding a middle tier has a very high cost, because the web server is <i>already</i> an
app server. It already does database connection pooling across all users on that server.
Adding an app server just adds overhead. 
</p>
        <p>
The only exception here is where the web server is serving up a lot of <em>static
content</em> and only some dynamic content. In that case, moving the data access to
another machine may be beneficial because it can allow the web server to focus more
on delivering the static content. It is important to realize that the dynamic content
will <em>still be delivered more slowly</em> due to overhead, but the overall web
site may work better. 
</p>
        <p>
In Windows, adding a middle tier has a cost because the data needs to make two network
hops to get to the user. Each network hop has a tangible cost. It would be foolish
to ignore the cost of moving data over the wire, and the cost of serializing/deserializing
the data on each end of the wire. These are very real, measurable costs. 
</p>
        <p>
In <em>both </em>cases the middle tier means an extra machine to license, administer,
maintain, power and cool. It is an extra point of failure, extra potential for network/CPU/memory/IO
contention, etc. These costs come with every server you add into the mix. Anyone who’s
ever been a manager or higher in an IT organization has a very good understanding
of these costs, because they impact the budget at the end of every year. 
</p>
        <p>
However, the security benefits of a middle tier are real. 
</p>
        <p>
In a 2-tier web model the database credentials are on the web server. Even if they
are encrypted they are there on that machine. A would-be hacker could get them by
cracking into that one machine. 
</p>
        <p>
Switching to a 3-tier model moves the database credentials onto the middle tier and
off the web server. Now the web server has credentials to the app server, but not
the database. A would-be hacker must crack first the web server, then the app server
to get those credentials. 
</p>
        <p>
In a 2-tier Windows model the database credentials are on each client workstation.
Even if they are encrypted they are there on those machines. A would-be hacker could
get them by sitting at that machine - all it takes is a little social engineering
and they're in. More likely, an <em>employee</em> may get the credentials and use
Excel or some other common tool to directly access the database, bypassing your application.
Oh the havoc they could wreak! 
</p>
        <p>
Switching to a 3-tier model moves the database credentials onto the middle tier and
off the client workstations. Now the workstations have credentials to the app server,
but not the database. A would-be hacker must crack into the app server to get those
credentials. And end users are almost automatically shut out, because they would have
to be a hacker to get to the app server to get the database credentials.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=d2783a8a-8b3e-4cc7-b964-918b8256b11b" />
      </body>
      <title>The costs and security benefits of n-tier over 2-tier</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,d2783a8a-8b3e-4cc7-b964-918b8256b11b.aspx</guid>
      <link>http://www.lhotka.net/weblog/TheCostsAndSecurityBenefitsOfNtierOver2tier.aspx</link>
      <pubDate>Fri, 21 Dec 2007 16:55:19 GMT</pubDate>
      <description>&lt;p&gt;
I recently received this email:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
&lt;em&gt;Thank you very much for your insightful articles concerning 2 vs. 3 tier models.&amp;nbsp;
It’s very refreshing to hear a view point that I’m aligned with.&amp;nbsp; Here at work
I’m dealing with network Nazi’s who believe there is no cost of a middle tier and
that there is only huge security rewards to reap.&amp;nbsp; I use your articles to support
my point but I’m still not getting tremendously far.&amp;nbsp; I have yet to have anyone
explain to me exactly how that middle tier is going to really add a significant enough
amount of security that will warrant the high price to pay for employing a performance
blasting middle-man.&lt;/em&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
There are two scenarios, though they are similar. 
&lt;p&gt;
In the web, adding a middle tier has a very high cost, because the web server is &lt;i&gt;already&lt;/i&gt; an
app server. It already does database connection pooling across all users on that server.
Adding an app server just adds overhead. 
&lt;p&gt;
The only exception here is where the web server is serving up a lot of &lt;em&gt;static
content&lt;/em&gt; and only some dynamic content. In that case, moving the data access to
another machine may be beneficial because it can allow the web server to focus more
on delivering the static content. It is important to realize that the dynamic content
will &lt;em&gt;still be delivered more slowly&lt;/em&gt; due to overhead, but the overall web
site may work better. 
&lt;p&gt;
In Windows, adding a middle tier has a cost because the data needs to make two network
hops to get to the user. Each network hop has a tangible cost. It would be foolish
to ignore the cost of moving data over the wire, and the cost of serializing/deserializing
the data on each end of the wire. These are very real, measurable costs. 
&lt;p&gt;
In &lt;em&gt;both &lt;/em&gt;cases the middle tier means an extra machine to license, administer,
maintain, power and cool. It is an extra point of failure, extra potential for network/CPU/memory/IO
contention, etc. These costs come with every server you add into the mix. Anyone who’s
ever been a manager or higher in an IT organization has a very good understanding
of these costs, because they impact the budget at the end of every year. 
&lt;p&gt;
However, the security benefits of a middle tier are real. 
&lt;p&gt;
In a 2-tier web model the database credentials are on the web server. Even if they
are encrypted they are there on that machine. A would-be hacker could get them by
cracking into that one machine. 
&lt;p&gt;
Switching to a 3-tier model moves the database credentials onto the middle tier and
off the web server. Now the web server has credentials to the app server, but not
the database. A would-be hacker must crack first the web server, then the app server
to get those credentials. 
&lt;p&gt;
In a 2-tier Windows model the database credentials are on each client workstation.
Even if they are encrypted they are there on those machines. A would-be hacker could
get them by sitting at that machine - all it takes is a little social engineering
and they're in. More likely, an &lt;em&gt;employee&lt;/em&gt; may get the credentials and use
Excel or some other common tool to directly access the database, bypassing your application.
Oh the havoc they could wreak! 
&lt;p&gt;
Switching to a 3-tier model moves the database credentials onto the middle tier and
off the client workstations. Now the workstations have credentials to the app server,
but not the database. A would-be hacker must crack into the app server to get those
credentials. And end users are almost automatically shut out, because they would have
to be a hacker to get to the app server to get the database credentials.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=d2783a8a-8b3e-4cc7-b964-918b8256b11b" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,d2783a8a-8b3e-4cc7-b964-918b8256b11b.aspx</comments>
      <category>Architecture</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=e891d247-a74e-4544-825f-905fbcb07eec</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,e891d247-a74e-4544-825f-905fbcb07eec.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,e891d247-a74e-4544-825f-905fbcb07eec.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=e891d247-a74e-4544-825f-905fbcb07eec</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I always encourage people to go with 2-tier deployments if possible, because more
tiers increases complexity and cost. 
</p>
        <p>
But it is important to recognize when the value of 3-tier outweighs that complexity/cost.
The primary three motivators are: 
</p>
        <ol>
          <li>
            <b>Security</b> – using an app server allows you to shift the database credentials
from clients to the server, adding security because a would-be hacker (or savvy end-user)
would need to hack into the app server to get those credentials.<br /></li>
          <li>
            <b>Network infrastructure limitations</b> – sometimes a 3-tier solution can help offload
processing from CPU-bound or memory-bound machines, or it can help minimize network
traffic over slow or congested links. Direct database communication is a chatty dialog,
and using an app server allows a single blob of data to go across the slow link, and
the chatty dialog to occur across a fast link, so 3-tier can result in a net win for
performance if the client-to-server link is slow or congested.<br /></li>
          <li>
            <b>Scalability</b> – using an app server provides for database connection pooling.
The trick here, is that if you don’t need it, you’ll <i>harm performance</i> by having
an app server, so this is only useful if database connections are taxing your database
server. Given the state of modern database hardware/software, scalability isn’t a
big deal for the vast majority of applications anymore.</li>
        </ol>
        <p>
The <a href="http://www.lhotka.net/cslanet">CSLA .NET</a> data portal is of great
value here, because it allows you to switch from 2-tier to 3-tier with a configuration
change - no code changes required*. You can deploy in the cheaper and simpler 2-tier
model to start with, and if one of these motivators later justifies the complexity
of moving to 3-tier, you can make that move with relative ease.
</p>
        <p>
* disclaimer: if you plan to make such a move, I <em>strongly</em> suggest testing
in 3-tier mode during development. While the data portal makes this 2-tier to 3-tier
switch seamless, it only works if the code in the business objects follows all the
rules around serialization and layer seperation. Testing in a 3-tier mode helps ensure
that none of those rules get accidentally broken during development.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=e891d247-a74e-4544-825f-905fbcb07eec" />
      </body>
      <title>Primary motivations to move from 2- to 3-tier</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,e891d247-a74e-4544-825f-905fbcb07eec.aspx</guid>
      <link>http://www.lhotka.net/weblog/PrimaryMotivationsToMoveFrom2To3tier.aspx</link>
      <pubDate>Tue, 13 Nov 2007 22:37:50 GMT</pubDate>
      <description>&lt;p&gt;
I always encourage people to go with 2-tier deployments if possible, because more
tiers increases complexity and cost. 
&lt;p&gt;
But it is important to recognize when the value of 3-tier outweighs that complexity/cost.
The primary three motivators are: 
&lt;ol&gt;
&lt;li&gt;
&lt;b&gt;Security&lt;/b&gt; – using an app server allows you to shift the database credentials
from clients to the server, adding security because a would-be hacker (or savvy end-user)
would need to hack into the app server to get those credentials.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Network infrastructure limitations&lt;/b&gt; – sometimes a 3-tier solution can help offload
processing from CPU-bound or memory-bound machines, or it can help minimize network
traffic over slow or congested links. Direct database communication is a chatty dialog,
and using an app server allows a single blob of data to go across the slow link, and
the chatty dialog to occur across a fast link, so 3-tier can result in a net win for
performance if the client-to-server link is slow or congested.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;b&gt;Scalability&lt;/b&gt; – using an app server provides for database connection pooling.
The trick here, is that if you don’t need it, you’ll &lt;i&gt;harm performance&lt;/i&gt; by having
an app server, so this is only useful if database connections are taxing your database
server. Given the state of modern database hardware/software, scalability isn’t a
big deal for the vast majority of applications anymore.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
The &lt;a href="http://www.lhotka.net/cslanet"&gt;CSLA .NET&lt;/a&gt; data portal is of great
value here, because it allows you to switch from 2-tier to 3-tier with a configuration
change - no code changes required*. You can deploy in the cheaper and simpler 2-tier
model to start with, and if one of these motivators later justifies the complexity
of moving to 3-tier, you can make that move with relative ease.
&lt;/p&gt;
&lt;p&gt;
* disclaimer: if you plan to make such a move, I &lt;em&gt;strongly&lt;/em&gt; suggest testing
in 3-tier mode during development. While the data portal makes this 2-tier to 3-tier
switch seamless, it only works if the code in the business objects follows all the
rules around serialization and layer seperation. Testing in a 3-tier mode helps ensure
that none of those rules get accidentally broken during development.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=e891d247-a74e-4544-825f-905fbcb07eec" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,e891d247-a74e-4544-825f-905fbcb07eec.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=524845db-67cb-489b-8312-e9de004d7789</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,524845db-67cb-489b-8312-e9de004d7789.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,524845db-67cb-489b-8312-e9de004d7789.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=524845db-67cb-489b-8312-e9de004d7789</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was recently asked whether CSLA incorporates thread synchronization code to marshal
calls or events back onto the UI thread when necessary. The short answer is no, but
the question deserves a bit more discussion to understand why it isn't the business
layer's job to handle such details. 
</p>
        <p>
The responsibility for cross-thread issues resides with the layer that started the
multi-threading. 
</p>
        <p>
So if the business layer internally utilizes multi-threading, then that layer must
abstract the concept from other layers. 
</p>
        <p>
But if the UI layer utilizes multi-threading (which is more common), then it is the
UI layer's job to abstract that concept. 
</p>
        <p>
It is unrealistic to build a reusable business layer around one type of multi-threading
model and expect it to work in other scenarios. Were you to use Windows Forms components
for thread synchronization, you'd be out of luck in the ASP.NET world, for example. 
</p>
        <p>
So CSLA does nothing in this regard, at the business object level anyway. Nor does
a DataSet, or the entity objects from ADO.NET EF, etc. It isn't the business/entity
layer's problem. 
</p>
        <p>
CSLA does do some multi-threading, specifically in the Csla.Wpf.CslaDataProvider control,
because it supports the IsAsynchronous property. But even there, WPF data binding
does the abstraction, so there's no thread issues in either the business or UI layers.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=524845db-67cb-489b-8312-e9de004d7789" />
      </body>
      <title>Who is responsible for thread synchronization</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,524845db-67cb-489b-8312-e9de004d7789.aspx</guid>
      <link>http://www.lhotka.net/weblog/WhoIsResponsibleForThreadSynchronization.aspx</link>
      <pubDate>Tue, 13 Nov 2007 17:09:54 GMT</pubDate>
      <description>&lt;p&gt;
I was recently asked whether CSLA incorporates thread synchronization code to marshal
calls or events back onto the UI thread when necessary. The short answer is no, but
the question deserves a bit more discussion to understand why it isn't the business
layer's job to handle such details. 
&lt;p&gt;
The responsibility for cross-thread issues resides with the layer that started the
multi-threading. 
&lt;p&gt;
So if the business layer internally utilizes multi-threading, then that layer must
abstract the concept from other layers. 
&lt;p&gt;
But if the UI layer utilizes multi-threading (which is more common), then it is the
UI layer's job to abstract that concept. 
&lt;p&gt;
It is unrealistic to build a reusable business layer around one type of multi-threading
model and expect it to work in other scenarios. Were you to use Windows Forms components
for thread synchronization, you'd be out of luck in the ASP.NET world, for example. 
&lt;p&gt;
So CSLA does nothing in this regard, at the business object level anyway. Nor does
a DataSet, or the entity objects from ADO.NET EF, etc. It isn't the business/entity
layer's problem. 
&lt;p&gt;
CSLA does do some multi-threading, specifically in the Csla.Wpf.CslaDataProvider control,
because it supports the IsAsynchronous property. But even there, WPF data binding
does the abstraction, so there's no thread issues in either the business or UI layers.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=524845db-67cb-489b-8312-e9de004d7789" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,524845db-67cb-489b-8312-e9de004d7789.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>WPF</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=0c50b8ff-5751-46b8-bc42-bff3a9c2eccd</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,0c50b8ff-5751-46b8-bc42-bff3a9c2eccd.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,0c50b8ff-5751-46b8-bc42-bff3a9c2eccd.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=0c50b8ff-5751-46b8-bc42-bff3a9c2eccd</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
I was recently asked how to get the JSON serializer used for AJAX programming to serialize
a CSLA .NET business object. 
</p>
        <p>
From an architectural perspective, it is better to view an AJAX (or Silverlight) client
as a totally separate application. That code is running in an untrusted and terribly
hackable location (the user’s browser – where they could have created a custom browser
to do anything to your client-side code – my guess is that there’s a whole class of
hacks coming that most people haven’t even thought about yet…) 
</p>
        <p>
So you can make a strong argument that objects from the business layer should never
be directly serialized to/from an untrusted client (code in the browser). Instead,
you should treat this as a service boundary – a semantic trust boundary between your
application on the server, and the untrusted application running in the browser. 
</p>
        <p>
What that means in terms of coding, is that you don’t want to do some sort of field-level
serialization of your objects from the server. That would be terrible in an untrusted
setting. To put it another way - the BinaryFormatter, NetDataContractSerializer or
any other field-level serializer shouldn't be used for this purpose. 
</p>
        <p>
If anything, you want to do property-level serialization (like the XmlSerializer or
DataContractSerializer or JSON serializer). But really you don’t want to do this either,
because you don’t want to couple your service interface to your internal implementation
that tightly. This is, fundamentally, the same issue I discuss in Chapter 11 of <em>Expert
2005 Business Objects</em> as I talk about SOA. 
</p>
        <p>
Instead, what you really want to do (from an architectural purity perspective anyway)
is define a service contract for use by your AJAX/Silverlight client. A service contract
has two parts: operations and data. The data part is typically defined using formal
data transfer objects (DTOs). You can then design your client app to work against
this service contract. 
</p>
        <p>
In your server app’s UI layer (the aspx pages and webmethods) you translate between
the external contract representation of data and your internal usage of that data
in business objects. In other words, you map from the business objects in/out of the
DTOs that flow to/from the client app. The JSON serializer (or other property-level
serializers) can then be used to do the serialization of these DTOs - which is what
those serializers are designed to do. 
</p>
        <p>
This is a long-winded way of saying that you really don’t want to do JSON serialization
directly against your objects. You want to JSON serialize some DTOs, and copy data
in/out of those DTOs from your business objects – much the way the SOA stuff works
in Chapter 11.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=0c50b8ff-5751-46b8-bc42-bff3a9c2eccd" />
      </body>
      <title>Serializing business objects to Silverlight/AJAX?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,0c50b8ff-5751-46b8-bc42-bff3a9c2eccd.aspx</guid>
      <link>http://www.lhotka.net/weblog/SerializingBusinessObjectsToSilverlightAJAX.aspx</link>
      <pubDate>Tue, 06 Nov 2007 05:53:58 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
I was recently asked how to get the JSON serializer used for AJAX programming to serialize
a CSLA .NET business object. 
&lt;p&gt;
From an architectural perspective, it is better to view an AJAX (or Silverlight) client
as a totally separate application. That code is running in an untrusted and terribly
hackable location (the user’s browser – where they could have created a custom browser
to do anything to your client-side code – my guess is that there’s a whole class of
hacks coming that most people haven’t even thought about yet…) 
&lt;p&gt;
So you can make a strong argument that objects from the business layer should never
be directly serialized to/from an untrusted client (code in the browser). Instead,
you should treat this as a service boundary – a semantic trust boundary between your
application on the server, and the untrusted application running in the browser. 
&lt;p&gt;
What that means in terms of coding, is that you don’t want to do some sort of field-level
serialization of your objects from the server. That would be terrible in an untrusted
setting. To put it another way - the BinaryFormatter, NetDataContractSerializer or
any other field-level serializer shouldn't be used for this purpose. 
&lt;p&gt;
If anything, you want to do property-level serialization (like the XmlSerializer or
DataContractSerializer or JSON serializer). But really you don’t want to do this either,
because you don’t want to couple your service interface to your internal implementation
that tightly. This is, fundamentally, the same issue I discuss in Chapter 11 of &lt;em&gt;Expert
2005 Business Objects&lt;/em&gt; as I talk about SOA. 
&lt;p&gt;
Instead, what you really want to do (from an architectural purity perspective anyway)
is define a service contract for use by your AJAX/Silverlight client. A service contract
has two parts: operations and data. The data part is typically defined using formal
data transfer objects (DTOs). You can then design your client app to work against
this service contract. 
&lt;p&gt;
In your server app’s UI layer (the aspx pages and webmethods) you translate between
the external contract representation of data and your internal usage of that data
in business objects. In other words, you map from the business objects in/out of the
DTOs that flow to/from the client app.&amp;nbsp;The JSON serializer (or other property-level
serializers) can then be used to do the serialization of these DTOs - which is what
those serializers are designed to do. 
&lt;p&gt;
This is a long-winded way of saying that you really don’t want to do JSON serialization
directly against your objects. You want to JSON serialize some DTOs, and copy data
in/out of those DTOs from your business objects – much the way the SOA stuff works
in Chapter 11.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=0c50b8ff-5751-46b8-bc42-bff3a9c2eccd" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,0c50b8ff-5751-46b8-bc42-bff3a9c2eccd.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Service-Oriented</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=b6f47368-78c9-4f16-a7e3-4905f761c2e5</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,b6f47368-78c9-4f16-a7e3-4905f761c2e5.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,b6f47368-78c9-4f16-a7e3-4905f761c2e5.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=b6f47368-78c9-4f16-a7e3-4905f761c2e5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I get a lot of questions about the new ADO.NET Entity Framework and LINQ and how these
technologies interact with CSLA .NET. I've discussed this in a <a href="http://www.lhotka.net/weblog/SearchView.aspx?q=linq">few
other blog posts</a>, but the question recently came up on the <a href="http://forums.lhotka.net">CSLA
.NET forum</a> and I thought I'd share my answer:
</p>
        <p>
          <font face="Times New Roman" color="#000000" size="3">They are totally compatible,
but it is important to remember what they are for.</font>
        </p>
        <p>
          <font face="Times New Roman" color="#000000" size="3">Both ADO.NET EF and LINQ work
with <em>entity objects</em> - objects designed primarily as data containers. These
technologies are all about making it an easy and intuitive process to get data into
and out of databases (or other data stores) into entity objects, and then to reshape
those entity objects in memory.</font>
        </p>
        <p>
          <font face="Times New Roman" color="#000000" size="3">CSLA .NET is all about creating <em>business
objects</em> - objects designed primarily around the responsibilities and behaviors
defined by a business use case. It is all about making it easy to build use case-derived
objects that have business logic, validaiton rules and authorization rules. Additionally,
CSLA .NET helps create objects that support a rich range of UI supporting behaviors,
such as data binding and n-level undo.</font>
        </p>
        <p>
          <font face="Times New Roman" color="#000000" size="3">It is equally important to remember
what these technologies are <em>not</em>.</font>
        </p>
        <p>
          <font face="Times New Roman" color="#000000" size="3">ADO.NET EF and LINQ are not
well-suited to creating a rich business layer. While it is technically possible to
use them in this manner, it is already clear that the process will be very painful
for anything but the most trivial of applications. This is because the resulting entity
objects are data-centric, and don't easily match up to business use cases - at least
not in any way that makes any embedded business logic maintainable or easily reusable.</font>
        </p>
        <p>
          <font face="Times New Roman" color="#000000" size="3">CSLA .NET is not an object-relational
mapping technology. I have very specifically avoided ORM concepts in the framework,
in the hopes that someone (like Microsoft) would eventually provide an elegant and
productive solution to the problem. Obviously solutions do exist today: raw ADO.NET,
, the DAAB, nHibernate, Paul Wilson's ORM mapper, LLBLgen and more. Many people use
these various technologies behind CSLA .NET, and that's awesome.</font>
        </p>
        <p>
          <font face="Times New Roman" color="#000000" size="3">So looking forward, I see a
bright future. One where the DataPortal_XYZ methods either directly make use of ADO.NET
EF and LINQ, or call a data access layer (DAL) that makes use of those technologies
to build and return entity objects.</font>
        </p>
        <p>
          <font face="Times New Roman" color="#000000" size="3">Either way, you can envision
this future where the DP_XYZ methods primarily interact with entity objects, deferring
all the actual persistence work off to EF/LINQ code. If Microsoft lives up to the
promise with EF and LINQ, this model should seriously reduce the complexity of data
access, resulting in more developer productivity - giving us more time to focus
on the important stuff: object-oriented design ;) .</font>
        </p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=b6f47368-78c9-4f16-a7e3-4905f761c2e5" />
      </body>
      <title>ADO.NET Entity Framework, LINQ and CSLA .NET</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,b6f47368-78c9-4f16-a7e3-4905f761c2e5.aspx</guid>
      <link>http://www.lhotka.net/weblog/ADONETEntityFrameworkLINQAndCSLANET.aspx</link>
      <pubDate>Wed, 07 Feb 2007 18:08:20 GMT</pubDate>
      <description>&lt;p&gt;
I get a lot of questions about the new ADO.NET Entity Framework and LINQ and how these
technologies interact with CSLA .NET. I've discussed this in a &lt;a href="http://www.lhotka.net/weblog/SearchView.aspx?q=linq"&gt;few
other blog posts&lt;/a&gt;, but the question recently came up on the &lt;a href="http://forums.lhotka.net"&gt;CSLA
.NET forum&lt;/a&gt; and I thought I'd share my answer:
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;They are totally compatible, but
it is important to remember what they are for.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Both ADO.NET EF and LINQ work with &lt;em&gt;entity
objects&lt;/em&gt; - objects designed primarily as data containers. These technologies are
all about making it an easy and intuitive process to get data into and out of databases
(or other data stores) into entity objects, and then to reshape those entity objects
in memory.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;CSLA .NET is all about creating &lt;em&gt;business
objects&lt;/em&gt; - objects designed primarily around the responsibilities and behaviors
defined by a business use case. It is all about making it easy to build use case-derived
objects that have business logic, validaiton rules and authorization rules. Additionally,
CSLA .NET helps create objects that support a rich range of UI supporting behaviors,
such as data binding and n-level undo.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;It is equally important to remember
what these technologies are &lt;em&gt;not&lt;/em&gt;.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;ADO.NET EF and LINQ are not well-suited
to creating a rich business layer. While it is technically possible to use them in
this manner, it is already clear that the process will be very painful for anything
but the most trivial of applications. This is because the resulting entity objects
are data-centric, and don't easily match up to business use cases - at least not in
any way that makes any embedded business logic maintainable or easily reusable.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;CSLA .NET is not an object-relational
mapping technology. I have very specifically avoided ORM concepts in the framework,
in the hopes that someone (like Microsoft) would eventually provide an elegant and
productive solution to the problem. Obviously solutions do exist today: raw ADO.NET,
, the DAAB, nHibernate, Paul Wilson's ORM mapper, LLBLgen and more. Many people use
these various technologies behind CSLA .NET, and that's awesome.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;So looking forward, I see a bright
future. One where the DataPortal_XYZ methods either directly make use of ADO.NET EF
and LINQ, or call a data access layer (DAL) that makes use of those technologies to
build and return entity objects.&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Either way, you can envision this
future where the DP_XYZ methods primarily interact with entity objects, deferring
all the actual persistence work off to EF/LINQ code. If Microsoft lives up to the
promise with EF and LINQ, this model should seriously reduce the complexity of data
access, resulting in more developer productivity&amp;nbsp;- giving us more time to focus
on the important stuff: object-oriented design ;) .&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=b6f47368-78c9-4f16-a7e3-4905f761c2e5" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,b6f47368-78c9-4f16-a7e3-4905f761c2e5.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Microsoft .NET</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=b0f39c62-4544-4924-9856-d54535af2736</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,b0f39c62-4544-4924-9856-d54535af2736.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,b0f39c62-4544-4924-9856-d54535af2736.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=b0f39c62-4544-4924-9856-d54535af2736</wfw:commentRss>
      <title>Does workflow compete with CSLA .NET?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,b0f39c62-4544-4924-9856-d54535af2736.aspx</guid>
      <link>http://www.lhotka.net/weblog/DoesWorkflowCompeteWithCSLANET.aspx</link>
      <pubDate>Sun, 04 Feb 2007 07:03:57 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;It seems that people are always
looking for The Next Big Thing™, which isn’t surprising. What I do find surprising
is that they always assume that TNBT must somehow destroy the Previous Big Thing™,
which in the field of software development was really object-orientation (at least
for most people).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Over the past few years Web Services
and then their reincarnation as SOA or just SO were going to eliminate the use of
OO. As more and more people have actually implemented and consumed services I think
it has become abundantly clear that SOA is merely a repackaging of EAI from the 90’s
and EDI from before that. Useful, but hardly of the sweeping impact of OO, at least
not in the near term.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Though to be fair, OO took more
than 20 years before it became remotely “mainstream”, and even today only around 30%
of developers (based on my informal, but broad, polling over the past couple years)
apply OOD in their daily work. So you could question whether OO is “mainstream” even
today, when the &lt;i style="mso-bidi-font-style: normal"&gt;vast&lt;/i&gt; majority of developers
use procedural programming techniques.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Even though the majority of .NET
and Java developers don’t actually use OO themselves, both the .NET and Java platforms
are OO throughout. So there’s no doubt that OO has had an incredible impact on our
industry, and that it has shaped the major platforms and development styles used by
almost everyone.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;So perhaps in 15-20 years SO really
will have the sweeping impact that OO has had on software development. And I’m not
sure that would be a bad thing, but it isn’t a near-term concern.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;However, I was recently confronted
by a (so-called) newcomer: workflow. Yes, now workflow (WF) is going to kill OO, or
so I’ve been told. In fact, Through indirect channels, my challenger suggested that
the CSLA .NET framework is obsolete going forward because it is based on these “old-school”
OO concepts.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Obviously I beg to differ :)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;It is true that some of the concepts
I employ in CSLA .NET are quite old, but I am not ready to through OO into the “old-school”
bucket just yet... The idea is somewhat ironic however, because WF is being put up
as The Next Big Thing™. Depressingly, there's virtually no technology today that isn't
a rehash of something from 20 years ago. That's more true of SOA and WF than OO. Remember
that SOA is just repacking of message-based architecture, only with XML, and workflow
is an extension of procedural design and the use of flowcharts. At least OO can claim
to be younger than either of those two root technologies.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Personally, I very much doubt the
use of objects as rich behavioral entities will go away any time soon. Sure, for non-interactive
tasks procedural technologies like WF might be better than OO (though that's debatable).
And certainly for connecting disparate systems you need to use loosely coupled architectures,
of which SOA is one (but not the only one). &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;But the question remains: how do
you create rich, interactive GUI applications in a productive and yet maintainable
manner?&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Putting your logic in a workflow
reduces interactivity. Putting your logic behind a set of services reduces both interactivity
and performance. Putting your logic in the UI is "VB3 programming". So what's left?
For interactive apps you need a business layer that can run as close to the user as
possible and using business objects is a particularly good way to do exactly that.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Neither WF nor WCF/SOA are, to me,
competitors to CSLA. Rather, I see them as entirely complimentary.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Perhaps ADO.NET EF and/or LINQ are
competitors - that depends on what they look like as they stabilize over the next
several months. Everything I’ve seen thus far leads me to believe these technologies
are complimentary as well. (And Scott Guthrie agrees – check out his &lt;/font&gt;&lt;a href="http://www.dotnetrocks.com/default.aspx?showNum=208"&gt;&lt;font face="Times New Roman" color=#800080 size=3&gt;recent
interview on DNR&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;) Neither
of them addresses the issues around support for data binding, or centralization of
business logic in a formal business layer.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;But when it comes to SOA I still
think it is a “fad”. It is either MTS done over with XML - which is what 95% of the
people out there are doing with "services", or it is EDI/EAI with XML - which is a
good thing and a move forward, but which is too complex and has too much overhead
for use in a typical application. I think that most likely in 5-10 years we'll have
a new acronym for it – just adding to the EDI/EAI/SOA list.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Just like "outsourcing" became ASP
which became SaaS. The idea doesn't die, it just gets renamed so more money can be
made by selling the same stuff over again - often to people who really don't need/want
it.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The point is, our industry is cyclical.
And we're heading toward into a period where "procedural programming" is once again
reaching a peak of usage. This time under the names SOA and workflow. But if you step
back from the hype and look at it, what's proposed is that we create a bunch of standalone
code blocks that exchange formatted data. A set of procedures that exchange parameters.
Dress it up how you like, that's what is being proposed by both the SOA and WF crowds.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;And there's nothing wrong with that.
Procedural design is well understood. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;And it could actually work this
time around if we don't cheat. I still maintain that the reason procedural programming
"failed" was because we cheated and used common blocks and global variables. Why?
Because it was too inefficient and required too much code to formally package up all
the data and send it as parameters.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;If we can stomach the efficiency
and coding costs this time around - packing the data into XML messages - then I see
no reason why we can't make procedural programming work in many cases. And by naming
it something trendy, like SOA and/or workflow, we can avoid the negative backlash
that would almost certainly occur if people realized they were abandoning OO to return
to procedural programming.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Having spent the first third of
my career doing procedural programming, I wouldn't necessarily mind going back. In
some ways it really was easier than using objects - though there are some very ugly
traps that people will have to rediscover again on this go-round. Most notably the
trap that a procedure can't be reused without introducing fragility into the system,
not due to syntactic coupling or API changes, but due to semantic coupling (&lt;/font&gt;&lt;a href="http://www.lhotka.net/weblog/SemanticCouplingTheElephantInTheSOARoom.aspx"&gt;&lt;font face="Times New Roman" size=3&gt;about
which I've blogged&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;This is true for procedures and
any other "reusable" code block like a workflow activity or a service. They all suffer
the same limitation - and it is one that neither WSDL nor compilers can help solve...&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Anyway, kind of went on a rant here
- but I find it amusing that, in some circles at least, OO is viewed as the "legacy"
technology in the face of services or workflow, which are even &lt;i style="mso-bidi-font-style: normal"&gt;more&lt;/i&gt; legacy
than OO ;)&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=b0f39c62-4544-4924-9856-d54535af2736" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,b0f39c62-4544-4924-9856-d54535af2736.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Service-Oriented</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=2508e05d-4d80-4891-b909-0df6546f7dc9</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,2508e05d-4d80-4891-b909-0df6546f7dc9.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,2508e05d-4d80-4891-b909-0df6546f7dc9.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=2508e05d-4d80-4891-b909-0df6546f7dc9</wfw:commentRss>
      <title>Should you change values in a property set block?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,2508e05d-4d80-4891-b909-0df6546f7dc9.aspx</guid>
      <link>http://www.lhotka.net/weblog/ShouldYouChangeValuesInAPropertySetBlock.aspx</link>
      <pubDate>Wed, 17 Jan 2007 21:45:30 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I recently had an email discussion
where I was describing why I needed to solve the problem I described in &lt;/font&gt;&lt;a href="http://www.lhotka.net/weblog/DataBindingIssueInWPFWithSolution.aspx"&gt;&lt;font face="Times New Roman" size=3&gt;this
article for WPF&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; and &lt;/font&gt;&lt;a href="http://www.lhotka.net/weblog/WindowsFormsBindingIssueAComponentSolution.aspx"&gt;&lt;font face="Times New Roman" size=3&gt;this
article for Windows Forms&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In both cases the issue is that
data binding doesn’t refresh the value from the data source after it updates the data
source from the UI. This means that any changes to the value that occur in the property
set code aren’t reflected in the UI.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The question he posed to me was
whether it was a good idea to have a property set block actually change the value.
In most programming models, goes the thought, assigning a property to a value can’t
result in that property value changing. So any changes to the value that occur in
the set block of a property are counter-intuitive, and so you simply shouldn’t change
the value in the setter code.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Here’s my response:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;The idea of a setter
(which is really just a mutator method by another name) changing a value doesn't (or
shouldn't) seem counter-intuitive at all.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;If we were talking about assigning
a value to a public field I’d agree entirely. But we are not. Instead we’re talking
about assigning a value to a property, and that’s very different.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;If all we wanted were public fields,
we wouldn't need the concept of "property" at all. The concept of "property" is merely
a formalization of the following:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;ol style="MARGIN-TOP: 0in" type=1&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;public fields are bad&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;private fields are exposed
through an accessor method&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;private fields are changed
through a mutator method&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;creating and using accessor/mutator
methods is awkward without a standard mechanism&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;So the concept of "property"
exists to standardize and formalize the idea that we need controlled access to private
fields, and a standard way to change their value through a mutator method.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Consider the business
rule that says a document id must follow a certain form - like &lt;/font&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;SOP433&lt;/span&gt;&lt;font face="Times New Roman"&gt;.
The first three characters must be alpha and upper case, the last three must be numeric.
This is an incredibly common scenario for document, product, customer and other user-entered
id values.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Only a poor UI would
force the user to actually enter upper case values. The user should be able to type
what they want, and the software will fix it.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;But putting the upper
case rule in the UI is bad, because code in the UI isn't reusable, and tends to become
obsolete very rapidly as technology and/or the UI design changes. There's nothing
more expensive over the life of an application than a line of code in the UI. So while
it is possible to implement this rule in a validation control, in JavaScript, in a
button click event handler - none of those are good solutions to the real problem.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Yet if that rule is
placed purely in the backend system, then the user can't get any sort of interactive
response. The form must be "posted" or "transmitted" to the backend before the processing
can occur. Users want to immediately see the value be upper case or they get nervous.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;So then we're stuck.
Many people implement the rule twice. Once in the UI to make the user happy, and once
in the backend, which is the &lt;i style="mso-bidi-font-style: normal"&gt;real&lt;/i&gt; rule
implementation. And then they try to keep those rules in sync forever - the result
being an expensive, unreliable and hard to maintain system.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;I've watched this cycle
occur for 20 years now, and it is the same time after time. And it sucks. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;This, right here, is
why VB got such a bad name through the 1990’s. The VB forms designer made it way too
easy to write all the logic in the UI, and without any other clear alternative that's
what happened. The resulting applications are very fragile and are impossible to upgrade
to the next technology (like .NET). Today, as we talk, many thousands of lines of
code are being written in Windows Forms and Web Forms in exactly the same way. Those
poor people will have a hell of a time upgrading to WPF, because none of their code
is reusable.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;What's needed is &lt;i style="mso-bidi-font-style: normal"&gt;one&lt;/i&gt; location
for this rule. Business objects offer a workable solution here. If the object implements
the rule, and the object runs on the client workstation, then (without code in the
UI) the user gets immediate response and the rule is satisfied. And the rule is reusable,
because the object is reusable - in a way that UI code never can be (or at least never
has been).&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;That same object, with
that same interactive rule, can be used behind Windows Forms, Web Forms, WPF and even
a web services interface. The rule is always applied, because it is right there in
the object. And for interactive UIs it is immediate, because it is in the field's
mutator method (the property setter).&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;So in my mind the idea of changing
a value in a setter isn't counter-intuitive at all - it is the obvious design purpose
behind the property setter (mutator). Any other alternative is really just a ridiculously
complex way of implementing public fields. And worse, it leaves us where we've been
for 20+ years, with duplicate code and expensive, unreliable software.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=2508e05d-4d80-4891-b909-0df6546f7dc9" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,2508e05d-4d80-4891-b909-0df6546f7dc9.aspx</comments>
      <category>Architecture</category>
      <category>Microsoft .NET</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=50c60637-e58d-4f00-96e6-a3c39189d3e0</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,50c60637-e58d-4f00-96e6-a3c39189d3e0.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,50c60637-e58d-4f00-96e6-a3c39189d3e0.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=50c60637-e58d-4f00-96e6-a3c39189d3e0</wfw:commentRss>
      <title>Rambling thoughts on pragmatic development</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,50c60637-e58d-4f00-96e6-a3c39189d3e0.aspx</guid>
      <link>http://www.lhotka.net/weblog/RamblingThoughtsOnPragmaticDevelopment.aspx</link>
      <pubDate>Wed, 03 Jan 2007 16:40:32 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I recently received an email that
included this bit:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;“You are killing me. I wrote a rather
scathing review of your Professional Business Objects with C# on Amazon.com and on
my own blog. However, recently I read a transcription of an ARCast with Ron Jacobs
where you talked about business objects. I believe I agreed with everything you said.
What are you trying to do to me?&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I am just a regular shmoe&amp;nbsp;developer,
who preaches when listened to about the joys and benefits of OO design for the common
business application. I feel too many develop every application like it is just babysitting
a database. Every object’s purpose is for the CRUD of data in a table. I have developed
great disdain for companies, development teams, and senior developers who perpetuate
this problem. I felt Expert C# 2005 Business Object perpetuates this same kind of
design, thus the 3 star rating on Amazon for your book.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In the ARCast you mentioned a new
book coming out. I am hoping it is the book I have been looking for. If I wrote it
myself it would be titled something like, “Business Objects in the Real World.” It
would address the problems of data-centric design and how some objects truly are just
for managing data and others conduct a business need explained by and expert. These
two objects would be pretty different and possibly even use a naming convention to
explicitly differentiate the two. For example I don’t want my “true” business objects
with getters, setters, isDirty flags or anything else that might make them invalid
and popping runtime errors when trying to conduct their business.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt 0.5in"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Anyway, I could ramble on (It’s
my nature). However, I just want to drop you a line and say there is a real disconnect
between us, but at the same time, I wanted to show everyone at my office what you
were saying in your interview. You were backing me up! However, just months ago I
was using your writings to explain what is wrong with software development. We seem
to be on the same page, or close anyway, but maybe coming to different conclusions.
I guess that’s what is bothering me.”&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The following is my response, which
I thought I’d share here on my blog because I ended up rambling on more than I’d planned,
and I thought it might be interesting/useful to someone:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;I would guess that the
disconnect may flow from our experiences during our careers - what we've seen work
and not work over time.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;For my part, I've become
very pragmatic. The greatest ideas in the world tend to fall flat in real life because
people don't get them, or they have too high a complexity or cost barrier to gain
their benefit. For a very long time OO itself fit this category. I remember exploring
OO concepts in the late 80's and it was all a joke. The costs were ridiculously high,
and the benefits entirely theoretical.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Get into the mid-90's
and components show up, making some elements of OO actually useful in real life. But
even then RAD was so powerful that the productivity barrier/differential between OO
and RAD was ridiculously high. I spent untold amounts of time and effort trying to
reconcile these two to allow the use of OO and RAD both - but with limited success.
The tools and technologies simply didn't support both concepts - at least not without
writing your own frameworks for &lt;i style="mso-bidi-font-style: normal"&gt;everything&lt;/i&gt; and
ignoring all the pre-existing (and established) RAD tools in existence.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Fortunately by this
time I'd established both good contacts and a good reputation within key Microsoft
product teams. Much of the data binding support in .NET (Windows Forms at least) is
influenced by my constant pressure to treat objects as peers to recordset/resultset/dataset
constructs. I continue to apply this pressure, because things are still not perfect
- and with WPF they have temporarily slid backwards somewhat. But I know people on
that team too, and I think they'll improve things as time goes on.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;In the meantime Java
popularizes the idea of ORM - but solutions exist for only the most basic scenarios
- mapping table data into entity objects. While they claim to address the impedance
mismatch problem, they really don't, because they aren't mapping into real OO designs,
but rather into data-centric object models. Your disdain for today’s ORM tools must
be boundless &lt;/font&gt;&lt;span style="FONT-FAMILY: Wingdings; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;&lt;span style="mso-char-type: symbol; mso-symbol-font-family: Wingdings"&gt;J&lt;/span&gt;&lt;/span&gt;&lt;font face="Times New Roman"&gt; &lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;For better or worse,
Microsoft is following that lead in the next version of ADO.NET - and I don't totally
blame them; a real solution is complex enough that it is hard to envision, much less
implement. However, here too I hold out hope, because the current crop of "ORM" tools
are starting to create nice enough entity objects that it may become possible to envision
a tool that maps from entity objects to OO objects using a metadata scheme between
the two. This is an area I've been spending some time on of late, and I think there's
some good potential here.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Through all this, I've been working
primarily with mainstream developers (“&lt;/font&gt;&lt;a href="http://www.lhotka.net/weblog/WhoIsMortAnywayAndWhyShouldHeCareAboutVS2005.aspx"&gt;&lt;font face="Times New Roman" color=#800080 size=3&gt;Mort&lt;/font&gt;&lt;/a&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;”).
Developers who do this as a job, not as an all-consuming passion. Developers who want
to go home to their families, their softball games, their &lt;i style="mso-bidi-font-style: normal"&gt;real&lt;/i&gt; lives.
Who don't want to master "patterns" and "philosophies" like Agile or TDD; but rather
they just want to do their job with a set of tools that help them do the right thing.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;I embrace that. This
makes me diametrically opposed to the worldviews of a number of my peers who would
prefer that the tools do less, so as to raise the bar and drive the mainstream developers
out of the industry entirely. But that, imo, is silly. I want mainstream developers
to have access to frameworks and tools that help guide them toward doing the right
thing - even if they don't take the time to understand the philosophy and patterns
at work behind the scenes.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I don't remember when I did the
ARCast interview, but I was either referring to the 2005 editions of my business objects
books which came out in April/May, or to the ebook I'm finishing now, which covers
version 2.1 of my CSLA .NET framework. Odds are it is the former, and it isn't the
book you are looking for - though you might enjoy Chapter 6.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;In general I think you
can take a couple approaches to thinking about objects. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;One approach, and I
think the right one, is to realize that &lt;i style="mso-bidi-font-style: normal"&gt;all&lt;/i&gt; objects
are behavior-driven and have a single responsibility. Sometimes that responsibility
is to merely act as a data container (DTO or entity object). Other times it is to
act as a rich binding source that implements validation, authorization and other behaviors
necessary to enable the use of RAD tools. Yet other times it is to implement pure,
non-interactive business behavior (though this last area is being partially overrun
by workflow technologies like WF).&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Another way to think about objects
is to say there are different kinds of object, with different design techniques for
each. So entity objects are designed quasi-relationally, process objects are designed
somewhat like a workflow, etc. I personally think this is a false abstraction that
misses the underlying truth, which is that all objects must be designed around responsibility
and behavior as they fit into a use case and architecture.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;But sticking with the pure responsibility/behavior
concept, CSLA .NET helps address a gaping hole. ORM tools (and similar tools) help
create entity objects. Workflow is eroding the need for pure process objects. But
there remains this need for rich objects that support a RAD development experience
for interactive apps. And CSLA .NET helps fill this gap by making it easier for a
developer to create objects that implement rich business behaviors and also directly
support Windows Forms, Web Forms and WPF interfaces – leveraging the existing RAD
capabilities provided by .NET and Visual Studio.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Whether a developer (mis)uses CSLA
.NET to create data-centric objects, or follows my advice and creates responsibility-driven
objects is really their choice. But either way, I think good support for the RAD capabilities
of the environment is key to attaining high levels of productivity when building interactive
applications.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=50c60637-e58d-4f00-96e6-a3c39189d3e0" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,50c60637-e58d-4f00-96e6-a3c39189d3e0.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=e85dd811-195d-4eca-a3b1-15c0d37a745b</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,e85dd811-195d-4eca-a3b1-15c0d37a745b.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,e85dd811-195d-4eca-a3b1-15c0d37a745b.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=e85dd811-195d-4eca-a3b1-15c0d37a745b</wfw:commentRss>
      <title>Where Workflow Foundation really shines</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,e85dd811-195d-4eca-a3b1-15c0d37a745b.aspx</guid>
      <link>http://www.lhotka.net/weblog/WhereWorkflowFoundationReallyShines.aspx</link>
      <pubDate>Tue, 05 Sep 2006 17:24:24 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Several people have asked me about
my thoughts on the Microsoft .NET 3.0 Workflow Foundation (WF) technology.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;My views certainly don’t correspond
with Microsoft's official line. But the “official line” comes from the WF marketing
team, and they'll tell you that WF is the be-all-and-end-all, and that's obviously
silly. Microsoft product teams are always excited about their work, which is good
and makes sense. We all just need to apply an "excitement filter" to anything they
say, bring it back to reality and decide what really works for us. ;)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Depending on who you talk to, WF
should be used to do almost anything and everything. It can drive your UI, replace
your business layer, orchestrate your processes and workflow, manage your data access
and solve world hunger…&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;My view on WF is a bit more modest: &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Most applications have
a lot of highly interactive processes - where users edit, view and otherwise interact
with the system. These applications almost always also have some non-interactive processes
- where the user initiates an action, but then a sequence of steps are followed without
the user's input, and typically without even telling the user about each step.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Think about an inventory
system. There's lots of interaction as the user adds products, updates quantities,
moves inventory around, changes cost/price data, etc. Then there's almost always a
point at which a "pick list" gets generated so someone can go into the warehouse and
actually get the stuff so it can be shipped or used or whatever. Generating a pick
list is a non-trivial task, because it requires looking at demand (orders, etc.),
evaluating what products to get, where they are and ordering the list to make the
best use of the stock floor personnel's time. This is a non-interactive process.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Today we all write these
non-interactive processes in code. Maybe with a set of objects working in concert,
but more often as a linear or procedural set of code. If a change is needed to the
process, we have to alter the code itself, possibly introducing unintended side-effects,
because there's little isolation between steps.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Personally I think this is where
WF fits in. It is really good at helping you create and manage non-interactive processes.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Yes, you have to think about those
non-interactive processes in a different way to use WF. But it is probably worth it,
because in the end you'll have divided each process into a set of discrete, autonomous
steps. WF itself will invoke each step in order, and you have the pleasure (seriously!)
of creating each step as an independent unit of code. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;From an OO design perspective
it is almost perfect, because each step is a use case, that can be designed and implemented
in isolation - which is a rare and exciting thing!&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Note that getting to
this point really does require rethinking of the non-interactive process. You have
to break the process down into a set of discrete steps, ensuring that each step has
very clearly defined inputs and outputs, and the implementation of each step must
arbitrarily ensure any prerequisites are met, because it can't know in what order
things will eventually occur.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;The great thing (?)
about this design process is that the decomposition necessary to pull it off is exactly
the same stuff universities were teaching 25 years ago to COBOL and FORTRAN students.
This is procedural programming "done right". To me though, the cool think is that
each "procedure" now becomes a use case, and so we're finally in a position to exploit
the power of procedural AND object-oriented design and programming! (and yes, I am
totally serious)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;So in the end, I think
that most applications have a place for WF, because most applications have one or
more of these non-interactive processes. The design effort is worth it, because the
end result is a more flexible and maintainable process within your application.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=e85dd811-195d-4eca-a3b1-15c0d37a745b" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,e85dd811-195d-4eca-a3b1-15c0d37a745b.aspx</comments>
      <category>Architecture</category>
      <category>Microsoft .NET</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=683eb72a-b9cd-4fb0-a760-963076f0d18e</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,683eb72a-b9cd-4fb0-a760-963076f0d18e.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,683eb72a-b9cd-4fb0-a760-963076f0d18e.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=683eb72a-b9cd-4fb0-a760-963076f0d18e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <img src="http://www.lhotka.net/WeBlog/content/binary/ironarchitect.JPG" align="left" border="0" />Microsoft
is holding an architect contest at Tech Ed this year. <a href="http://blogs.msdn.com/ironarchitect/">Click
here</a> for details.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=683eb72a-b9cd-4fb0-a760-963076f0d18e" />
      </body>
      <title>Iron Architect Contest</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,683eb72a-b9cd-4fb0-a760-963076f0d18e.aspx</guid>
      <link>http://www.lhotka.net/weblog/IronArchitectContest.aspx</link>
      <pubDate>Wed, 03 May 2006 14:44:59 GMT</pubDate>
      <description>&lt;p&gt;
&lt;img src="http://www.lhotka.net/WeBlog/content/binary/ironarchitect.JPG" align=left border=0&gt;Microsoft
is holding an architect contest at Tech Ed this year. &lt;a href="http://blogs.msdn.com/ironarchitect/"&gt;Click
here&lt;/a&gt; for details.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=683eb72a-b9cd-4fb0-a760-963076f0d18e" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,683eb72a-b9cd-4fb0-a760-963076f0d18e.aspx</comments>
      <category>Architecture</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=07051623-cf59-4ab2-a8f6-e26e4da7d3be</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,07051623-cf59-4ab2-a8f6-e26e4da7d3be.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,07051623-cf59-4ab2-a8f6-e26e4da7d3be.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=07051623-cf59-4ab2-a8f6-e26e4da7d3be</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Somebody woke up on the wrong side of the bed, fortunately it wasn't me this time
:)
</p>
        <p>
This is a <a href="http://www.from9till2.com/PermaLink.aspx?guid=14484a2c-db58-4322-910a-3297e4be9d84">nice
little rant</a> about the limitations of OO-as-a-religion. I think you could substitute
any of the following for OO and the core of the rant would remain quite valid:
</p>
        <ul>
          <li>
procedural programming/design</li>
          <li>
modular programming/design</li>
          <li>
SOA/SO/service-orientation</li>
          <li>
Java</li>
          <li>
.NET</li>
        </ul>
        <p>
Every concept computer science has developed over the past many decades came into
being to solve a problem. And for the most part each concept did address some or all
of that problem. Procedures provided reuse. Modules provided encapsulation. Client/server
provided scalability. And so on...
</p>
        <p>
The thing is, that <em>very</em> few of these new concepts actually obsolete any previous
concepts. For instance, OO doesn't elminate the value of procedural reuse. In fact,
using the two in concert is typically the best of both worlds. 
</p>
        <p>
Similarly, SO is a case where a couple ideas ran into each other while riding bicycle.
"You got messaging in my client/server!" "No! You got client/server in my messaging!"
"Hey! This tastes pretty good!" SO is good stuff, but doesn't replace client/server,
messaging, OO, procedural design or any of the previous concepts. It merely provides
an interesting lense through which we can view these pre-existing concepts, and perhaps
some new ways to apply them.
</p>
        <p>
Anyway, I enjoyed the rant, even though I remain a staunch believer in the power
of OO.
</p>
        <img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=07051623-cf59-4ab2-a8f6-e26e4da7d3be" />
      </body>
      <title>An (accurate) rant on OO</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,07051623-cf59-4ab2-a8f6-e26e4da7d3be.aspx</guid>
      <link>http://www.lhotka.net/weblog/AnAccurateRantOnOO.aspx</link>
      <pubDate>Mon, 13 Mar 2006 17:44:39 GMT</pubDate>
      <description>&lt;p&gt;
Somebody woke up on the wrong side of the bed, fortunately it wasn't me this time
:)
&lt;/p&gt;
&lt;p&gt;
This is a &lt;a href="http://www.from9till2.com/PermaLink.aspx?guid=14484a2c-db58-4322-910a-3297e4be9d84"&gt;nice
little rant&lt;/a&gt; about the limitations of OO-as-a-religion. I think you could substitute
any of the following for OO and the core of the rant would remain quite&amp;nbsp;valid:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
procedural programming/design&lt;/li&gt;
&lt;li&gt;
modular programming/design&lt;/li&gt;
&lt;li&gt;
SOA/SO/service-orientation&lt;/li&gt;
&lt;li&gt;
Java&lt;/li&gt;
&lt;li&gt;
.NET&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Every concept computer science has developed over the past many decades came into
being to solve a problem. And for the most part each concept did address some or all
of that problem. Procedures provided reuse. Modules provided encapsulation. Client/server
provided scalability. And so on...
&lt;/p&gt;
&lt;p&gt;
The thing is, that &lt;em&gt;very&lt;/em&gt; few of these new concepts actually obsolete any previous
concepts. For instance, OO doesn't elminate the value of procedural reuse. In fact,
using the two in concert is typically the best of both worlds. 
&lt;/p&gt;
&lt;p&gt;
Similarly, SO is a case where a couple ideas ran into each other while riding bicycle.
"You got messaging in my client/server!" "No! You got client/server in my messaging!"
"Hey! This tastes pretty good!" SO is good stuff, but doesn't replace client/server,
messaging, OO, procedural design or any of the previous concepts. It merely provides
an interesting lense through which we can view these pre-existing concepts, and perhaps
some new ways to apply them.
&lt;/p&gt;
&lt;p&gt;
Anyway, I enjoyed the rant, even though I remain a&amp;nbsp;staunch believer in the power
of OO.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=07051623-cf59-4ab2-a8f6-e26e4da7d3be" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,07051623-cf59-4ab2-a8f6-e26e4da7d3be.aspx</comments>
      <category>Architecture</category>
      <category>Distributed OO</category>
      <category>Service-Oriented</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=8fa07593-a357-49a4-9b86-1ee82a58f2b9</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,8fa07593-a357-49a4-9b86-1ee82a58f2b9.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,8fa07593-a357-49a4-9b86-1ee82a58f2b9.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=8fa07593-a357-49a4-9b86-1ee82a58f2b9</wfw:commentRss>
      <title>Should validation be in the UI or in business objects</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,8fa07593-a357-49a4-9b86-1ee82a58f2b9.aspx</guid>
      <link>http://www.lhotka.net/weblog/ShouldValidationBeInTheUIOrInBusinessObjects.aspx</link>
      <pubDate>Wed, 01 Mar 2006 21:44:33 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;I
was recently asked whether I thought it was a good idea to avoid using the Validation
events provided by Microsoft (in the UI), in favor of putting the validation logic
into a set of objects. I think the answer to the question (to some degree) depends
on whether you are doing Windows or Web development.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;With Windows development,
Windows Forms provides all the plumbing you need to put all your validation in the
business objects and still have a very rich, expressive UI - with virtually no code
in the UI at all. This is particularly true in .NET 2.0, but is quite workable in
.NET 1.1 as well.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;With Web development
life isn't as nice. Of course there's no way to run real code in the browser, so you
are stuck with JavaScript. While the &lt;i style="mso-bidi-font-style: normal"&gt;real&lt;/i&gt; authority
for any and all business logic &lt;i style="mso-bidi-font-style: normal"&gt;must&lt;/i&gt; reside
on the web server (because browsers are easily compromised), many web applications
duplicate validation into the browser to give the user a better experience. While
this is expensive and unfortunate, it is life in the world of the Web.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;(Of course what &lt;i style="mso-bidi-font-style: normal"&gt;really&lt;/i&gt; happens
with a lot of Web apps is that the validation is &lt;b style="mso-bidi-font-weight: normal"&gt;only&lt;/b&gt; put
into the browser - which is horrible, because it is too easy to bypass. That is simply
a flawed approach to development...)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;At least with ASP.NET
there are the validation controls, which simplify the process of creating and maintaining
the duplicate validation logic in the browser. You are still left to manually keep
the logic in sync, but at least it doesn't require hand-coding JavaScript in most
cases.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;Obviously Windows Forms
is an older and more mature technology (or at least flows from an older family of
technologies), so it is no surprise that it allows you to do more things with less
effort. But in most cases the effort to create Web Forms interfaces isn't bad either.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;In any case, I do focus
greatly on keeping code out of the UI. There's nothing more expensive than a line
of code in the UI - because you _know_ it has a half-life of about 1-2 years. Everyone
is rewriting their ASP.NET 1.0 UI code to ASP.NET 2.0. Everyone is tweaking their
Windows Forms 1.0 code for 2.0. And all of it is junk when WinFX comes out, since
WPF is intended to replace both Windows and Web UI development in most cases. Thus
code in the UI is expensive, because you'll need to rewrite it in less than 2 years
in most cases.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Code in a business object, on the
other hand, is far less expensive because most business processes don't change nearly
as fast as the UI technologies provided by our vendors... As long as your business
objects conform to the basic platform interfaces for data binding, they tend to flow
forward from one UI technology to the next. For instance, WPF uses the same interfaces
as Windows Forms, so reusing the &lt;i style="mso-bidi-font-style: normal"&gt;same&lt;/i&gt; objects
from Windows Forms behind WPF turns out to be pretty painless. You just redesign the
UI and away you go. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;A co-worker at &lt;/font&gt;&lt;a href="http://www.magenic.com/"&gt;&lt;font face="Times New Roman" size=3&gt;Magenic&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; has
already taken my ProjectTracker20 sample app and created a WPF interface for it –
based on the same set of CSLA .NET 2.0 business objects as the Windows Forms and Web
Forms interfaces. Very cool!&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;So ultimately, I strongly believe
that validation (and all other business logic) should be done in a set of business
objects. That’s much of the focus in my upcoming &lt;/font&gt;&lt;a href="http://www.lhotka.net/cslanet/csla20.aspx"&gt;&lt;font face="Times New Roman" size=3&gt;Expert
VB 2005 and C# 2005 Business Objects&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; books.
While you might opt to duplicate some of the validation in the UI for a rich user
experience, that’s merely an unfortunate side-effect of the immature (and stagnant)
state of the HTML world.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=8fa07593-a357-49a4-9b86-1ee82a58f2b9" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,8fa07593-a357-49a4-9b86-1ee82a58f2b9.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=0e5f98c7-7e72-44ee-a9d0-f014adaf7587</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,0e5f98c7-7e72-44ee-a9d0-f014adaf7587.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,0e5f98c7-7e72-44ee-a9d0-f014adaf7587.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=0e5f98c7-7e72-44ee-a9d0-f014adaf7587</wfw:commentRss>
      <title>SPOIL - interesting ideas</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,0e5f98c7-7e72-44ee-a9d0-f014adaf7587.aspx</guid>
      <link>http://www.lhotka.net/weblog/SPOILInterestingIdeas.aspx</link>
      <pubDate>Wed, 01 Mar 2006 16:00:01 GMT</pubDate>
      <description>&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;This &lt;a href="http://msdn.microsoft.com/architecture/default.aspx?pull=/library/en-us/dnbda/html/SPOIL.asp"&gt;recent
MSDN article&lt;/a&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt; talks
about SPOIL: Stored Procedure Object Interface Layer.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;This is an interesting,
and generally good idea as I see it. Unfortunately this team, like most of Microsoft,
apparently just doesn't understand the concept of data hiding in OO. SPOIL allows
you to use your object's &lt;em&gt;&lt;span style="FONT-FAMILY: Verdana"&gt;properties&lt;/span&gt;&lt;/em&gt; as
data elements for a stored procedure call, which is great as long as you only have
public read/write properties. But data hiding &lt;em&gt;&lt;span style="FONT-FAMILY: Verdana"&gt;requires&lt;/span&gt;&lt;/em&gt; that
you will have some private fields that simply aren't exposed as public read/write
properties. If SPOIL supported using &lt;em&gt;&lt;span style="FONT-FAMILY: Verdana"&gt;fields&lt;/span&gt;&lt;/em&gt; as
data elements for a stored procedure call it would be totally awesome!&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;The same is true
for LINQ. It works against public read/write properties, which means it is totally
useless if you want to use it to load "real" objects that employ basic concepts like
encapsulation and data hiding. Oh sure, you can use LINQ (well, dlinq really) to load
a DTO (data transfer object - an object with only public read/write properties and
no business logic) and then copy the data from the DTO into your real object. Or you
could try to use the DTO as the "data container" inside your real object rather than
using private fields. But frankly those options introduce complexity that should be
simply unnecessary...&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;While it is true
that loading private fields requires reflection - Microsoft could solve this. They &lt;em&gt;&lt;span style="FONT-FAMILY: Verdana"&gt;do&lt;/span&gt;&lt;/em&gt; own
the CLR after all... It is surely within their power to provide a truly good solution
to the problem, that supports data mapping and also allows for key OO concepts like
encapsulation and data hiding.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=0e5f98c7-7e72-44ee-a9d0-f014adaf7587" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,0e5f98c7-7e72-44ee-a9d0-f014adaf7587.aspx</comments>
      <category>Architecture</category>
      <category>Distributed OO</category>
      <category>Microsoft .NET</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=f6d937f3-c759-4883-9ccc-7773588bbad4</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,f6d937f3-c759-4883-9ccc-7773588bbad4.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,f6d937f3-c759-4883-9ccc-7773588bbad4.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=f6d937f3-c759-4883-9ccc-7773588bbad4</wfw:commentRss>
      <title>Software is too darn hard</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,f6d937f3-c759-4883-9ccc-7773588bbad4.aspx</guid>
      <link>http://www.lhotka.net/weblog/SoftwareIsTooDarnHard.aspx</link>
      <pubDate>Mon, 23 Jan 2006 17:41:13 GMT</pubDate>
      <description>&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;[Warning, the following is a
bit of a rant...]&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&lt;/font&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&lt;a href="http://magenic.com/Services/CustomSoftwareDevelopment.aspx"&gt;Custom
software development&lt;/a&gt; is too darn hard. As an industry, we spend more time discussing
“plumbing” issues like Java vs .NET or .NET Remoting vs Web Services than we do discussing
the design of the actual business functionality itself.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;And even when we get to the
business functionality, we spend most of our time fighting with the OO design tools,
the form designer tools that “help” create the UI, the holes in data binding, the
data access code (transactions, concurrency, field/column mapping) and the database
design tools.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;Does the user care, or get any
benefit out of any of this? No. They really don’t. Oh sure, we &lt;i style=""&gt;convince&lt;/i&gt; ourselves
that they do, or that they’d “care if they knew”. But they really don’t.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;The users want a system that
does something useful. I think &lt;/font&gt;&lt;a href="http://www.sdtimes.com/article/opinion-20060115-02.html"&gt;&lt;font face="Times New Roman" size="3"&gt;Chris
Stone&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" size="3" color="#000000"&gt; gets it right
in this editorial.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;I think the underlying problem
is that just building business software to solve users’ problems is ultimately boring.
Most of us get into computers to express our creative side, not to assemble components
into working applications. &lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;If we wanted to do widget assembly,
there’s a whole lot of other jobs that’d provide more visceral satisfaction. Carpentry,
plumbing (like with pipes and water), cabinet making and many other jobs provide the
ability to assembly components to build really nice things. And those jobs have a
level of creativity too – just like assembly programs do in the computer world.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;But they don’t offer the level
of creativity and expression you get by building your own client/server, n-tier, SOA
framework. &lt;i style=""&gt;Using&lt;/i&gt; data binding isn’t nearly as creative or fun as &lt;i style=""&gt;building&lt;/i&gt; a
replacement for data binding…&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;I think this is the root of
the issue. The computer industry is largely populated by people who want to build
low-level stuff, not solve high-level business issues. And even if you go with conventional
wisdom; that Mort (the business-focused developer) outnumbers the Elvis/Einstein framework-builders
5 to 1, there are still enough Elvis/Einstein types in every organization to muck
things up for the Morts.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;Have you tried building an app
with VB3 (yes, Visual Basic 3.0) lately? A couple years ago I dusted that relic off
and tried it. VB3 programs are &lt;i style=""&gt;fast&lt;/i&gt;. I mean blindingly &lt;i style=""&gt;fast!&lt;/i&gt; It
makes sense, they were designed for the hardware of 1993… More importantly, a data
entry screen built in VB3 is every bit as functional to the user as a data entry screen
built with today’s trendy technologies.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;Can you &lt;i style=""&gt;really&lt;/i&gt; claim
that your Windows Forms 2.0, ASP.NET 2.0 or Flash UI makes the user’s data entry faster
or more efficient? Do you save them keystrokes? Seconds of time?&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;While I think the primary fault
lies with us, as software designers and developers, there’s no doubt that the vendors
feed into this as well.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;We’ve had remote-procedure-call
technology for a hell of a long time now. But the vendors keep refining it every few
years: got to keep the hype going. Web services are merely the latest incarnation
of a very long sequence of technologies that all you to call a procedure/component/method/service
on another computer. Does using Web services make the user more efficient than DCOM?
Does it save them time or keystrokes? No.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;But we justify all &lt;i style=""&gt;these&lt;/i&gt; things
by saying it will save &lt;i style=""&gt;us&lt;/i&gt; time. They’ll make &lt;i style=""&gt;us&lt;/i&gt; more
efficient. So ask your users. Do your users think you are doing a better job, that
you are more efficient and responsive, that you are giving them better software than
you were before Web Services? Before .NET? Before Java? &lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;Probably not. My guess: users
don’t have a clue that the technology landscape changed out from under them over the
past 5 years. They see the same software, with the same mis-match against the business
needs and the same inefficient data entry mechanisms they’ve seen for at least the
past 15 years…&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;No wonder they offshore the
work. We (at least in the 
&lt;st1:country-region w:st="on"&gt;US&lt;/st1:country-region&gt;
and 
&lt;st1:place w:st="on"&gt;Europe&lt;/st1:place&gt;
) have had a very long time to prove that we can do better work, that all this investment
in tools and platforms will make our users’ lives better. Since most of what we’ve
done hasn’t lived up to that hype, can it be at all surprising that our users feel
they can get the same crappy software at a tiny fraction of the price by offshoring?&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;Recently my friend Kathleen
Dollard made the comment that all of Visual Basic (and .NET in general) should be
geared toward Mort. I think she’s right. .NET should be geared toward making sure
that the &lt;i style=""&gt;business developer&lt;/i&gt; is exceedingly productive and can provide
tremendous business value to their organizations, with minimal time and effort.&lt;/font&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal" style="margin: 0in 0in 0pt;"&gt;
&lt;font face="Times New Roman" size="3" color="#000000"&gt;If our tools did what they were &lt;i style=""&gt;supposed&lt;/i&gt; to
do, the Elvis/Einstein types could back off and just let the majority of developers
use the tools – without wasting all that time building new frameworks. If our tools
did what they were supposed to do, the Mort types would be so productive there’d be
no value in offshoring. Expressing business requirements in software would be more
efficiently done by people who work in the business, who understand the business,
language and culture; and who have tools that allow them to build that software rapidly,
cheaply and in a way that &lt;i style=""&gt;actually meets the business need&lt;/i&gt;.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=f6d937f3-c759-4883-9ccc-7773588bbad4" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,f6d937f3-c759-4883-9ccc-7773588bbad4.aspx</comments>
      <category>Architecture</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=9f3332c1-8c4d-4263-831a-1d70f6cf351d</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,9f3332c1-8c4d-4263-831a-1d70f6cf351d.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,9f3332c1-8c4d-4263-831a-1d70f6cf351d.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=9f3332c1-8c4d-4263-831a-1d70f6cf351d</wfw:commentRss>
      <title>“Distributed Objects” are bad?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,9f3332c1-8c4d-4263-831a-1d70f6cf351d.aspx</guid>
      <link>http://www.lhotka.net/weblog/DistributedObjectsAreBad.aspx</link>
      <pubDate>Fri, 05 Aug 2005 15:12:29 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;a href="http://www.neward.net/ted/weblog/index.jsp?date=20050727#1122529218328"&gt;&lt;font face="Times New Roman" size=3&gt;Ted
Neward&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; believes that
“distributed objects” are, and always have been, a bad idea, and &lt;/font&gt;&lt;a href="http://pluralsight.com/blogs/johncj/archive/2005/08/04/13855.aspx"&gt;&lt;font face="Times New Roman" size=3&gt;John
Cavnar-Johnson&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; tends
to agree with him.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I also agree. "Distributed objects"
are bad.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Shocked? You shouldn’t be. The term
“distributed objects” is most commonly used to refer to one particular type of n-tier
implementation: the thin client model.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I discussed this model in a &lt;/font&gt;&lt;a href="http://www.lhotka.net/WeBlog/PermaLink.aspx?guid=3a057149-f30a-4350-976b-2c4627e6b8f5"&gt;&lt;font face="Times New Roman" size=3&gt;previous
post&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;, and you’ll note
that I didn’t paint it in an overly favorable light. That’s because the model is a
very poor one.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The idea of building a true object-oriented
model on a server, where the objects never leave that server is absurd. The Presentation
layer still needs all the data so it can be shown to the user and so the user can
interact with it in some manner. This means that the “objects” in the middle must
convert themselves into raw data for use by the Presentation layer.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;And of course the Presentation layer
needs to do something with the data. The &lt;i style="mso-bidi-font-style: normal"&gt;ideal&lt;/i&gt; is
that the Presentation layer has no logic at all, that it is just a pass-through between
the user and the business objects. But the reality is that the Presentation layer
ends up with some logic as well – if only to give the user a half-way decent experience.
So the Presentation layer often needs to convert the raw data into some useful data
structures or objects.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The end result with “distributed
objects” is that there’s typically duplicated business logic (at least validation)
between the Presentation and Business layers. The Presentation layer is also unnecessarily
complicated by the need to put the data into some useful structure. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;And the Business layer is complicated
as well. Think about it. Your typical OO model includes a set of objects designed
using OOD sitting on top of an ORM (object-relational mapping) layer. I typically
call this the Data Access layer. That Data Access layer then interacts with the real
Data layer.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;But in a “distributed object” model,
there’s the need to convert the objects’ data back into raw data – often quasi-relational
or hierarchical – so it can be transferred efficiently to the Presentation layer.
This is really a whole new logical layer very akin to the ORM layer, except that it
maps between the Presentation layer’s data structures and the objects rather than
between the Data layer’s structures and the objects.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;What a mess!&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Ted is absolutely right when he
suggests that “distributed objects” should be discarded. If you are really stuck on
having your business logic “centralized” on a server then service-orientation is a
better approach. Using formalized message-based communication between the client application
and your service-oriented (hence procedural, not object-oriented) server application
is a better answer.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Note that the terminology changed
radically! Now you are no longer building &lt;i style="mso-bidi-font-style: normal"&gt;one&lt;/i&gt; application,
but rather you are building at least &lt;i style="mso-bidi-font-style: normal"&gt;two&lt;/i&gt; applications
that happen to interact via messages. Your server doesn't pretend to be object-oriented,
but rather is service-oriented - which is a code phrase for procedural programming.
This is a totally different mindset from “distributed objects”, but it is far better.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Of course another model is to use &lt;i style="mso-bidi-font-style: normal"&gt;mobile
objects&lt;/i&gt; or &lt;i style="mso-bidi-font-style: normal"&gt;mobile agents&lt;/i&gt;. This is the
model promoted in my Business Objects books and enabled by CSLA .NET. In the mobile
object model your Business layer exists on both the client machine (or web server)
and application server. The objects physically move between the two machines – running
on the client when user interaction is required and running on the application server
to interact with the database.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The mobile object model allows you
to continue to build a single application (rather than 2+ applications with SO), but
overcomes the nasty limitations of the “distributed object” model.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=9f3332c1-8c4d-4263-831a-1d70f6cf351d" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,9f3332c1-8c4d-4263-831a-1d70f6cf351d.aspx</comments>
      <category>Architecture</category>
      <category>Distributed OO</category>
      <category>Service-Oriented</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=a8882caf-36df-46e8-8a5f-90968aa1c2fc</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,a8882caf-36df-46e8-8a5f-90968aa1c2fc.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,a8882caf-36df-46e8-8a5f-90968aa1c2fc.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=a8882caf-36df-46e8-8a5f-90968aa1c2fc</wfw:commentRss>
      <title>Extending the 3-tier conversation to the web</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,a8882caf-36df-46e8-8a5f-90968aa1c2fc.aspx</guid>
      <link>http://www.lhotka.net/weblog/ExtendingThe3tierConversationToTheWeb.aspx</link>
      <pubDate>Sun, 24 Jul 2005 14:47:26 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Mike has requested my thoughts on
3-tier and the web – a topic I avoided in my previous couple entries (&lt;/font&gt;&lt;a href="http://www.lhotka.net/WeBlog/PermaLink.aspx?guid=efa88d0a-2388-4909-bee1-c9bddb6e9868"&gt;&lt;font face="Times New Roman" size=3&gt;1&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; and &lt;/font&gt;&lt;a href="http://www.lhotka.net/WeBlog/PermaLink.aspx?guid=3a057149-f30a-4350-976b-2c4627e6b8f5"&gt;&lt;font face="Times New Roman" size=3&gt;2&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;)
because I don’t find it as interesting as a smart/intelligent client model. But he’s
right, the web is widely used and a lot of poor people are stuck building business
software in that environment, so here’s the extension of the previous couple entries
into the web environment.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt;In my view the web server &lt;i style="mso-bidi-font-style: normal"&gt;is
an application server&lt;/i&gt;, pure and simple. Also, in the web world it is impractical
to run the Business layer on the client because the client is a very limited environment.
This is largely why the web is far less interesting.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;To discuss things in the web world
I break the “Presentation” layer into two parts – Presentation and UI. This new Presentation
layer is purely responsible for display and input to/from the user – it is the stuff
that runs on the browser terminal. The UI layer is responsible for all actual user
interaction – navigation, etc. It is the stuff that runs on the web server: your aspx
pages in .NET.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In web applications most people
consciously (or unconsciously) &lt;i style="mso-bidi-font-style: normal"&gt;duplicate&lt;/i&gt; most
validation code into the Presentation layer so they can get it to run in the browser.
Thus is expensive to create/maintain, but is an unfortunate evil required to have
a half-way decent user experience in the web environment. You &lt;i style="mso-bidi-font-style: normal"&gt;must&lt;/i&gt; still
have that logic in your actual Business layer of course, because you can never trust
the browser - it is too easily bypassed (&lt;/font&gt;&lt;a href="http://greasemonkey.mozdev.org/"&gt;&lt;font face="Times New Roman" size=3&gt;Greasemonkey&lt;/font&gt;&lt;/a&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face="Times New Roman"&gt; anyone?).
This is just the way it is on the web, and will be until we get browsers that can
run complete code solutions in .NET and/or Java (that's sarcasm btw).&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;On the server side, the web server
IS an application server. It fills the exact same role of the mainframe or minicomputer
over the past 30 years of computing. For "interactive" applications, it is preferable
to run the UI layer, Business layer and Data Access layer all on the web server. This
is the simplest (and thus cheapest) model, and provides the best performance[1]. It
can also provide very good scalability because it is relatively trivial to create
a web farm to scale out to many servers. By creating a web farm you also get very
good fault tolerance at a low price-point. Using ISA as a reverse proxy above the
web farm you can get good security.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In many organizations the reverse
proxy idea isn’t acceptable (not being a security expert I can’t say why…) and so
they have a policy saying that the web server is never allowed to interact directly
with the database server – thus forcing the existence of an application server that
at a minimum runs the Data Access layer. Typically this application server is behind
a second firewall. While this security approach hurts performance (often by as much
as 50%), it is relatively easily achieved with &lt;/font&gt;&lt;a href="http://www.lhotka.net/cslanet"&gt;&lt;font face="Times New Roman" size=3&gt;CSLA
.NET&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; or similar architecture/frameworks.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In other situations people prefer
to put the Business layer and Data Access layer on the application server behind the
second firewall. This means that the web server only runs the UI layer. Any business
processing, validation, etc. must be deferred across the network to the application
server. This has a much higher impact on performance (in a bad way).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;However, this latter approach &lt;i style="mso-bidi-font-style: normal"&gt;can&lt;/i&gt; have
a positive scalability impact in certain applications. Specifically applications where
there’s not much interactive content, but instead there’s a lot of read-only content.
Most read-only content (by definition) has no business logic and can often be served
directly from the UI layer. In such applications the IO load for the read-only content
can be quite enough to keep the web server very busy. By offloading all business processing
to an application server overall scalability may be improved.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Of course this only really works
if the interactive (OLTP) portions of the application are quite limited in comparison
to the read-only portions.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Also note that this latter approach
suffers from the same drawbacks as the &lt;i style="mso-bidi-font-style: normal"&gt;thin
client&lt;/i&gt; model discussed in my &lt;/font&gt;&lt;a href="http://www.lhotka.net/WeBlog/PermaLink.aspx?guid=3a057149-f30a-4350-976b-2c4627e6b8f5"&gt;&lt;font face="Times New Roman" size=3&gt;previous
post&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt;. The most notable
problem is that you must come up with a way to do non-chatty communication between
the UI layer and the Business layer, without compromising either layer. This is historically
very difficult to pull off. What usually happens is that the “business objects” in
the Business layer require code to externalize their state (data) into a tabular format
such as a DataSet so the UI layer can easily use the data. Of course externalizing
object state breaks encapsulation unless it is done with great care, so this is an
area requiring extra attention. The typical end result are not objects in a real OO
sense, but rather are “objects” comprised of a set of atomic, stateless methods. At
this point you don’t have objects at all – you have an API.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In the case of CSLA .NET, I apply
the mobile object model to this environment. I personally believe it makes things
better since it gives you the flexibility to run some of your business logic on the
web application server and some on the pure application server as appropriate. Since
the Business layer is installed on both the web and application servers, your objects
can run in either place as needed.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In short, to make a good web app
it is almost required that you must compromise the integrity of your layers and duplication
some business logic into the Presentation layer. It sucks, but its life in the wild
world of the web. If you &lt;i style="mso-bidi-font-style: normal"&gt;can&lt;/i&gt; put your UI,
Business and Data Access layers on the web application server that’s best. If you
can’t (typically due to security) then move only the Data Access layer and keep both
UI and Business layers on the web application server. Finally, if you &lt;i style="mso-bidi-font-style: normal"&gt;must&lt;/i&gt; put
the Business layer on a separate application server I prefer to use a mobile object
model for flexibility, but recognize that a pure API model on the application server
will scale higher and is often required for applications with truly large numbers
of concurrent users (like 2000+).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;[1] As someone in a previous post
indirectly noted, there’s a relationship between performance and scalability. Performance
is the response time of the system for a user. Scalability is what happens to performance
as the number of users and/or transactions is increased.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=a8882caf-36df-46e8-8a5f-90968aa1c2fc" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,a8882caf-36df-46e8-8a5f-90968aa1c2fc.aspx</comments>
      <category>Architecture</category>
      <category>Distributed OO</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=3a057149-f30a-4350-976b-2c4627e6b8f5</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,3a057149-f30a-4350-976b-2c4627e6b8f5.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,3a057149-f30a-4350-976b-2c4627e6b8f5.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=3a057149-f30a-4350-976b-2c4627e6b8f5</wfw:commentRss>
      <title>A variety of physical n-tier options</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,3a057149-f30a-4350-976b-2c4627e6b8f5.aspx</guid>
      <link>http://www.lhotka.net/weblog/AVarietyOfPhysicalNtierOptions.aspx</link>
      <pubDate>Sat, 23 Jul 2005 17:12:25 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In my &lt;/font&gt;&lt;a href="http://www.lhotka.net/WeBlog/PermaLink.aspx?guid=efa88d0a-2388-4909-bee1-c9bddb6e9868"&gt;&lt;font face="Times New Roman" size=3&gt;last
post&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; I talked about logical
layers as compared to physical tiers. It may be the case that that post (and this
one) are too obvious or basic. But I gotta say that I consistently am asked about
these topics at conferences, user groups and via email. The reality is that none of
this is all that obvious or clear to the vast majority of people in our industry.
Even for those that truly &lt;/font&gt;&lt;a href="http://en.wikipedia.org/wiki/Grok"&gt;&lt;font face="Times New Roman" size=3&gt;grok&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; the
ideas, there’s far from universal agreement on how an application should be layered
or how those layers should be deployed onto tiers.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In one comment on my previous post
Magnus points out that my portrayal of the application server merely as a place for
the Data Access layer flies in the face of Magnus’ understanding of n-tier models.
Rather, Magnus (and many other people) is used to putting both the Business and Data
Access layers on the application server, with only the Presentation layer on the client
workstation (or presumably the web server in the case of a web application, though
the comment didn’t make that clear).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The reality is that there are three
primary models to consider in the smart/rich/intelligent client space. There are loose
analogies in the web world as well, but personally I don’t find that nearly as interesting,
so I’m going to focus on the intelligent client scenarios here.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Also one quick reminder – tiers
should be avoided. This whole post assumes you’ve justified using a 3-tier model to
obtain scalability or security as per my previous post. If you don’t need 3-tiers,
don’t use them – and then you can safely ignore this whole entry :)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;There’s the &lt;i style="mso-bidi-font-style: normal"&gt;thick
client&lt;/i&gt; model, where the Presentation and Business layers are on the client, and
the Data Access is on the application server. Then there’s the &lt;i style="mso-bidi-font-style: normal"&gt;thin
client&lt;/i&gt; model where only the Presentation layer is on the client, with the Business
and Data Access layers on the application server. Finally there’s the &lt;i style="mso-bidi-font-style: normal"&gt;mobile
object&lt;/i&gt; model, where the Presentation and Business layers are on the client, and
the Business and Data Access layers are on the application server. (Yes, the Business
layer is in two places) This last model is the one I discuss in my &lt;/font&gt;&lt;a href="http://www.lhotka.net/cslanet"&gt;&lt;font face="Times New Roman" size=3&gt;Expert
VB.NET and C# Business Objects&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; books
and which is supported by my CSLA .NET framework.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The benefit to the thick client
model is that we are able to provide the user with a highly interactive and responsive
user experience, and we are able to fully exploit the resources of the client workstation
(specifically memory and CPU). At the same time, having the Data Access layer on the
application server gives us database connection pooling. This is a very high scaling
solution, with a comparatively low cost, because we are able to exploit the strengths
of the client, application and database servers very effectively. Moreover, the user
experience is very good and development costs are relatively low (because we can use
the highly productive Windows Forms technology).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The drawback to the thick client
model is a loss of flexibility – specifically when it comes to process-oriented tasks.
Most applications have large segments of OLTP (online transaction processing) functionality
where a highly responsive and interactive user experience is of great value. However,
most applications also have some important segments of process-oriented tasks that
don’t require any user interaction. In most cases these tasks are best performed on
the application server, or perhaps even directly in the database server itself. This
is because process-oriented tasks tend to be very data intensive and non-interactive,
so the closer we can do them to the database the better. In a thick client model there’s
no natural home for process-oriented code near the database – the Business layer is
way out on the client after all…&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Another perceived drawback to the
thick client is deployment. I dismiss this however, given .NET’s no-touch deployment
options today, and ClickOnce coming in 2005. Additionally, &lt;i style="mso-bidi-font-style: normal"&gt;any&lt;/i&gt; intelligent
client application requires deployment of our code – the Presentation layer at least.
Once you solve deployment of one layer you can deploy other layers as easily, so this
whole deployment thing is a non-issue in my mind.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In short, the thick client model
is really nice for interactive applications, but quite poor for process-oriented applications.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The benefit to the thin client model
is that we have greater control over the environment into which the Business and Data
Access layers are deployed. We can deploy them onto large servers, multiple servers,
across disparate geographic locations, etc. Another benefit to this model is that
it has a natural home for process-oriented code, since the Business layer is already
on the application server and thus is close to the database.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Unfortunately history has shown
that the thin client model is severely disadvantaged compared to the other two models.
The first disadvantage is scalability in relationship to cost.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;With
either of the other two models as you add more users you intrinsically add more memory
and CPU to your overall system, because you are leveraging the power of the client
workstation. With a thin client model all the processing is on the servers, and so
client workstations add virtually no value at all – their memory and CPU is wasted.
Any scalability comes from adding larger or more numerous server hardware rather than
by adding cheaper (and already present) client workstations.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The other key drawback to the thin
client model is the user experience. Unless you are willing to make “chatty” calls
from the thin Presentation layer to the Business layer across the network on a continual
basis (which is obviously absurd), the user experience will not be interactive or
responsive. By definition the Business layer is on a remote server, so the user’s
input can’t be validated or processed without first sending it across the network.
The end result is roughly equivalent to the mainframe user experiences users had with
3270 terminals, or the experience they get on the web in many cases. Really not what
we should expect from an “intelligent” client…&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Of course deployment remains a potential
concern in this model, because the Presentation layer must still be deployed to the
client. Again, I dismiss this as a main issue any longer due to no-touch deployment
and ClickOnce.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In summary, the thin client model
is really nice for process-oriented (non-interactive) applications, but is quite inferior
for interactive applications.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;This brings us to the mobile object
model. You’ll note that neither the thick client nor thin client model is optimal,
because almost all applications have some interactive and some non-interactive (process-oriented)
functionality. Neither of the two “purist” models really addresses both requirements
effectively. This is why I am such a fan of the mobile object (or mobile agent, or
distributed OO) model, as it provides a compromise solution. I find this idea so compelling
that it is the basis for my books.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The mobile object model literally
has us deploy the Business layer to both the client and application server. Given
no-touch deployment and/or ClickOnce this is quite practical to achieve in.NET (and
in Java interestingly enough). Coupled with .NET’s ability to pass objects across
the network by value (another ability shared with Java), all the heavy lifting to
make this concept work is actually handled by .NET itself, leaving us to merely enjoy
the benefits.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The end result is that the client
has the Presentation and Business layers, meaning we get all the benefits of the thick
client model. The user experience is responsive and highly interactive. Also we are
able to exploit the power of the client workstation, offering optimal scalability
at a low cost point.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;But where this gets really exciting
is the flexibility offered. Since the Business layer &lt;i style="mso-bidi-font-style: normal"&gt;also&lt;/i&gt; runs
on the application server, we have all the benefits of the thin client model. Any
process-oriented tasks can be performed by objects running on the application server,
meaning that all the power of the thin client model is at our disposal as well.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The drawback to the mobile object
approach is complexity. Unless you have a framework to handle the details of moving
an object to the client and application server as needed this model can be hard to
implement. However, given a framework that supports the concept the mobile object
approach is no more complex than either the thick or thin client models.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In summary, the mobile object model
is great for both interactive and non-interactive applications. I consider it a “best
of both worlds” model and CSLA .NET is specifically designed to make this model comparatively
easy to implement in a business application.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;At the risk of being a bit esoteric,
consider the broader possibilities of a mobile object environment. Really a client
application or an application server (Enterprise Services or IIS) are merely hosts
for our objects. Hosts provide resources that our objects can use. The client “host”
provides access to the &lt;i style="mso-bidi-font-style: normal"&gt;user resource&lt;/i&gt;, while
a typical application server “host” provides access to the &lt;i style="mso-bidi-font-style: normal"&gt;database
resource&lt;/i&gt;. In some applications you can easily envision other hosts such as a batch
processing server that provides access to a &lt;i style="mso-bidi-font-style: normal"&gt;high
powered CPU resource&lt;/i&gt; or a &lt;i style="mso-bidi-font-style: normal"&gt;large memory
resource&lt;/i&gt;.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Given a true mobile object environment,
objects would be free to move to a host that offers the resources an object requires
at any point in time. This is very akin to grid computing. In the mobile object world
objects maintain both data and behavior and merely move to physical locations in order
to access resources. Raw data never moves across the network (except between the Data
Access and Data Storage layers), because data without context (behavior) is meaningless.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Of course some very large systems
have been built following both the thick client and thin client models. It would be
foolish to say that either is fatally flawed. But it is my opinion that neither is
optimal, and that a mobile object approach is the way to go.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=3a057149-f30a-4350-976b-2c4627e6b8f5" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,3a057149-f30a-4350-976b-2c4627e6b8f5.aspx</comments>
      <category>Architecture</category>
      <category>Distributed OO</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=efa88d0a-2388-4909-bee1-c9bddb6e9868</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,efa88d0a-2388-4909-bee1-c9bddb6e9868.aspx</pingback:target>
      <dc:creator>Rockford Lhotka</dc:creator>
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,efa88d0a-2388-4909-bee1-c9bddb6e9868.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=efa88d0a-2388-4909-bee1-c9bddb6e9868</wfw:commentRss>
      <title>Should all apps be n-tier?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,efa88d0a-2388-4909-bee1-c9bddb6e9868.aspx</guid>
      <link>http://www.lhotka.net/weblog/ShouldAllAppsBeNtier.aspx</link>
      <pubDate>Thu, 21 Jul 2005 21:51:17 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;I am often asked whether n-tier
(where n&amp;gt;=3) is always the best way to go when building software.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Of course the answer is no. In fact,
it is more likely that n-tier is &lt;i style="mso-bidi-font-style: normal"&gt;not&lt;/i&gt; the
way to go!&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;By the way, this isn’t the first
time I’ve discussed this topic – you’ll find previous blog entries on this blog and
an article at &lt;/font&gt;&lt;a href="http://www.devx.com/"&gt;&lt;font face="Times New Roman" size=3&gt;www.devx.com&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; where
I’ve covered much of the same material. Of course I also cover it rather a lot in
my &lt;/font&gt;&lt;a href="http://www.lhotka.net/cslanet"&gt;&lt;font face="Times New Roman" size=3&gt;Expert
VB.NET and C# Business Objects&lt;/font&gt;&lt;/a&gt;&lt;font face="Times New Roman" color=#000000 size=3&gt; books.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Before proceeding further however,
I need to get some terminology out of the way. There’s a huge difference between logical
tiers and physical tiers. Personally I typically refer to logical tiers as &lt;i style="mso-bidi-font-style: normal"&gt;layers&lt;/i&gt; and
physical tiers as &lt;i style="mso-bidi-font-style: normal"&gt;tiers&lt;/i&gt; to avoid confusion.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Logical layers are merely a way
of organizing your code. Typical layers include Presentation, Business and Data –
the same as the traditional 3-tier model. But when we’re talking about layers, we’re
only talking about logical organization of code. In no way is it implied that these
layers might run on different computers or in different processes on a single computer
or even in a single process on a single computer. &lt;i style="mso-bidi-font-style: normal"&gt;All&lt;/i&gt; we
are doing is discussing a way of organizing a code into a set of layers defined by
specific function.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Physical tiers however, are only
about where the code runs. Specifically, tiers are places where layers are deployed
and where layers run. In other words, tiers are the physical deployment of layers.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Why do we layer software? Primarily
to gain the benefits of logical organization and grouping of like functionality. Translated
to tangible outcomes, logical layers offer reuse, easier maintenance and shorter development
cycles. In the final analysis, proper layering of software reduces the cost to develop
and maintain an application. Layering is almost always a wonderful thing!&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Why do we deploy layers onto multiple
tiers? Primarily to obtain a balance between performance, scalability, fault tolerance
and security. While there are various other reasons for tiers, these four are the
most common. The funny thing is that it is almost impossible to get optimum levels
of all four attributes – which is why it is always a trade-off between them.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Tiers imply process and/or network
boundaries. A 1-tier model has all the layers running in a single memory space (process)
on a single machine. A 2-tier model has some layers running in one memory space and
other layers in a different memory space. At the very least these memory spaces exist
in different processes on the same computer, but more often they are on different
computers. Likewise, a 3-tier model has two boundaries. In general terms, an n-tier
model has n-1 boundaries.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Crossing a boundary is expensive.
It is on the order of 1000 times slower to make a call across a process boundary &lt;i style="mso-bidi-font-style: normal"&gt;on
the same machine&lt;/i&gt; than to make the same call within the same process. If the call
is made across a network it is even slower. It is very obvious then, that the more
boundaries you have the slower your application will run, because each boundary has
a geometric impact on performance.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Worse, boundaries add raw complexity
to software design, network infrastructure, manageability and overall maintainability
of a system. In short, the more tiers in an application, the more complexity there
is to deal with – which directly increases the cost to build and maintain the application.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;This is why, in general terms tiers
should be minimized. Tiers are not a good thing, they are a necessary evil required
to obtain certain levels of scalability, fault tolerance or security.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;As a good architect you should be
dragged kicking and screaming into adding tiers to your system. But there really are
good arguments and reasons for adding tiers, and it is important to accommodate them
as appropriate.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The reality is that almost all systems
today are at least 2-tier. Unless you are using an Access or dBase style database
your Data layer is running on its own tier – typically inside of SQL Server, Oracle
or DB2. So for the remainder of my discussion I’ll primarily focus on whether you
should use a 2-tier or 3-tier model.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;If you look at the CSLA .NET architecture
from my Expert VB.NET and C# Business Objects books, you’ll immediately note that
it has a construct called the DataPortal which is used to abstract the Data Access
layer from the Presentation and Business layers. One key feature of the DataPortal
is that it allows the Data Access layer to run in-process with the business layer,
or in a separate process (or machine) all based on a configuration switch. It was
specifically designed to allow an application to switch between a 2-tier or 3-tier
model as a configuration option – with no changes required to the actual application
code.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;But even so, the question remains
whether to configure an application for 2 or 3 tiers.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Ultimately this question can only
be answered by doing a cost-benefit analysis for your particular environment. You
need to weigh the additional complexity and cost of a 3-tier deployment against the
benefits it might bring in terms of scalability, fault tolerance or security.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Scalability flows primarily from
the ability to get database connection pooling. In CSLA .NET the Data Access layer
is entirely responsible for all interaction with the database. This means it opens
and closes all database connections. If the Data Access layer for all users is running
on a single machine, then all database connections for all users can be pooled. (this
does assume of course, that all users employ the same database connection string include
the same database user id – that’s a prerequisite for connection pooling in the first
place)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The scalability proposition is quite
different for web and Windows presentation layers. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In a web presentation the Presentation
and Business layers are already running on a shared server (or server farm). So if
the Data Access layer also runs on the same machine database connection pooling is
automatic. In other words, the web server is an implicit application server, so there’s
really no need to have a separate application server just to get scalability in a
web setting.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In a Windows presentation the Presentation
and Business layers (at least with CSLA .NET) run on the client workstation, taking
full advantage of the memory and CPU power available on those machines. If the Data
Access layer is also deployed to the client workstations then there’s no real database
connection pooling, since each workstation connects to the database directly. By employing
an application server to run the Data Access layer all workstations offload that behavior
to a central machine where database connection pooling is possible.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;The big question with Windows applications
is at what point to use an application server to gain scalability. Obviously there’s
no objective answer, since it depends on the IO load of the application, pre-existing
load on the database server and so forth. In other words it is very dependant on your
particular environment and application. This is why the DataPortal concept is so powerful,
because it allows you to deploy your application using a 2-tier model at first, and
then switch to a 3-tier model later if needed.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;There’s also the possibility that
your Windows application will be deployed to a Terminal Services or Citrix server
rather than to actual workstations. Obviously this approach totally eliminates the
massive scalability benefits of utilizing the memory and CPU of each user’s workstation,
but does have the upside of reducing deployment cost and complexity. I am not an expert
on either server environment, but it is my understanding that each user session has
its own database connection pool on the server, thus acting the same as if each user
has their own separate workstation. If this is actually the case, then an application
server would have benefit by providing database connection pooling. However, if I’m
wrong and all user sessions share database connections across the entire Terminal
Services or Citrix server then having an application server would offer no more scalability
benefit here than it does in a web application (which is to say virtually none).&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Fault tolerance is a bit more complex
than scalability. Achieving real fault tolerance requires examination of all failure
points that exist between the user and the database – and of course the database itself.
And if you want to be complete, you just also consider the user to be a failure point,
especially when dealing with workflow, process-oriented or service-oriented systems.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;In most cases adding an application
server to either a web or Windows environment doesn’t improve fault tolerance. Rather
it merely makes it more expensive because you have to make the application server
fault tolerant along with the database server, the intervening network infrastructure
and any client hardware. In other words, fault tolerance is often less expensive in
a 2-tier model than in a 3-tier model.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Security is also a complex topic.
For many organizations however, security often comes down to protecting access to
the database. From a software perspective this means restricting the code that interacts
with the database and providing strict controls over the database connection strings
or other database authentication mechanisms.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Security is a case where 3-tier
can be beneficial. By putting the Data Access layer onto its own application server
tier we isolate all code that interacts with the database onto a central machine (or
server farm). More importantly, only that application server needs to have the database
connection string or the authentication token needed to access the database server.
No web server or Windows workstation needs the keys to the database, which can help
improve the overall security of your application.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Of course we must always remember
that switching from 2-tier to 3-tier decreases performance and increases complexity
(cost). So any benefits from scalability or security must be sufficient to outweigh
these costs. It all comes down to a cost-benefit analysis.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=efa88d0a-2388-4909-bee1-c9bddb6e9868" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,efa88d0a-2388-4909-bee1-c9bddb6e9868.aspx</comments>
      <category>Architecture</category>
      <category>CSLA .NET</category>
      <category>Distributed OO</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=2a5e2d14-3cf5-4cea-a296-24b894228f5d</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,2a5e2d14-3cf5-4cea-a296-24b894228f5d.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,2a5e2d14-3cf5-4cea-a296-24b894228f5d.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=2a5e2d14-3cf5-4cea-a296-24b894228f5d</wfw:commentRss>
      <title>Message-based WebMethod "overloading"</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,2a5e2d14-3cf5-4cea-a296-24b894228f5d.aspx</guid>
      <link>http://www.lhotka.net/weblog/MessagebasedWebMethodOverloading.aspx</link>
      <pubDate>Tue, 03 May 2005 16:15:53 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;Over
the past few weeks I've given a number of presentations on service-oriented design
and how it relates to both OO and n-tier models. One constant theme has been my recommendation
that service methods use a request/response or just request method signature:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;response&amp;nbsp;= &lt;em&gt;&lt;span style="FONT-FAMILY: Verdana"&gt;f&lt;/span&gt;&lt;/em&gt;(request)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;or&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;em&gt;&lt;span style="FONT-FAMILY: Verdana"&gt;f&lt;/span&gt;&lt;/em&gt;(request)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;"request" and
"response" are both messages, defined by a type or schema (with a little "s", not
necessarily XSD).&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;The actual procedure, &lt;em&gt;&lt;span style="FONT-FAMILY: Verdana"&gt;f&lt;/span&gt;&lt;/em&gt;,
is then implemented as a &lt;a href="http://patternshare.org/default.aspx/Home.HW.MessageRouter"&gt;Message
Router&lt;/a&gt;, routing each call to an appropriate handler method depending on the specific
type of the request message.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;In concept this
is an ideal model, as it helps address numerous issues around decoupling the client
and service, and around versioning of a service over time. I discussed many of these
issues in my article on &lt;a href="http://www.theserverside.net/articles/showarticle.tss?id=SOAVersioningCovenant"&gt;SOA
Covenants&lt;/a&gt;.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;Of course the
devil is in the details, or in this case the implementation. Today's web service technologies
don't make it particularly easy to attach multiple schemas to a given parameter -
which we must do to the "request" parameter in order to allow our single endpoint
to accept multiple request messages.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;One answer is
to manually create the XSD and/or WSDL. Personally I find that answer impractical.
Angle-brackets weren't meant for human creation or consumption, and programmers shouldn't
have to see (much less type) things like XSD or WSDL.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;Fortunately there's
another answer. In &lt;a href="http://www.srtsolutions.com/public/item/91025"&gt;this blog
entry&lt;/a&gt;, Microsoft technology expert Bill Wagner shows how to implement "method
overloading" in asmx using C# to do the heavy lifting. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;While the outcome
isn't totally seamless or perfect, it is pretty darn good. In my mind Bill's answer
is a decent compromise between getting the functionality we need, and avoiding the
manual creation of cryptic WSDL artifacts.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;The end result
is that it is totally possible to construct flexible, maintainable and broadly useful
web services using VB.NET or C#. Web services that follow a purely message-based approach,
implement a message router on the server and thus provide a good story for both versioning
and multiple message format stories.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #003300; FONT-FAMILY: Verdana"&gt;Indigo, btw, offers
a similar solution to what Bill talks about. In the Indigo situation however, it appears
that we’ll have more fine-grained control over the generation of the public schema
through the use of the DataContract idea, combined with inheritance in our VB or C#
code.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=2a5e2d14-3cf5-4cea-a296-24b894228f5d" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,2a5e2d14-3cf5-4cea-a296-24b894228f5d.aspx</comments>
      <category>Service-Oriented</category>
      <category>Architecture</category>
    </item>
    <item>
      <trackback:ping>http://www.lhotka.net/weblog/Trackback.aspx?guid=7849bd66-21b9-4731-9a22-1d617f0f9455</trackback:ping>
      <pingback:server>http://www.lhotka.net/weblog/pingback.aspx</pingback:server>
      <pingback:target>http://www.lhotka.net/weblog/PermaLink,guid,7849bd66-21b9-4731-9a22-1d617f0f9455.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.lhotka.net/weblog/CommentView,guid,7849bd66-21b9-4731-9a22-1d617f0f9455.aspx</wfw:comment>
      <wfw:commentRss>http://www.lhotka.net/weblog/SyndicationService.asmx/GetEntryCommentsRss?guid=7849bd66-21b9-4731-9a22-1d617f0f9455</wfw:commentRss>
      <title>Is Indigo compelling or boring?</title>
      <guid isPermaLink="false">http://www.lhotka.net/weblog/PermaLink,guid,7849bd66-21b9-4731-9a22-1d617f0f9455.aspx</guid>
      <link>http://www.lhotka.net/weblog/IsIndigoCompellingOrBoring.aspx</link>
      <pubDate>Tue, 19 Apr 2005 04:13:06 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Indigo is Microsoft’s code name
for the technology that will bring together the functionality in today’s .NET Remoting,
Enterprise Services, Web services (including WSE) and MSMQ. Of course knowing what
it is doesn’t necessarily tell us whether it is cool, compelling and exciting … or
rather boring.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Ultimately beauty is in the eye
of the beholder. Certainly the Indigo team feels a great deal of pride in their work
and they paint this as a very big and compelling technology.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Many technology experts I’ve talked
to outside of Microsoft are less convinced that it is worth getting all excited.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Personally, I must confess that
I find Indigo to be a bit frustrating. While it should provide some absolutely critical
benefits, in my view it is merely laying the groundwork for the potential of something
actually exciting to follow a few years later.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Why do I say this?&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Well, consider what Indigo is again.
It is a technology that brings together a set of existing technologies. It provides
a unified API model on top of a bunch of concepts and tools we already have. To put
it another way, it lets us do what we can already do, but in a slightly more standardized
manner.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;If you are a WSE user, Indigo will
save you &lt;i style="mso-bidi-font-style: normal"&gt;tons&lt;/i&gt; of code. But that’s because
WSE is experimental stuff and isn’t refined to the degree Remoting, Enterprise Services
or Web services are. If you are using any of those technologies, Indigo won’t save
you much (if any) code – it will just subtly alter the way you do the things you already
do.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Looking at it this way, it doesn’t
sound all that compelling really does it?&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;But consider this. Today’s technologies
are a mess. We have at least five different technologies for distributed communication
(Remoting, ES, Web services, MSMQ and WSE). Each technology shines in different ways,
so each is appropriate in different scenarios. This means that to be a competent .NET
architect/designer you must know all five reasonably well. You need to know the strengths
and weaknesses of each, and you must know how easy or hard they are to use and to
potentially extend. &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Worse, you can’t expect to easily
switch between them. Several of these options are mutually exclusive.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;But the final straw (in my mind)
is this: the technology you pick locks you into a single architectural world-view.
If you pick Web services or WSE you are accepting the SOA world view. Sure you can
hack around that to do n-tier or client/server, but it is ugly and dangerous. Similarly,
if you pick Enterprise Services you get a nice set of client/server functionality,
but you lose a lot of flexibility. And so forth.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Since the architectural decisions
are so directly and irrevocably tied to the technology, we can’t actually discuss
architecture. We are limited to discussing our systems in terms of the technology
itself, rather than the architectural concepts and goals we’re trying to achieve.
And that is very sad.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;By merging these technologies into
a single API, Indigo may allow us to elevate the level of dialog. Rather than having
inane debates between Web services and Remoting, we can have intelligent discussions
about the pros and cons of n-tier vs SOA. We can apply rational thought as to how
each distributed architecture concept applies to the various parts of our application.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;We might even find that some parts
of our application are n-tier, while others require SOA concepts. Due to the unified
API, Indigo should allow us to actually do both where appropriate. Without irrational
debates over protocol, since Indigo natively supports concepts for both n-tier and
SOA.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Now &lt;i style="mso-bidi-font-style: normal"&gt;this&lt;/i&gt; is
compelling!&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;As compelling as it is to think
that we can start having more intelligent and productive architectural discussions,
that isn’t the whole of it. I am hopeful that Indigo represents the groundwork for
greater things.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;There are a lot of very hard problems
to solve in distributed computing. Unfortunately our underlying communications protocols
never seem to stay in place long enough for anyone to really address the more interesting
problems. Instead, for many years now we’ve just watched as vendors reinvent the concept
of remote procedure calls over and over again: RPC, IIOP, DCOM, RMI, Remoting, Web
services, Indigo.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;That is frustrating. It is frustrating
because we never really move beyond RPC. While there’s no doubt that Indigo is much
easier to use and more clear than any previous RPC scheme, it is also quite true that
Indigo merely lets us do what we could already do.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;What I’m hoping (perhaps foolishly)
is that Indigo will be the end. That we’ll finally have an RPC technology that is
stable and flexible enough that it won’t need to be replaced so rapidly. And being
stable and flexible, it will allow the pursuit of solutions to the harder problems.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;What are those problems? They are
many, and they include semantic meaning of messages and data. They include distributed
synchronization primitives and concepts. They include standardization and simplification
of background processing – making it as easy and natural as synchronous processing
is today. They include identity and security issues, management of long-running processes,
simplification of compensating transactions and many other issues.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face="Times New Roman" color=#000000 size=3&gt;Maybe Indigo represents the platform
on which solutions to these and other problems can finally be built. Perhaps in another
5 years we can look back and say that Indigo was the turning point that finally allowed
us to &lt;i style="mso-bidi-font-style: normal"&gt;really&lt;/i&gt; make distributed computing
a first-class concept.&lt;/font&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.lhotka.net/weblog/aggbug.ashx?id=7849bd66-21b9-4731-9a22-1d617f0f9455" /&gt;</description>
      <comments>http://www.lhotka.net/weblog/CommentView,guid,7849bd66-21b9-4731-9a22-1d617f0f9455.aspx</comments>
      <category>Architecture</category>
      <category>Distributed OO</category>
      <category>Microsoft .NET</category>
      <category>Service-Oriented</category>
    </item>
  </channel>
</rss>