Category Archives: Technology

“Micro Architectures”

Jim Wilt and I had an interesting discussion today, around the role of software architecture in the current economy.  I shared some thoughts around something I’ve been thinking that I call “micro architectures” (for lack of a better name).

Let me start with a personal dilemma:  I’m debating moving my blog (currently running an old version of Community Server) to something different (either a different provider or upgrading to the latest version of Community Server).  Although it’s been very reliable, the thing that concerns me about my blog is that I don’t intimately know how it works.  I’ve looked through a lot of the forums, and even other open source blog providers, but the architecture for everything that I’ve seen so far seems just too unwieldy for what I’m trying to accomplish.

While searching, I began asking myself the question – “Instead of the most architecturally correct design, what would be the smallest design that supports my need?  And more importantly, how would these two be different?”  Small in this instance refers to the number of modules, configuration files, lines of code, and other parts of the design.  I think as architects and developers we have a habit of defaulting to configuration files, extensibility, and dependency injection into our designs from day one – even though the core use cases of the design don’t immediately demand it.  We design too much in for the future or for edge cases which ends up in “I’ve abstracted this setting into this_obscure_setting_config.xml just in case we need to switch the setting in the future”.  Nice extensibility – but will anyone ever actually switch that setting?  Really?  And if someone did, does a recompile of the code really add that much headache over the additional abstraction and testing required for the extensibility?  Jeffrey Pallermo covers an element of this recently in his post about hard coding.

Coming back to my blog example, what would a “micro architecture” for my blog look like?  I would assert that I could do the following:

Eliminate Elaborate Database Access Code.  Do I really need it?  Do I really need a database abstraction layer (myDal) that inherits from an interface (IDal), uses a configuration file (database_config.xml) and some dependency injection under the covers so that I can switch out the driver at some point in the future?  Probably not. 

Question the Need for a Database.  Talking of which, do I actually need the database itself?  Access to the database (or lack thereof) seems to be the root cause of issues that I have when my blog goes down.  Two primary considerations for using a database are performance and indexing.  Performance?  I would like to think that millions of people visit my blog every day, but the reality is somewhat different.  Even with 50 comments attached to a blog post, a file system solution would probably perform well enough for anyone reading the blog.  Indexing?  Sure, I would like search enabled on my blog, but why not just redirect to (or embed) an existing Google search, parameterized to my domain? 

Create a Minimal User Interface.  I got thinking about what HTML controls I would need to supply to enable updates and edits to posts – the question is, do I really need a fully functioning Admin UI to update the blog?  Would it not be simpler to only expose a MetaWeblog or ATOM publishing API instead and use something like Windows Live Writer to create and edit my posts? 

No Admin UI for Creating “About” and Other Pages.  Again, do I really need the administration overhead for handling this?  Can I not just create a new .ASPX or PHP page and attach it to the site.  Seriously?

Remove Skins and Styles from the Code.  No brainer.  Reference a CSS and be done with it.  The blog’s responsibility should be to only output well formatted HTML that can be styled with CSS.

I’m sure there’s more that I’m missing, but hopefully you get the idea.  To sum this up and conclude, I would argue that a “micro architecture” could have the following principles:

It’s OK to ignore edge cases.  The architecture is designed only against core use cases, and nothing else.  With the exception of input validation, edge cases are not considered.

It’s OK to write code – as long as that functionality doesn’t exist in another solution that can be reused.  Subsystems are written only when there is not a valid external solution that can be used.

It’s OK to hardcode configuration values.  Hardcoding is OK for core use cases (providing that it doesn’t invalidate security – for example, you don’t want to be hardcoding usernames and passwords, of course)

It’s OK to recompile.  Recompiling is really OK if edge cases are introduced at a later point in the future.  I actually think this is healthy because it encourages developers to open up the solution (and possibly improve the solution as a result of what they’ve learned since they last wrote the code). 

It’s OK to unit test.  Because a greater focus is given to the code of an application (as opposed to 50 million different configuration files), unit tests and test driven development become even more important. 

Maybe I’ll actually try this out and see what happens?

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

