Saturday, June 14, 2008

Demystifying the n-Tier Architecture (Part 2)

As you begin to develop your applications, hopefully you start with a design.   The reason I say hopefully, is because many programmers think that a design is a waste of time, rather just a point of documentation.   In reality, design is a vetting of the idea prior to laying the application or enhancement's foundation.

Image what would happen if the carpenters started nailing boards together before an Architect designed the house.  Would design or idea look like the as-built version? I am highly skeptical that they would.  Well, the same thing occurs when a programmer starts writing code before a design has been created.

Once the design is completed and there is a clear understanding of what is being done within the application synchronously, asynchronously, where the transaction boundaries are, and other non-functional requirements like response-time, up-time, among many others.

Now we are ready to start discussion of the Tiers.

Tier 1.  Presentation and UI

Presentation layer can take on many forms.   XML, HTML, PDF, Word, Silverlight, WPF, Windows Forms, Crystal Reports, Microsoft Reporting Services, are just some of the examples of the presentation layer.   Although it is an obvious portion of the application it is an important aspect that still needs an honorable mention.

Rules of implementing a good UI layer:

  • Should not bind to database statement directly - rather use business and data objects to shuttle the data between the UI and the database.
  • Should not implement any business rules - One of the hardest point for a developer to grasp, what is a business rule anyway? Well, the business rule is something that runs the logic that is specific to your line of business that ensures data integrity.  The motions of the UI (hiding and showing controls) are likely not considered a business rule.
  • Instant feedback to user - once a user action is taken the user is assured that "we are working on what you have just asked".  The "whiteout" effect of paused UI while stored procedure is running should be a thing of the past.
  • Validation - As much of the validation as possible should be done a the UI level.
  • Know Your User - Appropriate views - Often the application developers create functionality just because it is cool, it is important to understand your customer/user.  Cluttered display of information is just as bad as lack of information.

In the world where most things services have been made a simple commodity, it is the presentation and the personal touch that will create a point of "differentiation" for your organization.  Once that happens, everyone wins.  Your company grows market share, you get promoted, get a bonus.  Believe me, it is a win worth the time...

In the next part of the series we will attack the "Business Objects"


"Inspire, Imagine, Innovate"

Wednesday, May 28, 2008

Demystifying the n-Tier Architecture(Part 1)


When it comes to good application design, separating the business logic from the UI is essential. It is true, splitting your tiers makes your application more testable, maintainable, and extensible.

A number of developers have come up to me to ask how to pass Entities (as in the Entities Framework) over web services, I began realizing that there are common misconceptions on what nTier ***really *** means for .NET applications and services...

This post is a part of a series that I am putting together to make Architects and developers understands the choices they make while realizing their designs.

The issue can be boiled down to misunderstanding the terminology of ported over from the Visual Basic 6 days and the good ol' days of ActiveX and DCOM where we have logical and physical definitions began to blur.

In the old days of Visual Basic 6 when we talked about good architecture, we considered packaging classes in a class lib, abstracting, and separating the UI from the business logic to be the good thing (and it sure was).   Inadvertently we have created a ActiveX library when all we wanted was to create a reusable components that could be separate but still part of the project, we now call them namespaces. The thing that made maters confusing is the fact that we could now take the same ActiveX and register it as a DCOM component, blurring the difference between between the logical design model and the physical deployment.