PDC2008 Symposium Announced!

image

Coming to PDC?  Interested in what it means to move to the cloud?  If so, you should definitely check out the PDC symposium this year. 

The symposium is three sessions that wrap up the last day of the PDC – the goal of which is to "connect the dots" between everything that you’ll have heard at the event, and look at some of the next steps and challenges for making it real.  The sessions cover expanding applications to the cloud, making enterprise-grade cloud applications, and emerging patterns that take into consideration some of the physical aspects of moving applications to the cloud.

Not coming to PDC? There’s still time to register and attend!

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Architecture Journal Issue 16 Released, and Issue 18 Call For Papers

I wanted to share a couple of updates about the Microsoft Architecture Journal:

1.  Issue 16 has just been released to the web!  You can find it here, and can also download a PDF version of the magazine here.  The theme of issue 16 is Identity and Access, and Diego explains more about the articles in his blog post.

2.  The call for papers for Issue 18 has just been released.  Again, Diego uncovers the details here, the theme of this upcoming issue is Green Computing.  I’m really looking forward to this issue, especially given all the work that is happening in this space, especially some of the advances in infrastructure architecture.   

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Why Architects should care about Robots…

Today, Marc Mercuri, an architect in my team, launched one of the most exciting things I’ve seen for sometime:  RoboChamps

image

RoboChamps is an online, virtual robotics competition that makes use of Microsoft Robotics Developer Studio 2008 and Microsoft Visual Studio 2008.  The concept of the competition is to program a series of robots to complete a number of challenges, which include a maze, the surface of Mars, and an urban environment – all of which set in a virtual environment so that you don’t need specialized robotics hardware.  When you’ve completed the challenge, you can upload your solution to the RoboChamps site – and the winners of the leagues will face a showdown at PDC in October.

So, I can hear the question now – "Sounds good, but why should architects care about robots?"   On the surface, it’s difficult to make the connection, but I would encourage you to dig deeper into some of the components included with MRDS 2008, namely the Concurrency and Coordination Runtime (CCR) and the Decentralized Software Services (DSS).  CCR provides multicore, concurrent programming support for the .NET Framework, and DSS enables you to take these concurrent components and offer them as lightweight services in a decentralized environment.  If you have chance to download the MRDS examples you’ll see how they make use of both technologies.

The answer to the question therefore is how we can make use of these technologies and new concepts in software architecture – how can we use CCR to distribute workload across multiple cores, and what is possible with DSS across services on multiple machines?  I believe that these new tools will ultimately lead to several new patterns, especially in front end web farm scenarios.  In the meantime however, I look forward to seeing if you can get your robot out of that maze :)

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Do Not Disturb!

Like many people, I have VOIP at home – my current provider is Vonage.  One of the features of Vonage is an international virtual number.  This gives me a local number in the UK that my family can dial, which automatically redirects to my home number here in the US.  It’s relatively cheap ($4.99 per month) and makes it really easy for friends and family to get in contact.

One of the disadvantages of having an international virtual number however is that people can accidentally dial the number – and when they do, because of the time difference (8 hours between PST and GMT) it can be a somewhat inconvenient.  Let’s just say that we’ve had about 3 or 4 wrong numbers this week, all of which have been about 2am in the morning.  Not so good if you like sleep. 

Vonage has a feature called “Do Not Disturb”, which redirects all calls to voicemail – and which can be activated via their web page.  As simple as this sounds, I can be forgetful at times, so enabling this before going to bed (and disabling when I get up) can be an issue.  To overcome this I decided to put on my “web application test” hat and see if I could use Visual Studio 2008 to write an automated web test that logs into the Vonage site, and activates / deactivates this feature for me.  First, I created a new test project in VS2008, added a new test project and a new web test (from the test menu).  I recorded the action to enable the do not disturb feature:

image

I was able to strip down the required pages to just three requests (one to login, one to query for the phone number, and one to set the feature) and made sure that it worked within the IDE.  I then duplicated this test to create a second that re-enabled the feature.  (I’m sure there is a nice way of passing parameters to webtests, but just haven’t worked it out yet).  The test works as follows:

The first request is a HTTP POST that submits my Vonage username and password to the site.

<Request Method=”POST” Version=”1.1″ Url=”https://secure.vonage.com/vonage-web/public/login.htm” ThinkTime=”6″ Timeout=”300″ ParseDependentRequests=”True” FollowRedirects=”True” RecordResult=”True” Cache=”False” ResponseTimeGoal=”0″ Encoding=”Windows-1252″ ExpectedHttpStatusCode=”0″ ExpectedResponseUrl=”https://secure.vonage.com/vonage-web/dashboard/index.htm”>
  <FormPostHttpBody>
    <FormPostParameter Name=”countryURLs” Value=”http://www.vonage.com” RecordedValue=”http://www.vonage.com” CorrelationBinding=”" UrlEncode=”True” />
    <FormPostParameter Name=”username” Value=”USERNAME” RecordedValue=”USERNAME” CorrelationBinding=”" UrlEncode=”True” />
    <FormPostParameter Name=”password” Value=”PASSWORD” RecordedValue=”PASSWORD” CorrelationBinding=”" UrlEncode=”True” />
    <FormPostParameter Name=”submit.x” Value=”30″ RecordedValue=”30″ CorrelationBinding=”" UrlEncode=”True” />
    <FormPostParameter Name=”submit.y” Value=”13″ RecordedValue=”13″ CorrelationBinding=”" UrlEncode=”True” />
  </FormPostHttpBody>
</Request>

The second request (this time a HTTP GET) brings up the do not disturb features page.  This is required to obtain the phone number as a FORM parameter that we use in the next request:

<Request Method=”GET” Version=”1.1″ Url=”https://secure.vonage.com/vonage-web/features/DoNotDisturb/edit.htm” ThinkTime=”4″ Timeout=”300″ ParseDependentRequests=”True” FollowRedirects=”True” RecordResult=”True” Cache=”False” ResponseTimeGoal=”0″ Encoding=”iso-8859-1″ ExpectedHttpStatusCode=”0″ ExpectedResponseUrl=”">
  <ExtractionRules>
    <ExtractionRule Classname=”Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractHiddenFields, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” VariableName=”1″ DisplayName=”Extract Hidden Fields” Description=”Extract all hidden fields from the response and place them into the test context.”>
      <RuleParameters>
        <RuleParameter Name=”Required” Value=”True” />
        <RuleParameter Name=”HtmlDecode” Value=”True” />
      </RuleParameters>
    </ExtractionRule>
  </ExtractionRules>
  <CorrelationExtractionRules>
    <ExtractionRule Classname=”Microsoft.VisualStudio.TestTools.WebTesting.Rules.ExtractFormField, Microsoft.VisualStudio.QualityTools.WebTestFramework, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a” VariableName=”FormPostParam1.on” DisplayName=”" Description=”">
      <RuleParameters>
        <RuleParameter Name=”Name” Value=”on” />
        <RuleParameter Name=”HtmlDecode” Value=”True” />
        <RuleParameter Name=”Required” Value=”False” />
      </RuleParameters>
    </ExtractionRule>
  </CorrelationExtractionRules>
  <QueryStringParameters>
    <QueryStringParameter Name=”did” Value=”PHONENUM” RecordedValue=”PHONENUM” CorrelationBinding=”" UrlEncode=”False” UseToGroupResults=”False” />
    <QueryStringParameter Name=”dndButton” Value=”Configure” RecordedValue=”Configure” CorrelationBinding=”" UrlEncode=”False” UseToGroupResults=”False” />
  </QueryStringParameters>
</Request>

The third request is a HTTP POST that sets the Do Not Disturb feature on or off depending on the value of the “on” parameter:

<Request Method=”POST” Version=”1.1″ Url=”https://secure.vonage.com/vonage-web/features/DoNotDisturb/edit.htm” ThinkTime=”0″ Timeout=”300″ ParseDependentRequests=”True” FollowRedirects=”True” RecordResult=”True” Cache=”False” ResponseTimeGoal=”0″ Encoding=”iso-8859-1″ ExpectedHttpStatusCode=”0″ ExpectedResponseUrl=https://secure.vonage.com/vonage-web/features/DoNotDisturb/edit.htm?did=PHONENUM&amp;success=true&amp;settings=com.vonage.service.feature.DndSettingsDTO+%7BphoneNumber%3DPHONENUM%2C+isOn%3Dtrue%7D>
  <FormPostHttpBody>
    <FormPostParameter Name=”on” Value=”True” RecordedValue=”true” CorrelationBinding=”{{FormPostParam1.on}}” UrlEncode=”True” />
    <FormPostParameter Name=”phoneNumber” Value=”{{$HIDDEN1.phoneNumber}}” RecordedValue=”PHONENUM” CorrelationBinding=”" UrlEncode=”True” />
  </FormPostHttpBody>
</Request>

After the tests were complete, I put together two batch files (DNDOn.bat and DNDOff.bat) that c
all the webtests from the command line.  Using MSTest.exe, it’s possible to run webtests from outside the IDE:

set VSINSTALLDIR=C:Program FilesMicrosoft Visual Studio 9.0
“%VSINSTALLDIR%Common7IDEMSTest.exe” /noresults /testcontainer:bindebugDNDOn.webtest

Once the batch files were working, I simply added a new scheduled tasks (in Vista, type “Task Scheduler” from the start menu to reach this) to run the DNDOn.bat file at 10pm at night, and DNDOff.bat at 7am in the morning. 

image 

(btw, this is the first time I’ve really used the new task scheduler in Vista.  Two things surprised me:  1.  How easy it was to create a new task that ran the first time (I have too many nightmares creating Backup batch files on NT4!).   2.  How many tasks there are enabled in Vista – I need to spend some time figuring out what these do!)

…and that was it!  A quick solution that I can deploy to my new home server that will avoid more unwanted wrong number phone calls in the middle of the night.

If you want to check it out, you can find my test file here.  You’ll of course need to replace USERNAME, PASSWORD, and PHONENUM (10 digits, remember to include the 1) with your specific values for your account. 

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Hierarchical View Carousel Source Code Released

Good news from Karsten’s blog.  The source code for the hierarchical view carousel has been released.  I played around with this WPF code a couple of years ago and found it very useful for displaying navigable, hierarchical sets of data.

image 

As Karsten mentions, the code is based on an older drop of the framework, and is pretty crusty (his quote, not mine!) but might be worth checking out regardless.

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Introducing the Architecture Journal Reader

With 13 issues and over 60,000 subscribers, you are probably already familiar with the printed and PDF versions of the Microsoft Architecture Journal.

At the Strategic Architect Forum (SAF) last week we released a new way of reading the Journal:  The Architecture Journal Reader.  Based on WPF (Windows Presentation Foundation) and the upcoming NewsReader SDK, the Architecture Journal Reader delivers an offline, immersive, and searchable reading experience for all issues of the Journal, available in 4 languages.  The Architecture Journal Reader automatically synchronizes with new content as it’s released, enables annotations, includes a reading list of favorite articles, and even supports feedback on articles through a set of online forums.

You can install the beta version from here today!  Please let us know what you think!

image

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Choosing the Right Platform for User Experience

Rich Application or Web Application?  ASP.NET or Sharepoint?  Regular ASPX controls or AJAX?

In sessions at conferences (most recently TechEd in Barcelona), I’ve been discussing the many choices that architects and developers face every day, especially when it comes to user experience.  To help get across the point, I put together a tool that helps you think about platform selection, called UXIQ.  It’s a small WPF app with a set of slider controls that you can set various criteria for user experience, and in turn be presented with recommendations for the technology or platform that is the closest fit.

The decision criteria in the tool is as follows:

Persona – Location of the user, how mobile the user is, whether the user can be trained, and how personalized the experience should be.

Application – The connectivity requirements for the application, the look and feel of the application, graphics needs, and interaction requirements.

Environment – If installation is possible on the local device/machine, integration with other software, integration with other hardware, and developer knowledge.