Unlike with the classics, ASP and VB6,  .NET brought the power back to the developers who are now able to virtually anything, anywhere in the code.  Which turned out to be good and bad (depending if you are wiring code, or fixing someone else's bugs).   Strongly-Typed DataSets, namespaces and assemblies, and a variety of options to from Web Services, to Remoting,  to EnterpriseServices became available to developers to realize their designs.  Understandably there is confusion.

There is a fundamental difference between the logical design, service orientation and physical deployment.

In the next few posts I will attempt to demystify what are the patterns that will benefit your application

Wednesday, May 14, 2008

Integrated Healthcare - Real Life

Many people tout the notion of integrated health care.   It is until you are faced with the challenges of taking care of those around you do you realize the benefits.

I had an unfortunate incident with my child take me all the way to Children's Hospital of Philadelphia (CHOP).  As a #1 Children's hospital in nation it is what a hospital should be.  A state of the art facility, where technology enables staff to do one thing, care for its patients.

As we were going through the motions of assessing the state of things in the ER, I began noticing how all of the systems were seamlessly working together,  the monitors, alarms, medications, X-ray machine, EMR, were humming together in unison.

Later as we moved to a patient room, it was clear that everyone WAS on the same page.   Doctors, nurses and other staff carried handheld devices that told them where they needed to be at any point in time by the "super computer" decision support system.

There we were in a state of being fully informed, content and calm.  We were visited by physicians, nurses, and other assistants that told us how things were, what is to come...  

If you think about it, not only this experience has made me a true believer that this was actually possible... I am sure that this experience is also saving CHOP considerable amount of money.  

The experience of being connected is not unique to just healthcare,  financial industry, homeland security, manufacturing and other industries may want to learn from what CHOP did to provide a fully integrated customer experience.

Thank you CHOP, for the service, the care, the experience.

Tuesday, April 1, 2008

Microsoft buys SpringSource - Or did it?

InfoQ article  reported that Microsoft is buying SpringSource for the sum of $1B.

Although there are sure to be mixed feeling about this in both the .NET and Java communities,  here are a few items of note to pay attention to when reading (or re-reading) the article and watching or(re-watching) the video:

  • Microsoft has made  a large investment into its own version of MVC framework, as well as development of Routing API.  Both items are equivalents of Spring MVC and Sptring WebFlow.
  • Article mentions that every windows install will be Spring Beans enabled.  Although Spring is a nice framework, there is little reason to install Spring Beans framework on every desktop.
  • Next version of Windows called SpringHorn".  No need to explain anything here, doubt that name would be approved by any marketing guys. (unless SpringSource buys Microsoft)

Knowledge is power.  If you take a careful look at the MIX 08 and other information being delivered as part of ASP.NET site, you will notice that this feels and sounds like a very clever April fools joke.

Although I have to say, weirder things have happened before (like Time Warner buying AOL)


Happy April!

Sunday, March 30, 2008

AJAX vs RIA's and Flash vs. Silverlight

In a question from the audience, I was asked to describe the differences between various technologies AJAX, Flex and Silverlight.

To start, AJAX is not a new concept, some of the elements such as the XML HTTP were available in very early versions of browsers.  That said, you needed quite a bit of skill to and effort to implement.  Specification and creation of JSON and WSDL have helped to mature this technology and actually make it not "rocket" science to implement.


Comparing these is quite difficult and full of debates, but here are a few items of note:


  • does not require any browser side plug-ins to work
  • Cross browser capable
  • Server-platform neutral
  • ASP.NET provides a fully integrated developer experience
  • provides enhanced user experience.


  • cross browser behavior is complex, new features and browser caps change with every version.
  • very limited local storage (using cookie only)
  • no pixel level support
  • other IDE behaviors is not
  • Limited mobile support

RIA Pros

  • Rich and sophisticated user interface possibilities
  • local and disconnected state
  • network API (other than HTTP)
  • Extensive development environment and debugging

RIA Cons

  • rich graphics still require work from designers
  • requires an browser plug-in
  • Network download is sometimes large

With all things considered, there are pros and cons how each technology can applied. As such, it is important to understand the business requirement and strategy when making these choices.

I my humble opinion, RIA represents the next evolutionary step of user interfaces for the web, mobile and other alternative user interface technologies to desktop.

Flex/Flash vs Silverlight  or RIA's

Flex and Silverlight are a new generation of technologies that we have began to commonly refer to as Rich Internet Applications or RIA technologies. 

Today there are a few choices when you develop RIA applications.  You can use Flex to develop Flash based RIA's, or Visual Studio 2008 can be used to develop Silverlight applications.

In an effort to not say what have already been said, a few months ago as I was doing some evening reading, I have stumbled upon a very interesting (although lengthy post) which compares the two technologies.

This is a fantastic post, in part because it provides great detail regarding both technologies but also because it is being responded to by evangelists from from Adobe Flex team and Microsoft Silverlight.  The initial question as you can see came from a regular developer, but the conversation quickly turned technical and non-hostile from both specialists covering the technology.

An absolute great read....

I am a huge proponent of app lifecycle, developer capability and platform maturity.  That said, when you compare technologies to be used on the project, you need to take into consideration how many times will the developer be switching between IDE's to accomplish a maintenance task.

Switching between different applications for the development causes a shift in context and a loss of focus... which ultimately translates into loss of productivity.  Usage of multiple development environments also causes fragmentation in the upgrade and maintenance cycles.

Microsoft has the made the winning decision here by allowing the developer to concentrate on a single IDE with a single technology (.NET) that can be used both in the client and on the server.  This is not the case for Flash/Flex combo.


I3 =  Inspire, Innovate, Implement.

Tuesday, March 18, 2008

SQL Server Data Services (SSDS) - a powerful proposition...

As most of the attendees would agree, I can honestly say, information presented at MIX08 was very powerful.  From the announcements, to keynotes, to sessions it is really tough to say what created a more powerful message.

Many blogs have written about the nice bits announced at the MIX such as IE8, Silverlight Mobile, Silverlight 2.0 Beta, among others.   The session that was not given high level of attention, the SQL Data Services sent a really powerful message.

"WHY?" you ask, I look at the world as an architects' buffet.  Choices are about, from Sliverlight and Flex, WinForms or ASP.NET, OBA vs VBA.  The point is, anywhere you look you have choices that really make up the alphabet soup we call Application Architecture.  

So reason with me for a moment, lets say that you are choosing your next best platform for your business. You are inevitably faced not only with technical choices, but also with realities of the business (otherwise known as time-to-market and financial constraints) that cause you to make hard and careful decisions.  The business exec tells you that he is forecasting organic growth and adoption, but can't really pin-point how much or even how fast.

As a person of reason (which most Architects are), that kind of problem would make you think "Lots of hardware, fully distributed, redundancy in all places".  While that kind of quick thinking works for web and app servers, database scalability and management created a larger and more complex set of problems. So there you are arguing that you need $200K in hardware and infrastructure prior to making even a single dollar of sales revenue.   Interesting to note that many business execs have a hard time parting with their money prior to some assurance that what you are delivering will work and scale to their SLAs.

(Note: if $200K does not strike you as much, make it $2M to make it a better point)

Here comes the SQL Server Data Services....

Architects, as do business managers like to play out the what-ifs.  There are a number of "what ifs" examples, lets take a look at a few:

  • What if you could decide how and when to start hosting your own infrastructure?
  • What if you could decide to save your money and not hire a DBA, or get a SQL license, or worry about backup and redundancy?
  • What if you needed the kind of capacity that is nearly impossible to provide for a fixed budget as it is not getting used all year long (think seasonal load, Shopping trending in Dec, or Tax Jan-Apr)
  • What if you could bet on a platform that removes the risk of paying up front just in case it does not pan out?
  • What if you wanted to have your data geographically co-located for faster access?

These are just some of the ideas that are going to be possible with the SQL Server Data Services.

Microsoft has long been a leader in redefining what the “ultimate development experience” is.  This has been proven again, and again, and again (this time with with VS 2008). 

There has not been as much fanfare on the Data side of the isle since the introduction of Strongly Typed DataSet, but technologies such LINQ, ADO Entities and SSDS are set to redefine how developers interact with data.

From my perspective, we are at the dawn of next generation of architectures that will bring incredible possibilities and limitless potential. 

This will truly revolutionize how developers perceive data connectivity and availability, how applications work with data, and how end users will be empowered by the new breed possibilities.

Saturday, February 23, 2008

ASP.NET Dynamic Data

Back in May 2006 Microsoft introduced a pretty cool sample application called BLINQ.  As the sample description mentions:

"Just point Blinq at a SQL database and it will create a web site with pages that display sorted and paged data, allow you to update or delete records, create new records, and follow relationships between tables in your database".

Over the months that followed and I know that many have waited to see where this sample application and technology will go.  Months became years, but what can I say, the wait was well worth it.

Recently the ASP.NET team introduced a very cool technology called ASP.NET Dynamic Data, the concept that most of applications are simple CRUD applications is key to understanding the enormous benefits of  this ASP.NET 3.5 Extension. 

Developers creating applications using ASP.NET should take a very serious look at this technology as it will save them countless development hours.


Remember, the line you did NOT write does not contain a potential bug.