The tool matches this criteria to a set of data (stored in an XML file) and presents the closest three technologies that match.  You can then hover over the options to see how far off they are, and also see some more information/links about the technology.  Do remember that the values represented in this tool are my opinion, based on my personal experience – if you want change the values or add/remove technologies, feel free to edit the XML data file as appropriate. 

You can find the tool here – to run, you’ll require .NET 3.5 runtime which can be downloaded here.  If you are interested how the tool works, the source code for the application can be found here.

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Different Perspectives on GTD

What I love about GTD (Getting Things Done) is that everyone has their own take on what works for them.  I often find myself refactoring my own GTD system every month or so with minor tweaks that make things a little more efficient.

Josh Fialkoff has a nice post on different methodologies and tools other GTDers use.  He says that my approach of having an Outlook category that is both a context and a project assigned to a single task is a little confusing, but hey, it’s a system that’s worked for me for some time now.  It does cause some duplication if you look at your task list holistically, but I find it useful to be able to skew either based on context (I’m at home, what can I do?) or project (I need to get moving on Project X, what’s next?).  Moral of the post?  If you are using GTD, look at other people to see how they work, but ultimately the system you create will be the best for you. 

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

User Interface (UI) vs. User Experience (UX)

I often get asked the difference between User Interface (UI) and User Experience (UX). Although the original intent and definition of UI started out in the right direction, too many times I’ve heard it used to explain just the visual aspects (or cool factor) of an interface.  To give you a non-technology related example, let me show you the hotel room that I recently stayed at in Dublin.  The hotel is one of the more boutique, modern style ones that we see in large cities (imagine Morcheeba playing in the lobby, contrasting black and white furniture etc. – you get the idea).

As I got to my room late at night, I of course wanted to switch on the lights.  In front of me (in semi-darkness) I found the panel for the lights:

image

As you can see, on first glance, a relatively nice looking “interface” (stainless steel finish, clean, elegant etc.).  The experience however was a different story.  Firstly, there is no indication of what each switch does.  After playing around for a minute, I was able to work out that the left dial is for the main lights, the right dial is for the bathroom lights, the main switch seems to be like a master switch for both.  Seems simple enough, however you can also push the dials to turn them on/off individually, with no feedback or indication of what state they are in.  To add more confusion, there is a 3 second delay after pushing the dial before the lights come on.  Of course, what happens is the following:  Hit the master switch – nothing happens.  Turn the dial – nothing happens.  Push the dial, nothing happens.  Push the dial again (within 3 seconds of pushing the dial last time).  Nothing happens.  Hit the master switch again – nothing happens.  Sigh.  Repeat.

Once I did get the lights working in the bathroom, I came across the following sink:

image

Again, very nice looking – a modern, open design with elegant lines and faucets.   Question for you: How do I release the water in the bowl?  Looking around the basin, there is no stopper for the plug, no chain, no indication of how to release the plug.  Also, notice how the plug is flat to the surface of the bowl – there is no affordance indicating that it might be possible to push or pull the plug in any way to release the water.  The answer?

image

Ah, of course – who wouldn’t have thought about tipping the plug 45′ to the left and having it swivel in the middle?  Sigh (again).  Having been humiliated with the sink, I thought I would take a shower instead.  I was greeted with this shower head. 

image

Again, the pencil design looks very elegant, and unique – but just try moving the direction of the shower head when the water is running.  Impossible.  Because of the slim design and texture, you can’t redirect the shower head in any direction (which can be annoying if it’s aiming toward the door as you get in).  Also, the design results in a powerful, but very directed spray of water – certainly refreshing, but not as comfortable as you may like.

The difference between ”cool looking UI” and UX?  You could argue that the items in the hotel room look as if they have a great design, but ultimately result in a poor user experience. I like unique designs – but don’t let this come at the expense of a frustrating experience.  I just hope we don’t see the same thing with new UI technologies.  There are a lot of new UI advances that can create unique looking interfaces, but without an understanding of true user experience, it’s going to be as bad as my hotel room…

  • Facebook
  • Twitter
  • Delicious
  • LinkedIn
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS