<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Patterns for Great Architecture</title><subtitle type="html">Hi!</subtitle><id>http://blogs.msdn.com/rahul/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/rahul/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2007-03-27T20:20:00Z</updated><entry><title>Why Task Based Programming (Parallel Extensions)</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2009/10/14/why-task-based-programming-parallel-extensions.aspx" /><id>http://blogs.msdn.com/rahul/archive/2009/10/14/why-task-based-programming-parallel-extensions.aspx</id><published>2009-10-14T21:06:37Z</published><updated>2009-10-14T21:06:37Z</updated><content type="html">&lt;p&gt;Hi,&lt;/p&gt;  &lt;p&gt;Today is October 15th 2009 and I am writing this post to express my understanding about parallel programming using Parallel Extensions (or Task based parallel programming); specifically to express why should we go for this approach.&lt;/p&gt;  &lt;p&gt;Since the Parallel Extension announcement, I was excited to get my hands dirty with it but after working with Parallel Extensions, I had few initial questions that I thought everyone would have and there is less content available online that targets against benefits of Parallel extensions. Below are a couple of questions that I am targeting in this post.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Is Threading going to die? Are Parallel Extensions replacements to Threading?&lt;/li&gt;    &lt;li&gt;Sometimes Threading gives me better performance than Task based programming. Why?&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Before we come to these questions, it would be worth understanding options other than parallel extensions that we used to follow for parallel programming. Before Parallel Extensions, we would use primarily any of the below two modes for parallel programming:&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Directly Creating Threads:&lt;/strong&gt;    &lt;br /&gt;Here we create Threads directly in our code something similar to the following code:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Thread t = new Thread(DoSomeWorkMethod);       &lt;br /&gt;t.Start(someInputValue);&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Benefits:     &lt;br /&gt;&lt;/strong&gt;The benefit of this approach is that each of the thread will run at all times. .NET Framework’s scheduling algorithm will make sure that all the threads that we created will execute in similar to RoundRobin algorithm (though actual algorithm is different). This approach is especially useful in cases where I want to provide justice to all threads.     &lt;br /&gt;Another benefit associated with this approach is the fact that we have control over these created threads like aborting a thread in the middle.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Drawbacks:     &lt;br /&gt;&lt;/strong&gt;The drawback of this approach comes into picture when we have more threads than the available CPUs (cores). As an example, if we have two cores and I am running 10 threads, context switching, invalidation of each thread’s cache etc. So we need to keep a balance between how many CPUs we have and how many Threads should we create for optimum performance.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Using Thread Pool:     &lt;br /&gt;&lt;/strong&gt;.NET Framework has a thread pool (configurable) which limits the number of Threads that can be run at a time. Now when we want to execute something in a separate thread, we simply queue our work on a thread of thread pool instead of creating our own separate thread. Code looks something similar to below:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;ThreadPool.QueueUserWorkItem(       &lt;br /&gt; DoSomeWorkMethod, someInputValue);&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Benefits:     &lt;br /&gt;&lt;/strong&gt;Thread Pool size for .NET Framework can be set by doing a simple calculation using number of CPUs the machine has. After this, Thread Pool makes sure to run only those number of threads that are optimal for a particular machine. This prevents any context switching and other overheads. So we get best performance.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Drawbacks:&lt;/strong&gt;    &lt;br /&gt;The drawback of this approach is that developer doesn’t have much control over the Queued tasks over Thread Pool. In other words, once we have queued a work item, we do not get a reference to it and there is no explicit support for knowing when it completed, or for blocking until it completes or for cancelling it, or for identifying it in the debugger via some sort of ID etc. Plus, you are not guaranteed when your Task will start to run, so progress is unknown.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Using Parallel Extensions:&lt;/strong&gt;    &lt;br /&gt;This approach is the one that we are here to discuss. Task based programming combines the benefit of both the approaches with some new additions. Using task Based programming, you create Tasks instead of Threads and start executing them. Programmatically they are almost identical to Thread Based programming with additions features. Here is a code snippet that uses the new Task class: &lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;Task t = Task.Create(DoSomeWorkMethod,       &lt;br /&gt; someInputValue);&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;strong&gt;Benefits:&lt;/strong&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;With Task Based programming, by default, you can be sure that we are not actually decreasing the performance by doing excessive multitasking since Task Manager (central class in Parallel Extensions) takes care of this issue by queuing any additional tasks if all the existing CPUs are busy.&lt;/li&gt;    &lt;li&gt;With Task based programming you have complete control over the Task. You can pause, abort, wait, join etc. &lt;/li&gt;    &lt;li&gt;The scheduling algorithm is improved over Thread Pool approach with new features like “Task Stealing”.&lt;/li&gt;    &lt;li&gt;You get additional constructs to easily work with, like Parallel LINQ, Parallel For Loop etc.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;strong&gt;Drawbacks:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Personally I see the only drawback is that you are not guaranteed when the Task will execute. So if you want to guarantee of starting your Task execution as soon as it is created, use plain old Threading Way. UI multitasking as an example should be done with Threading and not Thread Pool or Task based programming.&lt;/p&gt;  &lt;p&gt;I will also share one interesting incident that happened while I was developing a Proof Of Concept. I was running the samples on a 4 Core Machines and created 2 Threads to do a Task and then 2 Tasks to do the same task and I could not see any improvement. Then I realized that if I am creating Threads which are less in number than available free CPUs I might actually get some greater performance sometimes, but that is not a guarantee. With task based programming, I can guarantee that either all my Tasks are running in parallel or all CPUs are busy executing my tasks.&lt;/p&gt;  &lt;p&gt;I will try to cover benefits approach in future posts but for now, it is done.&lt;/p&gt;  &lt;p&gt;I hope this post was useful. If you are a Microsoft Partner, please feel free to involve our team for all your development consultation needs by contacting us &lt;a href="http://blogs.msdn.com/rahul/contact.aspx"&gt;here.&lt;/a&gt; Comments, corrections; I Love them.&lt;/p&gt;  &lt;p&gt;Rahul Gangwar&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9907320" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author></entry><entry><title>Microsoft Codename "Gemini"</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2009/07/28/microsoft-codename-gemini.aspx" /><id>http://blogs.msdn.com/rahul/archive/2009/07/28/microsoft-codename-gemini.aspx</id><published>2009-07-28T19:47:25Z</published><updated>2009-07-28T19:47:25Z</updated><content type="html">&lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Hi,&lt;/p&gt; &lt;p&gt;Today is July 28th 2009 and I am writing this small post to share my understanding on Gemini and Business Intelligence arena and specifically around Analysis Service.&lt;/p&gt; &lt;p&gt;Talk about data in Microsoft and the very first thing that comes in mind is SQL Server. Microsoft hardly released SQL 2008 and we are looking forward for next version of SQL Server. That is very ambitious.&lt;/p&gt; &lt;p&gt;When it comes to Business Intelligence problem, things like Reporting, Analysis, data-mining come automatically forms part of the solution. But there are few patterns that should be considered for developing an efficient BI solution. Before talking about Analysis Service, let's understand how operations are different in OLTP vs OLAP databases. &lt;/p&gt; &lt;p&gt;In OLTP databases, data is written in form of rows (relational databases). So for example, if I want to store two records of two column structure having (name and email as columns) the storage will go in a fashion:&lt;br&gt;"Rahul" "&lt;a href="mailto:rahul@contoso.com"&gt;rahul@contoso.com&lt;/a&gt;", "Sabiha" "&lt;a href="mailto:sabiha@contoso.com"&gt;sabiha@contoso.com&lt;/a&gt;".&lt;br&gt;Eeffectively, data is written over disk one row at a time. This makes typical OLTP transactions efficient&amp;nbsp; since I can quickly read/write a all columns of ONE record somewhere in middle of 50 million rows. But when it comes to reading ALL records (let's say email of all 50 Million records), relational databases fail miserably in terms of performance.&lt;/p&gt; &lt;p&gt;In OLAP databases, data is stored in a different fashion. It is stored in the form of columns rather that rows. So if I want to store the same set of records in columnar fashion, it would be stored this ways:&lt;br&gt;"Rahul" "Sabiha", "&lt;a href="mailto:rahul@contoso.com"&gt;rahul@contoso.com&lt;/a&gt;" "&lt;a href="mailto:sabiha@contoso.com"&gt;sabiha@contoso.com&lt;/a&gt;".&lt;br&gt;The benefit and drawbacks are here. &lt;br&gt;If I want to read columns of ONE record somewhere in middle of 50 million rows, it will fail miserably in comparison to relational databases. But when it comes to reading a column of ALL records, this will be surprisingly fast (and this requirement is very common in Analysis: to read large number of records rather than one record).&lt;br&gt;&lt;br&gt;So one thing is clear that columnar databases are better than relational databases for data analysis.&lt;/p&gt; &lt;p&gt;Another thing that need to be considered while designing analysis solution is the storage medium. Databases that use disk as the storage medium will perform very slow for performing analysis algorithms than the databases that use in memory medium as storage. Storing data in memory is fast because of the medium speed as well as saving CPU cycles. Although the durability property of ACID is lost in this process (since memory is volatile) but this still holds a good candidate for analysis solutions.&amp;nbsp; Even hybrid storage mechanisms can be considered depending on the requirement scenario.&lt;br&gt;&lt;br&gt;Now comes Microsoft's project codename "Gemini". Gemini is next version of Analysis Service based on the concepts of using columnar database and in memory storage, making analysis of data hell fast. Gemini will be shipped in the next version of SQL Server (2008 R2/Kilimanjaro).&lt;br&gt;The good thing is that Excel users can use its capability by installing a plug-in. Hence the term "self service analysis". Every user in an organization will be able to analyse data and take decisions using simple Excel. More here:&lt;br&gt;&lt;a title="http://www.microsoft.com/presspass/press/2008/oct08/10-06BI08PR.mspx" href="http://www.microsoft.com/presspass/press/2008/oct08/10-06BI08PR.mspx"&gt;http://www.microsoft.com/presspass/press/2008/oct08/10-06BI08PR.mspx&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;I hope this gives a peek about what Gemini is and how it will work.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/rahul/contact.aspx"&gt;Comments/feedbacks&lt;/a&gt; welcome.&lt;/p&gt; &lt;p&gt;&lt;a href="http://blogs.msdn.com/rahul/contact.aspx"&gt;Rahul Gangwar&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9851149" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author></entry><entry><title>Physics Based Games in Silverlight</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2008/09/29/physics-based-games-in-silverlight.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="1433" href="http://blogs.msdn.com/rahul/attachment/8969669.ashx" /><id>http://blogs.msdn.com/rahul/archive/2008/09/29/physics-based-games-in-silverlight.aspx</id><published>2008-09-30T04:00:00Z</published><updated>2008-09-30T04:00:00Z</updated><content type="html">&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Today is September 29 - 2008 and I am writing this short post (though big, but short for writing anything over Farseer/SL) to give an idea about one of the immense possibilities with Silverlight - Game Development. I will focus on simplicity to target the beginners and specifically cover possibilities with &lt;A href="http://www.codeplex.com/FarseerPhysics" target=_blank mce_href="http://www.codeplex.com/FarseerPhysics"&gt;&lt;U&gt;Farseer Engine&lt;/U&gt;&lt;/A&gt;. The Farseer Physics Engine is an easy to use 2D physics engine designed for Microsoft’s &lt;B&gt;XNA&lt;/B&gt; and &lt;B&gt;Silverlight&lt;/B&gt; platforms. &lt;/P&gt;
&lt;P&gt;I do not know why it is named Farseer but possibly because it refers to followers of Eldar; one of the most ancient and advanced races in the universe's history. Their armies usually have the advantages of speed and technology. Possibly &lt;A href="http://www.physicspoweredgames.com/Site/About.aspx" target=_blank mce_href="http://www.physicspoweredgames.com/Site/About.aspx"&gt;Jeff Weber&lt;/A&gt; can tell.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Physics Engine:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;There are several games that simulates their motion like a real world entity. For example, if you have used Windows Live SkyDrive, while uploading a file, you are presented with a screen having a Baal. You can push this ball and it collides with walls, bounces back pretty much the same way as if it was a real ball. The ball has all the properties of a real world - it always feels a gravitational pull downwards, on experiencing a force i would follow a parabolic path similar to a real world ball. Now, no one has written the logic on how a ball should move when hit. such simulation is done by associating certain features to the ball (like mass, friction etc.), rest all is handled by the underlying Physics Engine. Physics based games are more quality games and closer to real world experience and form a different group of games altogether.&lt;/P&gt;
&lt;P&gt;In short statement, any piece of logic that could provide simulation of Newtonian Physics is a physics engine. It doesn't necessarily has to be a game engine, though the most common application is game industry, it is also used in various other fields such as research, advertisements etc. Primarily there are two kinds of Physics Engines - "Real Time" and "High Precision". Both the engines aim to simulate the laws of physics (like friction, moment of inertia, force, gravity (which is again a force) etc.) but since there is less availability of computation over most of the end users machines, "Real Time" engines eat up some of the details and simulate the bare minimum required to provide a real world feeling. On the other hand, "high precision" engines take into account of almost all the factors that exist in our world like air speed etc. and are commonly used in scientific projects like defence, space etc. and are run over high end machines like super computers.&lt;/P&gt;
&lt;P&gt;most of the machines out there depend entirely on CPU alone for most of the computational needs. In areas where high graphics intensive tasks are required, we can install specialized GPU (Graphics Processing Units)- we also know them by common name - graphics card. Similarly, in high end applications which use Physics Engines, we can also install PPU (Physics Processing Unit) for shedding off the load from CPU giving a better performance. &lt;/P&gt;
&lt;P&gt;In case of Farseer, it is not an easy task to write a Physics Engine for browser based scenarios since you have to think 100 times before planning for using resources. Physics based calculations cannot be done easily when the machines are poor. That is the reason why you might find some glitches in terms of performance on the physics games over Silverlight and Farseer will improve continually over time - sometimes to cope up with new releases of Silverlight, at other time to add new demanded features and performance restrictions. Hats off to the people out there who are contributing to the developer community by creating such product. Now I can start my post after paying respect to those great people.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Silverlight as gaming platform:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Games have few components. Let us examine these and see what Silverlight has to offer w.r.t. these requirements.&lt;/P&gt;
&lt;P&gt;1. A nice light and programmable UI - Silverlight supports these features through various concepts like Path, Vector shapes etc. and most importantly, they are based on XAML so you can talk to your graphics during runtime which you might not be able to do with a normal graphics (like jpeg etc.).&lt;/P&gt;
&lt;P&gt;2. A way to provide simulation to the UI elements - Silverlight supports these through various subtle concepts like animations. More importantly, since we can work in C# we can use all the good features and usability of the same. You don't have to learn any new tool/language.&lt;/P&gt;
&lt;P&gt;3. A way to interact with end user in sufficient real time fashion - Silverlight makes this possible through its optimised CLR (called AgCLR; and do you know that CLR of SL is almost same as that of a the .NET Framework). Also adding to the fact that entire processing will be done at client side, we can expect SL based games to be sufficiently real time. And if you don't see it, probably its time to upgrade the machine.&lt;/P&gt;
&lt;P&gt;4. Game Logic - Now don't expect SL to write game logic, otherwise it would have been a Product rather than a Platform. &lt;/P&gt;
&lt;P&gt;5. Game Engine - Game engine is kind of another framework sitting on top of the underlying framework and it exposes functionality to your game to ease the development effort. It is similar to the fact that .NET APIs, provides a framework where we build other applications on top of them. However it has to be noticed that a game engine is not something that is generic. One game engine works only with a particular genere of games. It is similar to the concept of Software Factories which could be applied to a specific kind of applications only. Silverlight doesn't provide any. You have to write your own (if required) or depend on others available engines in market.&lt;/P&gt;
&lt;P&gt;6. Generalized Game Engines - Physics engine is a good candidate to fit in this scenario. These engines help us to add certain features rather acting as a specific game engine. For example, Silverlight doesn't provide any API to simulate Physics, so we have to Physics Engines to add those features to our games/apps. Another example could be 3D rendering engine. Again, Silverlight doesn't support natively any 3D based APIs, so we have to take help of 3D rendering engines like &lt;A href="http://www.codeplex.com/Kit3D" target=_blank mce_href="http://www.codeplex.com/Kit3D"&gt;Kit3D&lt;/A&gt;. By using Kit3D, we can develop 3D games over Silverlight. Combining Kit3D with Farseer could give us 3D, physics based games on Silverlight. Kit3D is my next topic of interest that I will take up.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Exploring Farseer:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I will not go into details of Silverlight/any other details and assume that people reading from here onwards have sufficient knowledge about concepts like Silverlight, Storyboards in Silverlight, C# etc. instead, we will straight away look at some common capabilities of Farseer engine to get started since there are lots of material over SL but very few on Farseer.&lt;/P&gt;
&lt;P&gt;Out of the many capabilities of Farseer, I would explain only few capabilities like, PhysicsSimulator class, movement using "Body" class, Collision using "Geom" class. Apart from this I will also cover on how to achieve a Game Loop using Storyboards (although a &lt;A href="http://silverlightrocks.com/cs/blogs/silverlight_games_101/archive/2008/09/26/a-much-cleaner-game-loop-in-silverlight-2-rc0.aspx" target=_blank mce_href="http://silverlightrocks.com/cs/blogs/silverlight_games_101/archive/2008/09/26/a-much-cleaner-game-loop-in-silverlight-2-rc0.aspx"&gt;better method&lt;/A&gt; exist in RC0 onwards of SL which is using CompositionTarget) and an organized way to Handling Keyboard Inputs. First we will discuss three classes and then we will move towards Logic of how to apply them.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;PhysicsSimulator Class:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;This is the main class that developer calls to apply the Physics he wants to apply. Physics Simulator class does many things but for now I could say that you can use it to specify Gravity to the world. It takes values through which you could specify how much gravity any object should experience in X/Y direction. Let's say we have Gravity of 5000 on Y direction and the scene is to represent a constant air flow in X direction, we can apply 100 units of force in X direction. So that ways whenever you will simulate any object, apart from the forces that you have applied, this gravitation and Air will also be applied. This can be specified in its constructor similar to this: PhysicsSimulator physicsSimulator = new PhysicsSimulator(new Vector2(0, 5000));&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Movement (Body Class):&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Body class is the central class that applies different Physics concepts like Force, torque, etc. It doesn't have any UI. We tie the Body object to a specific XAML object (or sprite) by writing a code which makes changes to different properties of the XAML code based on changes in the Body object. So, for example, if we want to give a physics motion to a rectangle XAML element, we will create a rectangle Body object and write code (lets say a method called Update) whose main job will be to keep the properties of Body object in sync with properties of Rectangle (like Canvas.Left etc.). So the concept is: Farseer world never does any changes directly to XAML (neither body object nor PhysicsSimulator). Physics Simulator only simulates the body object, it is we who make changes to the actual sprite based on the changes that Physics Simulator has done to body. So, Physics simulator will move the Body object according to the laws of physics and our code will merely keep our sprite in sync with Body object. This is important because now we can decide which properties to change based on the changes in Body object and not necessarily tied upon the Farseer Engines default functionality.&lt;/P&gt;
&lt;P&gt;This feature essentially provides a loose coupling between the Engine and application making it reusable in different ways. Jeff could have written logic to change specific properties depending on the type of object in question. But then, we would have problems like:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;It would have been impossible to use Farseer with the newly added classes/objects/third party XAMLs etc. &lt;/LI&gt;
&lt;LI&gt;It would have become more time consuming for Jeff to build Farseer and also the engine could have become more heavy (which is a No Go for SL based applications). there are endless list of problems that could have got associated but thanks to Farseer designers for making it very generic and usable in different scenarios. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;Collision (Geom Class):&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;We enrich a body further by providing it a geometry.&lt;/P&gt;
&lt;P&gt;Collision is achieved through Geom (or Geometry) class. I don't know why Farseer implementers changed its name from Geometry to Geom so I will use this name interchangeably. Geom class is responsible to decide how a body should react when someone comes in its path. There are several factors in Physics which decide the result of collision. Like Friction (if its not a head on collision), Coefficient of Restitution etc. which we can set and then associate it with a Body.&lt;/P&gt;
&lt;P&gt;In its creation process(basically using factory pattern) itself, we can specify the Physics Simulator to be used and the Body on which it has to act. You don't have to write any logic to handle collision. Based on the properties set to the Geometry of a Body, Physics simulator decides what should happen to other bodies 9which should also be controlled by the Physics Simulator) when they collide. The collision result will be calculated automatically. As said earlier, we have to keep our sprite in sync with Body object in the game loop since Body is the central place where Physics Simulator keeps its end result of any computation. We will see this shortly in a code segment. I will try to upload the code as soon as I finish this post but I might get busy so, if someone needs code sample for the explained concepts, please feel free to contact me by clicking on the email link on my home page of blog/share email via a comment (though that will be visible to everyone).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Game loop:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Game Loop is something that keep things going. It is kind of a timer mechanism. faster the game loop, the more real time the end user experience will be but at same time, a fast game loop will consume more memory (and sometimes its unnecessary). You have to decide the game loop frequency on your personal need basis.&lt;/P&gt;
&lt;P&gt;In Silverlight, you could achieve the effect of time through &lt;EM&gt;DispatcherTimer&lt;/EM&gt; but that is not a recommended approach, so people usually go for Empty Storyboard approach. But with release of Silverlight 2 RC, we have a &lt;A href="http://silverlightrocks.com/cs/blogs/silverlight_games_101/archive/2008/09/26/a-much-cleaner-game-loop-in-silverlight-2-rc0.aspx" target=_blank mce_href="http://silverlightrocks.com/cs/blogs/silverlight_games_101/archive/2008/09/26/a-much-cleaner-game-loop-in-silverlight-2-rc0.aspx"&gt;better approach&lt;/A&gt;. Though I will show here the empty storyboard mechanism.&lt;/P&gt;
&lt;P&gt;In empty storyboard approach, we create a storyboard in the code, set its duration, associate a event handler for completion and begin the storyboard. The code looks similar to below.&lt;/P&gt;
&lt;P&gt;void GameLoop() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer = new Storyboard(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Duration = TimeSpan.FromMilliseconds(15); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Completed += new EventHandler(timer_Completed); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Begin(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;When storyboard completes, it reached its completed event handler as show below and there we do all that we want to do with the game and at the end re-begin the storyboard.&lt;/P&gt;
&lt;P&gt;void timer_Completed(object sender, EventArgs e) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Write all logic that you need to execute every 15 milliseconds (in this case).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Begin(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;Simple! &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Handling Keyboard:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Keyboard inputs can be handled directly by handling key down, key up events of the Canvas of our XAML. But it is not advised to handle it that way (you will do it if you want a real real realtime response). I am telling this because SL based applications has to be least resource intensive so it is good to share good practice. otherwise you could ignore this section and write canvas event handlers manually.&lt;/P&gt;
&lt;P&gt;In a more optimised approach, we handle key inputs of canvas, and instead of responding to it directly, store the key stroke details in a shared array. When game loops itself (maybe 15 milliseconds in this case) we will simply fetch the key press activities from the array and react to it. this will allow us to move at our own pace rather than getting things hanged/behave abnormally because of an impatient end user hitting arrow keys more like a madman. Attached is a class file that is used to wrap this logic in the form of a class. the class file is present in the getting started samples of Farseer available from Codeplex web site. So, instead of reinventing the wheel, I am representing it as is. see the attached KeyHandler.zip file which has classes associated with it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Farseer Sample Logic:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Okay, so enough of theories, here is one logic that you can apply to create a simple rectangle and circle and then apply motion to it along with handling collisions.&lt;/P&gt;
&lt;P&gt;You need the sprites. In our case these would be XAML files for rectangle and circle having associated code behind files. The code behind files would contain nothing else than an object of type Body and a public function called Update (remember? This is the function which will keep different properties of rectangle/circle in sync with the contained Body object). here is a sample XAML and code behind class structure:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Rectangle XAML and Code Behind:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;lt;UserControl x:Class="PhysicsSLGettingStarted.MyRectangle" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns="&lt;/EM&gt;&lt;A href="http://schemas.microsoft.com/winfx/2006/xaml/presentation" ? mce_href="http://schemas.microsoft.com/winfx/2006/xaml/presentation"&gt;&lt;EM&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/EM&gt;&lt;/A&gt; &lt;BR&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xmlns:x="&lt;/EM&gt;&lt;A href="http://schemas.microsoft.com/winfx/2006/xaml" ? mce_href="http://schemas.microsoft.com/winfx/2006/xaml"&gt;&lt;EM&gt;http://schemas.microsoft.com/winfx/2006/xaml"&lt;/EM&gt;&lt;/A&gt; &lt;BR&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Width="400" Height="300"&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Canvas IsHitTestVisible="False"&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle x:Name="rectangle" Fill="Yellow" Stroke="Black" StrokeThickness="2" Canvas.Left="0" Canvas.Top="0"&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Rectangle.RenderTransform&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TransformGroup&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;RotateTransform x:Name="rotateTransform" Angle="0"/&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;TranslateTransform x:Name="translateTransform" X="0" Y="0"/&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/TransformGroup&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Rectangle.RenderTransform&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Rectangle&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Canvas&amp;gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;lt;/UserControl&amp;gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;public partial class MyRectangle : UserControl &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //We could have implemented like a property but for simplicity I am not making it very complex. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This is the RectangleBody object that is changed by Physics simulator. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Our update method syncs the coordinates of rectangle with properties of this RectangleBody &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Body RectangleBody; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; float x, y, rotation; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public MyRectangle() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent(); &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Exposing size as a property so that size of rectangle can be set from external code &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Vector2 Size &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Vector class is just a structure of packaging things. Its upto us to use it the way we like &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //We are seeting the width and height of rectangle and the user control &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //equal to the value supplied by external code &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Width = value.X; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rectangle.Width = this.Width; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.Height = value.Y; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rectangle.Height = this.Height; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Required to match the coordinate systems &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; translateTransform.X = -this.Width / 2; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; translateTransform.Y = -this.Height / 2; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rotateTransform.CenterX = this.Width / 2; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rotateTransform.CenterY = this.Height / 2; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return new Vector2((float)this.Width, (float)this.Height); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Method that keeps properties of the rectangle in sync with the RectangleBody properties &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Look how we are simply mapping the properties of Canvas with body properties &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void Update() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (RectangleBody == null) return; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (x != RectangleBody.Position.X) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; x = RectangleBody.Position.X; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.SetValue(Canvas.LeftProperty, Convert.ToDouble(x)); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (y != RectangleBody.Position.Y) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y = RectangleBody.Position.Y; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.SetValue(Canvas.TopProperty, Convert.ToDouble(y)); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (RectangleBody.Rotation != rotation) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rotation = RectangleBody.Rotation; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rotateTransform.Angle = (rotation * 360) / (2 * Math.PI); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Circle XAML and Code Behind:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;XAML and code behind of circle is almost similar to rectangle above. Please see the attached code for details.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Main Page Code Behind (Page.xaml.cs)&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Important details added:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;public partial class Page : UserControl &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PhysicsSimulator physicsSimulator; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyRectangle rect; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Body rectBody; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geom rectGeom; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Body circleBody; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyCircle circle; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Geom circleGeom; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Storyboard timer; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Vector2 force; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Page() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create Physics Simulator &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; physicsSimulator = new PhysicsSimulator(new Vector2(0, 5000)); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create Body. Note the constructor uses physics simulator &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rectBody = BodyFactory.Instance.CreateRectangleBody(physicsSimulator, 128, 128, 1); &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Rectangle will not move &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rectBody.IsStatic = true; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circleBody = BodyFactory.Instance.CreateCircleBody(physicsSimulator, 64, 1);//fix &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create Geometry and set different physics factors &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rectGeom = GeomFactory.Instance.CreateRectangleGeom(physicsSimulator, rectBody, (float)this.Width, (float)this.Height / 5); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rectGeom.RestitutionCoefficient = .5f; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rectGeom.FrictionCoefficient = .2f; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circleGeom = GeomFactory.Instance.CreateCircleGeom(physicsSimulator, circleBody, 64, 20); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circleGeom.RestitutionCoefficient = .5f; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circleGeom.FrictionCoefficient = .2f; &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Add these bodies to canvas &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; AddtoCanvas(); &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Attach the bodies to physics simulator so that they can be managed by it. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; physicsSimulator.Add(rect.RectangleBody); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; physicsSimulator.Add(circle.CircleBody); &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Call their update method once during load tiem so that their initial position and size are set &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle.Update(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rect.Update(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //This method adds the XAML (sprites) to the main page's XAML &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void AddtoCanvas() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create a rectangle sprite and give it a body, initial size etc. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rect = new MyRectangle(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rect.RectangleBody = rectBody; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rect.RectangleBody.Position = new Vector2((float)this.Width / 2 + 400, (float)this.Height / 2 + 200); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rect.Size = new Vector2((float)this.Width, (float)this.Height / 5); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Create a circle sprite and give it a body, size, position etc. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle = new MyCircle(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle.Radius = 60; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle.CircleBody = circleBody; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle.CircleBody.Position = new Vector2((float)this.Width / 2 +500, (float)this.Height / 2 - 100); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Add these sprites to main canvas &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.LayoutRoot.Children.Add(circle); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; this.LayoutRoot.Children.Add(rect); &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void GameLoop() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer = new Storyboard(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Duration = TimeSpan.FromMilliseconds(15); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Completed += new EventHandler(timer_Completed); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Begin(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; void timer_Completed(object sender, EventArgs e) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Button_Click(null, null); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; timer.Begin(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private void Button_Click(object sender, RoutedEventArgs e) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; { &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Apply force &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; force = Vector2.Zero; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; force.Y = -force.Y; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; force += new Vector2(0, 5000); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //apply force in y direction &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle.CircleBody.ApplyForce(force); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Rotate the ball so that it falls down &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle.CircleBody.ApplyTorque(-5000); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //update simulation &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; physicsSimulator.Update(0.005f); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //update the effect of physics simulator by calling update methods of sprites &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rect.Update(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; circle.Update(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Start the game loop &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GameLoop(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Please see the attached code for more details.&lt;/P&gt;
&lt;P&gt;I hope this would give you a quick start for moving ahead with Physics based animations and Games.&lt;/P&gt;
&lt;P&gt;If you are an ISV and want our team to be engaged for training/development projects, please feel free to connect with me &lt;A href="http://blogs.msdn.com/rahul/contact.aspx" target=_blank mce_href="http://blogs.msdn.com/rahul/contact.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Happy Gaming!&lt;/P&gt;
&lt;P&gt;Rahul Gangwar&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8969669" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author></entry><entry><title>Silverlight and The Application Design</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2008/08/05/silverlight-and-the-application-design.aspx" /><id>http://blogs.msdn.com/rahul/archive/2008/08/05/silverlight-and-the-application-design.aspx</id><published>2008-08-06T00:24:52Z</published><updated>2008-08-06T00:24:52Z</updated><content type="html">&lt;p&gt;Today is August 5th 2008 and I am writing this short post just to convey how Silverlight changes the overall design of a conventional browser based application. Current public version of Silverlight is 2 Beta2.&lt;/p&gt;  &lt;p&gt;There are many reasons to use Silverlight; &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;To enhance the UI of existing browser based applications; When we install Silverlight plug-in, browser can understand more set of tags (XAML) apart from HTML tags. Moreover we can use the capabilities of the presentation engine of Silverlight to draw better UI.&lt;/li&gt;    &lt;li&gt;To scale the application; Since now most of the end user interaction and processing will happen at client side itself, there will be less number of hits on the server. So now the application could support more number of concurrent users.&lt;/li&gt;    &lt;li&gt;To do things beyond JavaScript; Not many things can be done with JavaScript which can be achieved with Silverlight. one example could be rendering HD video, which requires us to use graphics card capabilities to render it. &lt;/li&gt;    &lt;li&gt;To use existing skill set of developers; Silverlight supports multiple languages (like C#, VB.NET, IronRuby, IronPython etc.) we could reuse the existing capabilities of developers to create better applications over web rather than learning new technologies to enhance the UI of browser based applications.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Apart from these and many other features, one thing that attract me most is the way application deployment design changes with Silverlight development.&lt;/p&gt;  &lt;p&gt;Almost every business application has three layers: The presentation/UI layer, Business Logic layer and data Layer. If we talk in context to browser based applications, the presentation layer sits over Browser, while the rest of layers (Business + data) sits at server side. Whenever there is a requirement to do some business processing or access data we go back to the server and this gives a bad end user experience.&lt;/p&gt;  &lt;p&gt;With Silverlight, this design changes a little bit, but that little makes huge difference. With Silverlight, Presentation and Business Logic Layer can sit at Browser side while Data Layer can sit at server side. This means that now we have to go back to server ONLY when we need to get some data, otherwise we can sit happily at client side and attend them in real time fashion; just like windows applications do. On top of that, whenever we want to talk to server for data, we do so asynchronously which means end user doesn't come to know about whether server interaction is happening or not. &lt;/p&gt;  &lt;p&gt;The above idea is conveyed in figure given below.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/SilverlightandTheApplicationDesign_12E2D/SiverlightBusinessLayer_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 20px 5px 15px 0px; border-right-width: 0px" height="461" alt="SiverlightBusinessLayer" src="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/SilverlightandTheApplicationDesign_12E2D/SiverlightBusinessLayer_thumb.jpg" width="393" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Any comments/suggestions/questions more than welcome.&lt;/p&gt;  &lt;p&gt;Rahul's &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8834982" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author></entry><entry><title>ADO.NET Sync Services: Services Based Architecture's Step-by-Step Demo</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2008/06/02/ado-net-sync-services-services-based-architecture-s-step-by-step-demo.aspx" /><id>http://blogs.msdn.com/rahul/archive/2008/06/02/ado-net-sync-services-services-based-architecture-s-step-by-step-demo.aspx</id><published>2008-06-02T22:25:00Z</published><updated>2008-06-02T22:25:00Z</updated><content type="html">&lt;P&gt;Today is June 3rd 2008 and I am writing this blog post to demonstrate a step by step guide to developing an ADO.NET Sync Services Sample Application that is using Service Based Architecture. Though I planned to first write a post on ADO.NET Sync Services as a whole from architecture perspective and then provide a step by step instructions for the sample code, but now, when I have completed the step by step instructions before the architecture document, I am posting the same.&lt;/P&gt;
&lt;P&gt;In almost every practical case of disconnected applications architecture, the server side central database is exposed via http end points like web services. Moreover with the release of technologies like ADO.NET Data Services, it is a matter of few clicks to expose the entire data model to the external world using web services.&lt;/P&gt;
&lt;P&gt;So I thought of writing down the steps that I took in Visual Studio 2008 to create a client windows application which will be talking to the central database server via a http WCF Service. If you are interested in the sample code as well, please feel free to get in touch with me.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Open Visual Studio and create a new windows application which will store all the client specific files.&lt;/LI&gt;
&lt;LI&gt;Add a new class library project to the solution which will hold all the server side code.&lt;/LI&gt;
&lt;LI&gt;Add a third web application project to the solution which will expose a web service. The web service will be used as a broker between the client windows application and the server side class library. So also add a new WCF service to the web application project. You can delete the Default.aspx page which is created by default by Visual Studio 2008. Also since this will be Cassini based, right click the project and select properties. On the properties page, select “Web*” tab and select “Specific part” radio button. This will fix the port on which the web server will run and we can have a fixed URL to the web service. Click on save.&lt;/LI&gt;
&lt;LI&gt;In the windows application, add the SQL Server Table that you want to cache. You can do this by adding a LocalDatabaseCache file from the project templates. This will present you with a wizard where you will specify the SQL Server Tables. In the first form of wizard, specify the Server Connection to tell the Visual studio about the SQL Server with which you want to do the synchronization. Clicking on the drop down will present you with already known connections, if you want to specify a new connection, click on “New Connection” button adjacent to the Server Connection drop down and fill the required details.&lt;/LI&gt;
&lt;LI&gt;Once you specify the Server Connection details, it will automatically suggest you with a Client Connection name. This basically specifies the location and name of SQL CE database file to be created at client side.&lt;/LI&gt;
&lt;LI&gt;Once you specify the Client Connection details, you can see “Add” button enabled. This button allows you to select the tables on the SQL Server to be cached on the SQL CE database that you just specified in above steps. Going a little deep, this process creates a SQLCE database at client side and simply copies the schema from SQL Server to the CE database. So click on Add button, select tables that you want to cache/synchronize and click OK. Please explore other options shown if needed.&lt;/LI&gt;
&lt;LI&gt;The moment you finish this wizard, you will be prompted with another wizard of creating a DataSet for the SQL CE database just created. If you wish to write your own ADO.NET code skip it, otherwise choose the Tables for which you want Visual studio designer to write the ADO.NET code. For first demo, I would recommend to go through the dataset wizard rather than writing your own ADO.NET code.&lt;/LI&gt;
&lt;LI&gt;Now, we write the server side synchronization code into the class library created. We will do this by using the wizard again. Though we could have done it in previous steps but just to make it simple, I am doing it in this step. Double-click .sync file in the windows application. This will open the wizard that we have seen earlier. Here click on the “Advanced” button to see more options on the same page. Then on the “Server Project location” drop down select the class library project and click OK. This will transfer all the server side code from the client application to the Class Library which will be used by the web service.&lt;/LI&gt;
&lt;LI&gt;Add a reference of the ClassLibrary project into the web application project because web service will use it. Also add references to Microsoft.Synchronization.Data and Microsoft.Synchronization.Data.Server assemblies into the web application project. &lt;/LI&gt;
&lt;LI&gt;On the windows application add “service reference” and add the web service reference to the windows application.&lt;/LI&gt;
&lt;LI&gt;On the class library, you will see a .SyncContract.cs file which has code for an Interface and class. We will have to duplicate the same structure on the WCF files. So copy the method declarations of the interface of .SyncContract.cs file (along with [OperationContract()] declarations) and paste them to the Interface file of WCF Service (in the web application project you will see a file starting with “I” if you have not added any additional files starting with “I” letter). You can delete the default method called “DoWork()” provided by Visual Studio. Copy also the “using” declarations so that there are no build errors.&lt;/LI&gt;
&lt;LI&gt;Similarly copy all the methods and the private variable of the class from .SyncContract.cs file into the .svc.cs file of web service. Copy also the “using” declarations. The code also contains a constructor method. Just change the constructor name in .svc.cs file to the class name of the .svc.cs file. You can remove [System.Diagnostics.DebuggerNonUserCodeAttribute()] declarations (if present) from the methods.&lt;/LI&gt;
&lt;LI&gt;In the same .svc.cs file add another using statement for the class library project (e.g., using ClassLibrary1;). Try to compile and see if there are any errors. Remove any errors if I have missed any logical step.&lt;/LI&gt;
&lt;LI&gt;On the windows application, right click the .sync file and click “view Code”. Here, you will see one partial class already created with an empty OnInitialized() method. Create another class in same file (let us call it RemoteProviderClass) implementing the ServerSyncProvider class. Add following “using” declarations on the top of file:&lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;using Microsoft.Synchronization; &lt;BR&gt;using Microsoft.Synchronization.Data; &lt;BR&gt;using System.Data; &lt;BR&gt;using System.Collections.ObjectModel;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;And the class declaration looks similar to this: &lt;BR&gt;&lt;/STRONG&gt;&lt;EM&gt;public partial class RemoteProviderClass:ServerSyncProvider&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;LI&gt;After copying the using statements, copy only the methods (not private variable) of the .svc.cs file of web application to this file inside the new class created (RemoteProviderClass). Again, one of the methods will be a constructor, so change its name appropriately. Notice that each of the method is calling methods from a private variable whose name starts with an underscore. Declare a private variable inside the RemoteProviderClass corresponding to the proxy of the web service. The variable name should be same as the one that each method is using and starting with an underscore. Also, inside the constructor method, delete existing code and write a line to instantiate this proxy variable. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;Try to build the solution and you will see errors inside GetSchema() method. This is because Collection&amp;lt;string&amp;gt; is transferred as string[] array. So write code to convert the Collection into string array. Also notice the override keyword; this should be used with all methods instead of virtual keyword. The code should be similar to this: &lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;public override SyncSchema GetSchema(Collection&amp;lt;string&amp;gt; tableNames, SyncSession syncSession) &lt;BR&gt;{ &lt;BR&gt;string[] tables = new string[tableNames.Count]; &lt;BR&gt;tableNames.CopyTo(tables, 0); &lt;BR&gt;return this._serverSyncProvider.GetSchema(tables, syncSession); &lt;BR&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;LI&gt;Everything should compile well now. &lt;BR&gt;&lt;/LI&gt;
&lt;LI&gt;On the OnInitialized method write code to create an instance of this new class and assign to the RemoteProvider property of the sync agent. Also specify the sync direction of the tables. Here I have one table in my SQLCE database called Employee. The code looks similar to this &lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;partial void OnInitialized() &lt;BR&gt;{ &lt;BR&gt;this.RemoteProvider = new ProxyForWebServiceCall(); &lt;BR&gt;this.Employee.SyncDirection = SyncDirection.Snapshot; &lt;BR&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/OL&gt;
&lt;P&gt;Now we will create a UI on the windows form and invoke the synchronization process on timer tick event. Calling synchronization is straightforward but calling inside a timer that is invoked every 1 second is a little bit tricky. Practically, web service might return response in 1 second, and also till web service returns back, the UI thread will be unresponsive, so we will invoke the synchronization code asynchronously and only when one web service call has returned. I will illustrate this in following steps and also show the sample code to make things more comprehensive.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Open Form1 design and from data menu click on “Show Data Sources”. Drag and drop the table on the Form designer surface (in my case Employee table). Visual Studio will automatically create UI for end user editing and also write ADO.NET code for performing those operations on the local SQLCE database. Also drag and drop a timer control and set its enabled property to true and set its interval to 1000 (1 second). On the code behind of Form1 add using Microsoft.Synchronization.Data; declaration.&lt;/LI&gt;
&lt;LI&gt;On the code behind of Form1, declare three private variables belonging to the class of the Form. A Boolean variable to see whether we have to call the synchronization code or not. A delegate to the synchronize method of the Sync Agent class. A variable of the sync agent class. To see the class name of your sync agent navigate to the .cs file of the .sync file and see the class name of the OnInitialized() method. The declarations look similar to this:&lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;public partial class Form1 : Form &lt;BR&gt;{ &lt;BR&gt;bool IsContinue = true; &lt;BR&gt;private delegate SyncStatistics SynchronizeMethod(); &lt;BR&gt;LocalDataCache1SyncAgent syncAgent = new LocalDataCache1SyncAgent();&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;LI&gt;Now we will write code in the timer tick event handler to invoke synchronization. Here on the very first line we will check whether IsContinue is true or not, if it is not true, this means another web service call is pending and we have to wait, so we will return. But if IsTrue allowed us to enter further into synchronization code, let us block all other ticks of timer to enter. So the following code:&lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;if (!IsContinue) &lt;BR&gt;return; &lt;BR&gt;else &lt;BR&gt;IsContinue = false;&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;LI&gt;Then we will specify the synchronization direction of our global sync agent variable. I have set it to Bidirectional here. So this code:&lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;syncAgent.Employee.SyncDirection = Microsoft.Synchronization.Data.SyncDirection.Bidirectional;&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;LI&gt;Next we will instantiate the delegate with the sync agent’s synchronize() method so that we can invoke it asynchronously. Then invoke it asynchronously. Notice that in the second line, we have passes a method name, MyCallBack, (which we will create in coming steps) which will be invoked once web service returns response. MyCallBack will simply set the IsContinue to true so that now timer can start for a fresh synchronization execution. So the code below:&lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;SynchronizeMethod syncMethod = new SynchronizeMethod(syncAgent.Synchronize); &lt;BR&gt;IAsyncResult result = call.BeginInvoke(new AsyncCallback(MyCallBack), null);&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;LI&gt;After invoking the webs ervice, we can collect the resulty of web service by using EndInvoke. The result will be used to see if the DataGrid should be refreshed or not. If there were changes between two databases, then only form should be reloaded. So the code below:&lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Microsoft.Synchronization.Data.SyncStatistics syncStats = syncMethod.EndInvoke(result); &lt;BR&gt;if (syncStats.TotalChangesDownloaded &amp;gt; 0) &lt;BR&gt;Form1_Load(null, null);&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;LI&gt;And finally the callback method:&lt;/LI&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;private void MyCallBack(IAsyncResult result) &lt;BR&gt;{ &lt;BR&gt;IsContinue = true; &lt;BR&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Compile and run the application by setting windows application as startup project. Make changes from windows application and you can see them at SQL server and similarly make changes in SQL Server and they will be visible in Windows Application datagrid. Make sure that you do not change primary key field. This is just a start, go ahead and implement conflict resolution and try to make changes from multiple machines at same time.&lt;/P&gt;&lt;/OL&gt;
&lt;P&gt;I would love to see your comments/suggestions/corrections if any.&lt;/P&gt;
&lt;P&gt;Rahul Gangwar&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8570022" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author></entry><entry><title>High Scalability Architecture For Data Types Like Image</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2008/04/03/high-scalability-architecture-for-data-types-like-image.aspx" /><id>http://blogs.msdn.com/rahul/archive/2008/04/03/high-scalability-architecture-for-data-types-like-image.aspx</id><published>2008-04-03T21:12:58Z</published><updated>2008-04-03T21:12:58Z</updated><content type="html">&lt;p&gt;Today is April 3rd 2008 and this small article focus on the approach of implementing a scalable solution which involve serving large amount of data such as Images. This is an infrastructure pattern.&lt;/p&gt;  &lt;p&gt;Ever wondered how a large web site serve content such as Images to end user? Take for example you have a photo sharing web site. Generally we use SQL Server as the back end storage solution for any application architecture. However, not all data types can be stored in the SQL Server. When it comes to data types such as images, SQL Server stores them in the form of BLOB. But BLOB in SQL Server has its own inherent problems. If you do read or write to BLOB, the whole of the BLOB being transferred over the wire and stored in memory. This can cause network congestion and memory pressure, particularly when there is a considerable load of concurrent users.&lt;/p&gt;  &lt;p&gt;If you need to read or write BLOB data such as images, you should first consider the options of storing them directly on a hard disk and storing the physical path or the URL in the database. This reduces load on the database. This basically requires two components. One, a File Server (for storing actual data) and then the Database management System to store references of the same. Microsoft provides solution for both the components in the form of Windows Storage Server and SQL Server. The following diagram explains this solution in a better way:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/HighScalabilityArchitectureForDataTypesL_14D72/Untitled_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="311" alt="Untitled" src="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/HighScalabilityArchitectureForDataTypesL_14D72/Untitled_thumb.jpg" width="578" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now, when we understand that dedicated File Server is the solution for storing datat types such as Images, how do we typically implement it? Such a solution is implemented in form of Storage Area Network (SAN) where Network Attached Storage (NAS) Devices are used to store the large data and act as a File Server. In such a solution even SQL Server resides on SAN.&lt;/p&gt;  &lt;p&gt;However, if you still want to store BLOB data in the database (maybe because you don&amp;#8217;t want to have complex infrastructure of Storage Server), consider the following options to reduce the performance cost: &lt;/p&gt;  &lt;p&gt;--&amp;gt; Use chunking to reduce the amount of data transferred over the wire. Chunking involves more round trips, but it places comparatively less load on the server and consumes less network bandwidth. You can use the DataReader.GetBytes (from Application code) to read the data in chunks or use SQL Server-specific commands, such as READTEXT and UPDATEDTEXT, to perform such chunking operations. &lt;/p&gt;  &lt;p&gt;--&amp;gt; Avoid moving the BLOB repeatedly because the cost of moving them around can be significant in terms of server and network resources. Consider caching the BLOB on the client side after a read operation.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Comments and suggestions, as always, more than welcome.&lt;/p&gt;  &lt;p&gt;Rahul Gangwar&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8354558" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author></entry><entry><title>Patterns used for navigating between pages in ASP.NET:</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2007/12/20/patterns-used-for-navigating-between-pages-in-asp-net.aspx" /><id>http://blogs.msdn.com/rahul/archive/2007/12/20/patterns-used-for-navigating-between-pages-in-asp-net.aspx</id><published>2007-12-21T02:15:00Z</published><updated>2007-12-21T02:15:00Z</updated><content type="html">&lt;P&gt;ASP.NET offers different APIs and ways (like Server.Transfer, Response.Redirect etc.) through which you can navigate between pages in your web applications. But before choosing any of these ways, we must have an understanding about the pattern that we want to follow. Depending on the pattern used, our choice about selecting an API changes.&lt;/P&gt;
&lt;P&gt;Broadly, there are two patterns used for navigating between pages depending on the requirement:&lt;/P&gt;
&lt;P&gt;&lt;B&gt;1. Loosely Coupled Architecture:&lt;/B&gt; &lt;BR&gt;In this pattern, each page has its own processing unit. So if you have a page that has some input controls, its code behind will have all the logic to form SQL Queries based on input and get the result also from database. Then when it comes to displaying the result, another page (the results page) is invoked and the data of previous page are passed to the new page. This is called loosely coupled architecture since each page is given a responsibility and it performs its work without being dependent on any other parts of the system. So one page is given the responsibility to gather user input and prepare the result and another page is given the responsibility to display data. The picture given below illustrates this architecture in a better way: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Patternsusedfornavigatingbetweenpage.NET_AA1/fig1_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Patternsusedfornavigatingbetweenpage.NET_AA1/fig1_2.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=208 alt=fig1 src="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Patternsusedfornavigatingbetweenpage.NET_AA1/fig1_thumb.jpg" width=409 border=0 mce_src="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Patternsusedfornavigatingbetweenpage.NET_AA1/fig1_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;B&gt;When to use this pattern: &lt;BR&gt;&lt;BR&gt;&lt;/B&gt;Now when we know that what this architecture means, we can appreciate the scenarios where we can use it. The scenarios are too wide, and one possibility that I can think of is the scenario where you want a decentralized approach. Whenever we have scenarios where processing logic is different for each page, we go for this approach since there is no point in delegating the processing logic to results page. If we delegate the processing logic to results page, we will have many results page so to avoid this, we choose to keep the processing logic in the input gathering page itself. &lt;/P&gt;
&lt;P&gt;&lt;B&gt;How to implement: &lt;BR&gt;&lt;BR&gt;&lt;/B&gt;The default model of ASP.NET provides this facility where each page posts to itself until we specifically configure the controls to post to another page. The steps involved are: &lt;BR&gt;&lt;BR&gt;a) Implement the input page with all the data preparation logic in its code behind. The controls on this page will post to itself. &lt;BR&gt;b) Invoke another page when the processing is done and pass the processed data to the target page. This second step can be achieved in many ways depending on the requirements. Below I show few techniques that can be used.&lt;/P&gt;
&lt;P&gt;a) On the first page’s code behind (having input controls), when all the processing is over, add the data to be transferred to next page into the “Context” collection (Context.Items.Add() method can be used for adding into Context collection) and then invoke the target page using Server.Transfer() . On the target page (the results page) retrieve the data from the Context Collection simply by using Context.Items[] collection and typecast it if needed. Context collection remains into scope this ways on the target page as well (remember we cannot use response.redirect() method if we want to use Context collection to store our data since context dies the moment the request thread leaves the server).&lt;/P&gt;
&lt;P&gt;b) Another API to achieve this is to use Request property. This basically gives you reference to the current context and then using Request.Form we can access the source page.&lt;/P&gt;
&lt;P&gt;c) If you want to use the data between multiple requests, you can store data into Session collection instead of context collection. Everything else remains same (and yes we can use response.redirect() method if we are using session to store our data).&lt;/P&gt;
&lt;P&gt;d) A third way could be to get the reference of the source page on the target page. Whenever we use Server.Transfer() method to navigate to another page, we can access the source page from Context.Handler property. So all we need to do is to create storage on the first page (for example by creating a property called data on source page) and store the result in that property. Then, on the target page access the properties (in fact everything that is public on the first page including controls) by using Context.Handler. This approach is used in cases where we have many discrete data elements to be transferred to the target page. So instead of adding them to Context Collection on first page, we add into the page itself by creating properties. Then we can access all the properties of source page on the target page. Another good thing in this approach is that we do not need to typecast in contrast to Context/Session approaches. More can be found here: &lt;BR&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/6c3yckfw(vs.71).aspx" mce_href="http://msdn2.microsoft.com/en-us/library/6c3yckfw(vs.71).aspx"&gt;http://msdn2.microsoft.com/en-us/library/6c3yckfw(vs.71).aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;2. Coupled Architecture (Centralized approach): &lt;BR&gt;&lt;/B&gt;In this pattern, we designate a central page for processing the input and displaying the results. We form separate pages for gathering input. The input pages gather data from end user and post it to central processing unit (the results page). This is the approach where you post the source page directly to another page (the cross post scenarios). The following figure illustrates this: &lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Patternsusedfornavigatingbetweenpage.NET_AA1/fig2_2.jpg" mce_href="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Patternsusedfornavigatingbetweenpage.NET_AA1/fig2_2.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=184 alt=fig2 src="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Patternsusedfornavigatingbetweenpage.NET_AA1/fig2_thumb.jpg" width=437 border=0 mce_src="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Patternsusedfornavigatingbetweenpage.NET_AA1/fig2_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;B&gt;When to use this pattern: &lt;BR&gt;&lt;BR&gt;&lt;/B&gt;This approach is used whenever we want to reuse the code. If the logic can be reused across multiple pages, then there is no point in writing the same logic on multiple pages and making code unmanageable. In that case we create a central processing unit (the results page) and all other pages just collect data from end users and post themselves to the results page.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;How to implement: &lt;BR&gt;&amp;nbsp; &lt;BR&gt;&lt;/B&gt;We can use PostbackURL property of controls to specify the target page. In this approach, on the source page we specify the target page URL in the PostbackURL property of controls (for example a submit button). This ways, when end user clicks on the submit button all the data of the input page is sent to the target page directly. So no need to write any code behind on source page. A very clean way to implement this pattern.&lt;/P&gt;
&lt;P&gt;Yet another model can be followed which involves, first posting to the source page itself and then source page transferring to the target page but no processing is done at source page. We can do this by using Response.Redirect() and then passing the input data using query strings. &lt;/P&gt;
&lt;P&gt;Rahul's&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6821603" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author></entry><entry><title>ADO.NET Entity Framework</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2007/12/07/ado-net-entity-framework.aspx" /><id>http://blogs.msdn.com/rahul/archive/2007/12/07/ado-net-entity-framework.aspx</id><published>2007-12-08T03:48:14Z</published><updated>2007-12-08T03:48:14Z</updated><content type="html">&lt;p&gt;ADO.NET Entity Framework is Microsoft's step towards its Data Platform Vision. In this blog, I am going to talk about the architecture of the ADO.NET Entity Framework and the way it will change application development style. Though it is in Beta Phase right now but is expected to be part of Visual Studio 2008 during mid of year 2008.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;The Vision:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If we closely look at the new development initiatives from Microsoft, we can clearly see where Microsoft Development Platform is heading towards. Be it the new &amp;quot;language features&amp;quot; in C# 3.0 like LINQ or new &amp;quot;components&amp;quot; in framework like Communication Foundation, Workflow Foundation or the new features in &amp;quot;products&amp;quot; like Biztalk, SQL Server etc., one thing is common in all of them: &amp;quot;Abstraction&amp;quot;. By the term abstraction I mean hiding all the complex details and exposing simple interfaces to achieve one goal of allowing the developers to concentrate on &amp;quot;what&amp;quot; do they need rather than &amp;quot;how&amp;quot; do they need. &lt;/p&gt;  &lt;p&gt;Take example of LINQ. Simply put, the primary aim of LINQ is to develop a common querying language within the programming language so that developer does not have to learn new querying languages (like SQL, XPath etc.) varying on the kind of data source they are dealing with. Today with LINQ, you don't need to know SQL or XPath to search data from a database or XML data source. You just need to know LINQ and search every data source with it. &lt;/p&gt;  &lt;p&gt;Now look at the structure of a typical query expression in LINQ. You will find the structure similar to SQL having keywords like &amp;quot;Select&amp;quot;, &amp;quot;From&amp;quot;, &amp;quot;Where&amp;quot; etc. along with a fleet of operators to work with. It is typically the smell of any 4GL language. SQL is a 4th Generation Language, similarly LINQ is a 4th Generation Language. And what is a 4th Generation language in anyway? Any construct that offers me the ability to specify &amp;quot;what&amp;quot; without asking me &amp;quot;how&amp;quot; is a 4th Generation language.&lt;/p&gt;  &lt;p&gt;Take another example of WCF. You can now create generic services in WCF within no time that can work on REST principle (REST is like backbone of today's web) and that can also work on a completely proprietary protocols with very little efforts. In WCF we call them &amp;quot;Service&amp;quot; which is as generic as we have &amp;quot;object&amp;quot; type in any OO Programming Language. The same service can behave as a web service, can use message queues, can use TCP with just simple changes in configuration. Developer does not have to worry about intrinsic details. In fact whenever I personally design an architecture for Microsoft Partners, I either think of WCF or Biztalk whenever communication comes into picture. These two technologies are key to enable communication framework within software components as well as enabling integration between different disparate systems.&lt;/p&gt;  &lt;p&gt;The examples can go on and on since the technologies offered by Microsoft are many. But the point that I am trying to make is that Microsoft has this vision to introduce abstraction to such an extent that things become extremely simple and we can produce great software within no time, no cost.&lt;/p&gt;  &lt;p&gt;With ADO.NET Entity Framework, the Microsoft vision remains the same: To abstract data access with programmers so that they spend their time in writing &amp;quot;what&amp;quot; rather than &amp;quot;how&amp;quot;. Imagine if the 4GL concept spans across all layers, application development will be over in the requirement gathering phase itself since the moment we specified 'what&amp;quot; do we need from application, application is ready. ADO.NET Entity Framework is a little step towards that vision.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Introduction:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;A typical application has those 3 layers: Presentation, Business and Data Access. ADO.NET Entity framework will change the way Data Access layer is written. One way of looking at it is to consider as an ORM (Object Relational Modelling) framework. Any ORM framework aims to bridge the gap between the way data is represented in database (or better data source) and the way it is represented inside the application. An ORM framework does that by providing a framework that does the mapping between your classes and properties within it with database tables and their columns. This framework is an extra layer between the data access layer and data source. So developer do not have to write code against database, fetch data in some format, convert it to fit with objects in application and then use the data. Instead, developers do all their modifications on objects only and the changes are translated by the ORM framework into appropriate database calls. ADO.NET Entity Framework is also an ORM framework that provides this functionality. ORM frameworks are not new concepts, we have plenty of them (like nHibernate) in market. But what is different with ADO.NET Entity Framework is that it is much more than simply an ORM framework. Not only does it bridges gap between representation of data within application and database, but also it aims to improve upon performance (unlike other ORM frameworks that hits to performance) and more importantly it integrates with the programming language itself (we have LINQ to entities for the same reason) making this integration more flawless and easy to use.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Architecture:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;I would take the picture (shown below) from one of the &amp;quot;data points&amp;quot; column of MSDN Magazine that clearly shows the high level developer architecture of ADO.NET Entity Framework. Let us dissect each element to appreciate the architecture better.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/ADO.NETEntityFramework_47B3/EntityFrameworkArchitecture_2.gif"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="380" alt="EntityFrameworkArchitecture" src="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/ADO.NETEntityFramework_47B3/EntityFrameworkArchitecture_thumb.gif" width="283" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Entity Framework Layers (Logical + Mapping + Conceptual):&lt;/p&gt;  &lt;p&gt;The three entity framework layers shown in above diagram are the core of whole functionality. These layers are also called as EDM (Entity Data Model). Entity framework engine basically takes decisions on the basis of the EDM. The first step that we have to do in order to use the entity framework is to generate (optionally edit based on requirements) these application specific layers. But do not worry, generating these layers (EDM) is not more than a matter of clicks. You can generate an EDM using a database as a starting point. You can then modify the XML manually (or possibly using a modelling tool that may be available in a future release of Visual Studio). When you add an ADO.NET EDM to your project, the wizard walks you through the process of creating the EDM.&lt;/p&gt;  &lt;p&gt;The Logical layer contains the entire database schema in XML format. This represents the story at database side.    &lt;br /&gt;    &lt;br /&gt;The Conceptual Layer is again an XML file that defines the entities (your custom business objects) and the relationships (the custom ones) that your application knows. So if you say that each Customer can have many associated orders, that relationship is defined in the conceptual layer even if this relationship does not exist at database side.     &lt;br /&gt;    &lt;br /&gt;The Mapping layer is also an XML file that maps the entities and relationships defined at conceptual layer with the actual relationships and tables defined at logical layer. This is the core of entire Entity Framework that bridges the gap.&lt;/p&gt;  &lt;p&gt;Within application we always interact with Conceptual layer. To talk to Conceptual Layer we can use&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;A new language called Entity SQL directly (actually Entity SQL queries are fired using Entity Client provider which is very similar to ADO.NET model). &lt;/li&gt;    &lt;li&gt;LINQ to Entities, which is again another language integrated querying facility. &lt;/li&gt;    &lt;li&gt;Using Object Services which in turn uses an ObjectQuery Object. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Whenever we commit changes (like invoking SaveChanges() method) to databases from application, appropriate queries are fired (it also takes care of the relationships). We don&amp;#8217;t have to think about relationships at application level since all the mapping is done at EDM layers. So, Entity Framework handles Relationships quiet neatly.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Wrapping UP:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The best wrap up that I can write is what John Papa gave in his article:&lt;/p&gt;  &lt;p&gt;&amp;quot;The Entity Framework allows developers to focus on the data through an object model instead of the logical/relational data model. Once the EDM is designed and mapped to a relational store, the objects can be interacted with using a variety of techniques including EntityClient, ObjectServices, and LINQ.&lt;/p&gt;  &lt;p&gt;While the traditional objects such as the DataSet, DataAdapter, DbConnection, and DbCommand are still supported in the upcoming release of ADO.NET available in Visual Studio &amp;quot;Orcas,&amp;quot; the Entity Framework brings major additions that open ADO.NET to new and exciting possibilities.&amp;quot;&lt;/p&gt;  &lt;p&gt;There are other Microsoft initiatives in the data platform vision like having a framework to expose data as service and tools for developing for an occasionally connected architecture. More on those initiative in my future blog entries once I get my hands dirty with them as I have done with Entity Framework :).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Rahul's&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:aa1ce221-9772-406e-bae1-b74334e0779b" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ADO.NET%20Entity%20Framework%20Architecture" rel="tag"&gt;ADO.NET Entity Framework Architecture&lt;/a&gt;,&lt;a href="http://technorati.com/tags/LINQ%20to%20Entities" rel="tag"&gt;LINQ to Entities&lt;/a&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6698725" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author></entry><entry><title>Microsoft Vision for development platform - Codename Oslo</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2007/11/19/microsoft-vision-for-development-platform-codename-oslo.aspx" /><id>http://blogs.msdn.com/rahul/archive/2007/11/19/microsoft-vision-for-development-platform-codename-oslo.aspx</id><published>2007-11-20T03:23:04Z</published><updated>2007-11-20T03:23:04Z</updated><content type="html">&lt;p&gt;If someone asks me Microsoft's strategy on application development, I would simply say SOA spanning across the servers, clients and the cloud. Microsoft is hitting on its strategy of SOA by releasing new products and platforms at a rapid rate. The next big thing from Microsoft towards this goal will be &amp;quot;Oslo&amp;quot;.&lt;/p&gt;  &lt;p&gt;Today in any typical application development scenario, there are various experts involved at different levels. Each if these experts try to develop a model of the area in which they have expertise. For example, business analyst might model the software requirements, architects model the high-level designs, administrative staff might model the deployment and maintenance requirements etc. Then developers develop the code corresponding to the model.&lt;/p&gt;  &lt;p&gt;The approach is perfect where each person is doing his job in the field the he is expert but at the same time there are some impedance mismatch between these different sets of people. The models developed by an analyst is developed using entirely different set of tools than the tools used by an architect or developer. Not only this, if someone wants to be an end-to-end expert of the software lifecycle he will have to learn a vast range of tools, modeling languages etc. Even bigger than this is the problem when it comes to development. Developers have very less usage of the models that other experts have created as far as the development efforts are concerned. Models just remain a source of reference and this is the reason why modeling is still only at the surface of the software lifecycle.&lt;/p&gt;  &lt;p&gt;To bridge all sorts of mismatch problems, Microsoft plans to bring an integrated environment for everyone. Analysts, Architects, IT professionals, Developers can all work together, and not only work together but also benefit from the model created by others practically. Microsoft is making it possible by building a general-purpose modeling language that everyone can use, common tools to automate the tasks and a repository where all the models will reside. &lt;/p&gt;  &lt;p&gt;&amp;quot;Oslo&amp;quot; is the codename for all the technologies that will make this possible. With Oslo we can imagine a development environment where users will design a model for an application that then becomes the application itself. This will shorten the time from design to development and bridge the different phases of software lifecycle to make it a continuous process. The &amp;quot;Connected Tools Team&amp;quot; in Microsoft is responsible for the new modeling tool that will make this process a reality.&lt;/p&gt;  &lt;p&gt;Oslo includes:&lt;/p&gt;  &lt;p&gt;--&amp;gt; Future release of .NET Framework 4. So we can expect that .NET framework 4 will have further enhancements to the WCF Workflow Foundation Technologies.&lt;/p&gt;  &lt;p&gt;--&amp;gt; Biztalk Server family will evolve for enabling a highly scalable SOA and BPM solutions. The Biztalk Server is expected to be built on top of WCF and WF and will also have the capabilities to develop, deploy and manage composite applications.&lt;/p&gt;  &lt;p&gt;--&amp;gt; We will also see the release of Biztalk Services that will allow the development of cross organizational composite applications.&lt;/p&gt;  &lt;p&gt;--&amp;gt; We will see a wide variety of tools that allows the dream of model driven development to turn into reality. So this is basically the extension of Visual Studio Team System capabilities which will be the unified environment for all class of experts bridging each phase's output with input to next phase.&lt;/p&gt;  &lt;p&gt;--&amp;gt; Better repository system for metadata.&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;More:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.microsoft.com/soa/products/oslo.aspx" href="http://www.microsoft.com/soa/products/oslo.aspx"&gt;http://www.microsoft.com/soa/products/oslo.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#xA0;&lt;/p&gt;  &lt;p&gt;Rahul's&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:6e1e6c9f-e41b-4e96-83fc-993c0fea7639" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags:  		&lt;a href="http://technorati.com/tags/Oslo/" rel="tag"&gt;Oslo&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/M.NET%20Framework%204/" rel="tag"&gt;M.NET Framework 4&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Composite%20Application/" rel="tag"&gt;Composite Application&lt;/a&gt; 		,  		&lt;a href="http://technorati.com/tags/Model%20Driven%20Development/" rel="tag"&gt;Model Driven Development&lt;/a&gt; 		&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6415002" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author></entry><entry><title>Silverlight</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2007/08/29/silverlight.aspx" /><id>http://blogs.msdn.com/rahul/archive/2007/08/29/silverlight.aspx</id><published>2007-08-29T22:49:00Z</published><updated>2007-08-29T22:49:00Z</updated><content type="html">&lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;Conceptual Silver Light:&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;I am writing this entry because I feel Silver Light to be the sword of developers in Web 2.0/S+S world.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;I remember my first introduction to HTML programming in my school days. One of my seniors was doing all the HTML stuff in an attempt to design an attractive web page. When I saw the way he wrote html tags that was a surprise to me (more because it seemed quite terse to me). But then he told me that its actually very easy and intuitive if you know the elements that you have to use.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;That said, I started learning HTML and came to know about various buzzwords like DHTML, JavaScript, DOM Object Model etc.      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;I request your patience for reading the HTML stuff because this will suddenly and finally open up the doors off Silver light.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;One beautiful concept that I like about HTML programming is the Object Model. In HTML programming there are several HTML elements like &amp;lt;html&amp;gt;, &amp;lt;head&amp;gt;, &amp;lt;Table&amp;gt; and list goes on.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;The basics of HTML programming lies in the fact that there are fixed (though large) number of elements that a standard browser understands. And these elements are nothing more than a way to tell the browser that &amp;#x201C;Hey! Organize the UI in this way&amp;#x201D;. So in effect, HTML can also be considered as a formatting mechanism used to format the UI on browser. I always wondered what if I want to have a UI that is not represented by any of the available elements&amp;#x2026; then the basics of composition (nesting in HTML) solved the purpose. So, if we want to create a UI that is not represented by any standard element in HTML, we can create the required UI by combining the basic HTML elements in appropriate form.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;The browsers evolved in terms of the capabilities, they started understanding DHTML elements also for some moving UI, then browsers also supported scripting languages like JavaScript for both making UI flexible as well as interacting with end user and manipulating HTML elements. Then came more advanced capabilities in browser like asynchronous client script callbacks, XMLHTTP etc which led to cropping up of many new technologies similar to AJAX.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;Still, I feel a bit limited in the way I program windows application and a web application. The complexity becomes even more complex when we have to do the multimedia, animation etc. IMHO, the primary reasons to why web programming is still complex are following:     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpFirst" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;span style="font-size: 9.5pt; color: #333333; line-height: 115%; font-family: &amp;#x27;Arial&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;; mso-fareast-font-family: arial; mso-bidi-font-size: 10.0pt"&gt;&lt;span style="mso-list: ignore"&gt;1.&lt;span style="font: 7pt &amp;#x27;Times New Roman&amp;#x27;"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;There are two sides of the web programming framework, client and server. Both talk to each other using http. HTTP has inherent problems like being stateless etc. and we came up with different solutions (rather patches like session state etc.).     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpMiddle" style="margin: 0in 0in 0pt 0.5in; text-indent: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;span style="font-size: 9.5pt; color: #333333; line-height: 115%; font-family: &amp;#x27;Arial&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;; mso-fareast-font-family: arial; mso-bidi-font-size: 10.0pt"&gt;&lt;span style="mso-list: ignore"&gt;2.&lt;span style="font: 7pt &amp;#x27;Times New Roman&amp;#x27;"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;Handling end user interactions involve either roundtrips (which has another set of drawbacks) or through client side languages like JavaScript etc. This personally makes me hesitant in doing more things at client side and instead delegating it to server side. We can do stuff like asynchronous callbacks etc. but they again require lots of plumbing.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoListParagraphCxSpLast" style="margin: 0in 0in 10pt 0.5in; text-indent: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;span style="font-size: 9.5pt; color: #333333; line-height: 115%; font-family: &amp;#x27;Arial&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;; mso-fareast-font-family: arial; mso-bidi-font-size: 10.0pt"&gt;&lt;span style="mso-list: ignore"&gt;3.&lt;span style="font: 7pt &amp;#x27;Times New Roman&amp;#x27;"&gt;&amp;#xA0;&amp;#xA0;&amp;#xA0;&amp;#xA0; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;The UI controls of web programming are less rich than the windows programming because we have to get limited by the capabilities that browser provides. We really cannot do anything beyond what browser permits even if .NET or any server side platform has immense capabilities.      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;These and many other factors make web programming a little poor.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;For me, most of the problems will be solved if we have the same capabilities on client side that we have at server side. So that said, if we have .NET on client side as well, we just need to program the application the way we used to and the application will run at server side similar to a windows application.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;In this attempt Microsoft started off with smart client applications (click once) with added benefits like automatic updates etc. Great! But they did not pick success in developer world since not all clients are expected to have a .NET framework installed.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;To overcome this functionality, Microsoft designed a new .NET framework which they called as Silver Light and this is a small size, mini version of .NET framework that can be installed on client side as a plug-in to most of the modern browsers. This mini .NET framework was geared towards making UI at client side more attractive and is currently oriented to provide the multimedia and animation capabilities on browsers similar to technologies like flash.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;However I see this from a different angle because this makes me program it in a better way and appreciate the vision.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;When I install Silver Light on a browser apart from considering as if I have the power of .NET at client side, I also look it as increasing the capability of browser all of a sudden. I install Silver Light and Boom! &amp;#x2013; My browser can now support more tags than ever before. Apart from understanding &amp;lt;HTML&amp;gt; &amp;lt;HEAD&amp;gt; &amp;lt;TABLE&amp;gt; etc. it will now also understand &amp;lt;CANVAS&amp;gt; &amp;lt;BRUSH&amp;gt;&amp;lt;TEXTBLOCK&amp;gt; and many more. Now I don&amp;#x2019;t have to peek around for getting things done for my complex requirements but instead, now I have increased the element set of browser. Not only the element set; now I can also use either Java Script or my favorite C#. Isn&amp;#x2019;t this great? Well for me this is like a phenomenon.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;     &lt;p&gt;&amp;#xA0;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;The following diagram illustrates this more clearly:&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&amp;#xA0;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;&lt;/span&gt;&amp;#xA0;&lt;a href="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Silverlight_28FA/SilverLight_2.jpg"&gt;&lt;img id="id" style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="180" alt="SilverLight" src="http://blogs.msdn.com/blogfiles/rahul/WindowsLiveWriter/Silverlight_28FA/SilverLight_thumb.jpg" width="252" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;&lt;/span&gt;&amp;#xA0;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;We can see that Inside the DOM we have another DOM like object model which is the Silver Light Object Model. The tags that we write in DOM are called HTML while the tags that we write inside the Silver Light DOM are called XAML. Simple! Now just learn XAML and the way to access XAML and HTML elements using C# and we are set to program Silver Light.     &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;     &lt;p&gt;&amp;#xA0;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;Though Silver Light holds lots of promises for developers in its current stage it&amp;#x2019;s fighting with some initial hiccups like, right now we cannot use C# but instead we will have to still use JavaScript in the 1.0 version. However in Alpha version we can write in .NET compliant languages like C#, etc.      &lt;p&gt;&lt;/p&gt;   &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;Moreover, at present, Silver Light is geared for Multimedia but we can see more controls in Silver Light class library to have most of the capabilities of any windows application. To me Silver Light holds promise for next generation Mash ups in web 2.0 or S+S world since it holds most capabilities and flexibility out of all the available development technologies from Microsoft.&lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal" style="margin: 0in 0in 10pt"&gt;&lt;span style="font-size: 10pt; line-height: 115%; font-family: &amp;#x27;Tahoma&amp;#x27;,&amp;#x27;sans-serif&amp;#x27;"&gt;Rahul's&lt;/span&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4633244" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author><category term="Concepts" scheme="http://blogs.msdn.com/rahul/archive/tags/Concepts/default.aspx" /><category term="Evolution" scheme="http://blogs.msdn.com/rahul/archive/tags/Evolution/default.aspx" /><category term="Introduction" scheme="http://blogs.msdn.com/rahul/archive/tags/Introduction/default.aspx" /><category term="Fundamentals" scheme="http://blogs.msdn.com/rahul/archive/tags/Fundamentals/default.aspx" /><category term="Architecture" scheme="http://blogs.msdn.com/rahul/archive/tags/Architecture/default.aspx" /><category term="Silverlight" scheme="http://blogs.msdn.com/rahul/archive/tags/Silverlight/default.aspx" /></entry><entry><title>SaaS-Value Proposition</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2007/07/24/saas-value-proposition.aspx" /><id>http://blogs.msdn.com/rahul/archive/2007/07/24/saas-value-proposition.aspx</id><published>2007-07-25T01:13:00Z</published><updated>2007-07-25T01:13:00Z</updated><content type="html">&lt;DIV style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: medium none; PADDING-LEFT: 0in; PADDING-BOTTOM: 4pt; BORDER-LEFT: medium none; PADDING-TOP: 0in; BORDER-BOTTOM: #4f81bd 1pt solid; mso-element: para-border-div; mso-border-bottom-themecolor: accent1"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Is the Total Cost of Ownership of a SaaS application really low than a traditional application for an end user?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;SaaS is buzzword in today’s delivery model of software. Many ISVs are hastily looking for converting their existing traditional applications on to the SaaS strategy. Once the product finally moves onto SaaS delivery model, then starts the process of attracting customers/end-users. The primary reason that customers (especially SMBs) are told to move to the SaaS product is that the total cost of ownership is low for them. The tenants don’t have to invest on the hardware, maintenance, employing IT staff etc. Moreover, customers are charged on per month/pay as use etc. model. SaaS offers so much of flexibility in terms of acquiring the software that customers fall prey of SaaS product immediately. The value proposition of TCO is so much tempting. That’s a good thing but at the same time this value proposition is basically confusing the customers about the other value propositions about SaaS. Not only this, at few instance the value proposition of TCO is actually wrong. There has to be a good understanding among both ISVs as well as customers about the concept and philosophy of SaaS in order to fully appreciate the SaaS model. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Let’s talk about the TCO of a SaaS application for a tenant. When a tenant buys a SaaS application, definitely, the TCO is low as compared to its traditional approach version. But how far? If we take an example where the customer is going to use the software for typically longer period it is quite possible (not necessary) that SaaS application will cost the customer much more than the traditional version. It will actually be cheaper for the end user to buy the software, build infrastructure and maintain it rather than paying on a monthly basis. Yes that is true.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;I can give an analogy to the real world to understand the concept. When I go out to another city (maybe for vacation) I will need a vehicle to move around the city. I have two options there, buy a new car for me or hire a cab. Of course since I am there for a less period, the cab will intuitively be a better option. But what if I use cab even in the city where I live? &lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;Definitely as time moves from one year to another and so on, I will realize that buying a Car was a better option. Similar is the concept of SaaS application. In software field, some things change and are not same as the real world of Cabs and Cars. Those differences are the real value proposition for SaaS according to me. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;For example, in software world, our needs/business requirements changes and we will need a framework to accommodate these changes into our existing infrastructure without investing heavily. Of course, it will not be a good idea to get a new version of application according to our business changes. SaaS application is built from ground up keeping these business changes in mind. A SaaS application provides the flexibility to customers to change the business rules.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Among other features that make SaaS approach more valuable include ease of sharing Data to third parties, availability of backup data centers for disaster recovery and, especially for smaller businesses, having access to the enterprise level application services that would be near impossible to achieve in-house. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;Among other benefits of moving to SaaS, if I start counting I see the list endless. Things like achieving on-demand scalability just by a little extra, turning variable cost into fixed costs by delegating the variable costs on to the hosting provider, Integration with other LOB applications… list is endless.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Calibri size=3&gt;The idea that I want to convey here is that for end users cost is not the sole value proposition, but when we look at the total value that SaaS can deliver, SaaS becomes even more compelling.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;Rahul&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4035274" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author><category term="SaaS" scheme="http://blogs.msdn.com/rahul/archive/tags/SaaS/default.aspx" /><category term="TCO" scheme="http://blogs.msdn.com/rahul/archive/tags/TCO/default.aspx" /><category term="why saas" scheme="http://blogs.msdn.com/rahul/archive/tags/why+saas/default.aspx" /><category term="Value Proposition" scheme="http://blogs.msdn.com/rahul/archive/tags/Value+Proposition/default.aspx" /></entry><entry><title>How to SaaS</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/rahul/archive/2007/03/27/how-to-saas.aspx" /><id>http://blogs.msdn.com/rahul/archive/2007/03/27/how-to-saas.aspx</id><published>2007-03-27T22:20:00Z</published><updated>2007-03-27T22:20:00Z</updated><content type="html">&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;This is my first blog entry and I am happy to get this blog meant only for Microsoft Full Time Employees.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Okay coming on&amp;nbsp;to the title for this blog post. Today I am going to write down on Sofware as a Service (SaaS) architecture strategy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;I will un-cover the technical aspects involved in building a SaaS application and very high level overview of the technical aspects of a SaaS solution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;These concepts can be applied to any Application which is a good candidate for a SaaS application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; tab-stops: 113.25pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Contents:&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: Tahoma"&gt;1.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: Tahoma"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;SaaS- Introduction&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: Tahoma"&gt;2.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: Tahoma"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;SaaS -Challenges&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: Tahoma"&gt;3.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: Tahoma"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;SaaS -Solution to challenges&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&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 15pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 36pt; COLOR: #17365d; FONT-FAMILY: 'Cambria','serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial"&gt;SaaS-Introduction&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;A SaaS application can be defines as any “Software deployed as a service and accessed using internet technologies”. In order to realize a SaaS solution (in fact any solution) we need to do two things: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;1.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Build our application which can be used as a service over internet by different clients. This could range from a programmatic service (accessed programmatically by other softwares) to a stand-alone application used by different clients. This step is involves us to follow certain steps that are different than developing a normal “On-Premise” or simply called a non-SaaS application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;Typically when we develop an application (a non-SaaS application) then we do assume two things: &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;Application will be installed at client side (e.g., a desktop application) be it through a CD or downloading via internet. This also implies that the client will have to do the maintenance (like upgrading to new version, apply patches, maintain databases etc.) of application even after he has bought the application (not true for Application Service Provider model). This fact is not true in terms of a web application. So we can say that any web application forms a different category of application since it is not installed at client side. But still we cannot call ANY web application a SaaS application. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&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 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;Application will be served to requirement of a particular client. If another client needs some changes in the application, we will make changes in the application source code and then run another instance of that application for the new client. So in nutshell, we assume that one application is meant for one client only. This assumption is true even for a web application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;Here comes the difference! The core of a SaaS application is based on the opposites of these two (above mentioned) assumptions. The following are assumptions that are true for a SaaS application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;Application will be typically deployed and maintained by a hosting provider. So, clients don’t have to invest in terms of buying hardware resources and employing the IT staff to manage the application. This will be done by the hosting provider.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;Application will be accessed by clients using internet. In special cases where a SaaS application is hosted inside the enterprise itself this is not true but still the clients accessing the hosted application will still use internet technologies to access the application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; TEXT-INDENT: -0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;·&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 7pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: Symbol"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;A single SaaS application (in fact a single database too) serves more than one client having different needs. So the application will be designed in such a way that only a single application instance will be able to provide different functionalities to different clients. This model is more popularly known as Multi-tenant model.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;Among these assumptions, the last assumption related to multi-tenancy requires a SaaS application to be architected in a special way keeping in mind about certain aspects of a multi-tenant application. These aspects form the challenges of building a SaaS application and also our next topic of discussion. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;2.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;SaaS world does not end just by building the application that satisfies SaaS characteristics. Deploying a SaaS application forms another set of challenges. Typically a SaaS application is deployed by a SaaS hosting provider and the hosting provider is responsible of maintaining the application. So, not only clients get rid of maintaining the application but also ISVs get rid of that aspect.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;Microsoft provides end to end resources in developing and deploying a SaaS application. It provides resources ranging from development frameworks and technical resources used to build and design the application to hosting options that assist in deploying the application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 36pt; COLOR: #17365d; FONT-FAMILY: 'Cambria','serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;SaaS-Challenges&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&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 10pt 0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;As we have seen that one of the important characteristics of a SaaS application is multi-tenancy, this aspect implies further challenges in building a SaaS application. Let’s see those challenges after trying to define the multi tenancy.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Multi Tenant Architecture:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;A single SaaS application serves more than one client having different needs. This means that you run only one instance of the application and that single instance will be accessed by all clients. For example, you built a CRM SaaS application and hosted it over a SaaS hosting provider. Now many organizations have different CRM needs depending on the nature of business they do. We will not build any separate application for all the companies but our single application will have the option using which each client will customize the SaaS application according to his need. Not only that a single database can be used (not always) for storing data of different clients. So security is also a major concern. Let’s see all the concerns and challenges that we need to consider while building a SaaS application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 24pt 0in 0pt; LINE-HEIGHT: normal; mso-outline-level: 1"&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 18pt; COLOR: #365f91; FONT-FAMILY: 'Cambria','serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-font-kerning: 18.0pt"&gt;Challenges&lt;/SPAN&gt;&lt;/B&gt;&lt;B&gt;&lt;SPAN style="FONT-SIZE: 24pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 18.0pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Here are some important challenges that we need to consider while building a SaaS application. It is important to note that not all challenges are required in a single SaaS application. These challenges depend on your application’s requirement. Here only the challenges are presented. Next section will deal about ways to address those challenges.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Business Agility:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Different organizations can have (in fact they do have) different business needs. For example process of approving a loan in two banks may be different in a way that Bank-X requires a Loan Manager to approve the loan request document before sanctioning the loan while Bank-Y requires both the Loan Manager and Bank Manager to approve the loan request. Now if we are building a SaaS application to target these different business requirements, then, we must provide a way through which different clients can configure the SaaS application according to their business requirement. This is what we mean by Business Agility (we can call it as ability of an application to configure its business rules).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;User Interface Configurability:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Each client of our SaaS application might have the requirement to change the UI of the application according to their need. This could range from configuring color, font, Company Logo etc. to positioning , ordering of UI elements (for example web parts) etc. incorporating this capability of configuring the UI of a SaaS application according to client’s requirements form another requirement and thus challenge to building a SaaS application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Database configurability:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Since typically a SaaS application uses a single database (not always) for every client, all the data of different clients can be stored in a single database. This approach makes a SaaS application more efficient since only a single database is used but this also poses challenges on how to design the database so that different data model needs can be accommodated in a single database approach. This approach is commonly known as Multi-tenant database.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Security:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Since a single application instance caters to requests of all clients, it is important (in fact a must) that we have some mechanism to make sure that data of each client remains secured and users of a particular client can access data meant for them alone.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scalability:&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;A single application can be used by different clients and each client can have a number of users accessing the SaaS application. This puts a constraint that the application must be able to handle increased number of users. Scalability is a challenge that has to be handles at 3 different levels: The SaaS application (your code) must take care of scalability issues, the SaaS application server (generally done by hosting providers) must be scalable and then finally the database server must be scalable. Scalability at all these three different levels is achieved using different techniques that we will see later on.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&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 15pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 36pt; COLOR: #17365d; FONT-FAMILY: 'Cambria','serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: Arial"&gt;SaaS-Solution to Challenges&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'"&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;We will take all the challenges, discussed in previous section, one at a time and propose techniques used to address these challenges. To some techniques we will provide the direct links to already existing resources instead of dwelling those techniques in detail out here.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Business Agility:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;This aspect involves designing your SaaS application architecture in such a way that clients of the application can modify the business logic written in your application. Now, how do we provide the modification of business logic of application without writing new code or even modifying existing code?&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The most commonly used approach is Metadata driven architecture. Let’s see how it work and what ways (maybe tools etc.) do Microsoft helps in designing such applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Concept of metadata driven architecture is quite simple and complex aspects are handled by Microsoft technologies and tools. In a metadata driven system there are three major steps involved:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l3 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Metadata: Whatever features of an application are to be configured during runtime, we define those features of the application in the form of Metadata (it could be an XML file stored on hard drive or a backend database). This metadata can be extended by writing more data to it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l3 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Metadata Services: A set of programmatically accessible services are designed that provides an interface to access/modify the metadata. This can be thought of as an interface layer or façade layer. We provide these services so that metadata can be exposed (maybe over internet) to any application/tool while keeping the integrity, validity etc. of the metadata intact. Imagine a situation where an application (by mistake) modified the metadata that violates some core semantics of metadata. Providing an interface layer to any data store is a common principle in building a distributed application and any SaaS application is on first place a distributed application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l3 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;An Engine: The business layer of our SaaS application will be nothing more than an engine that runs the business processes defined in the metadata store and accessed using metadata services. These steps could be a bit complex depending on the configurability requirement of your SaaS application therefore Microsoft provides a number of options to build such systems.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt 0.25in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Most commonly used technology is using BizTalk Server. BizTalk server has two main components:&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1 start=3&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; tab-stops: list 1.0in; mso-list: l2 level2 lfo2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;A process execution engine that manages the steps, applies the business logic, and invokes the supporting applications of a complex process and/or transaction set.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal; tab-stops: list 1.0in; mso-list: l2 level2 lfo2"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;A multi-transport messaging hub for transforming and routing information to and from applications and process steps.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Another technology seen by developers in their most loved development environment (Visual Studio) is Windows Workflow Foundation (Part of .NET Framework 3.0) used to model business processes as workflows.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Yet another technology from Microsoft is Microsoft Web Services used to build Service oriented applications which in turn is essential to deliver the business agility and IT .&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;For more details on these technologies you can refer to following resources:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://www.dmreview.com/article_sub.cfm?articleId=1075079"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://www.dmreview.com/article_sub.cfm?articleId=1075079&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://www.microsoft.com/technet/prodtechnol/biztalk/biztalk2004/planning/business-rules-framework-overview.mspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://www.microsoft.com/technet/prodtechnol/biztalk/biztalk2004/planning/business-rules-framework-overview.mspx&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://www.microsoft.com/technet/prodtechnol/biztalk/biztalk2004/planning/bpm-solution-overview.mspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://www.microsoft.com/technet/prodtechnol/biztalk/biztalk2004/planning/bpm-solution-overview.mspx&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/architecture/aa699456.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/architecture/aa699456.aspx&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/architecture/aa948857.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/architecture/aa948857.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;User Interface Configurability:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The process involved in allowing end users to modify the user interface according to their need is similar to achieving Business Agility- Using Metadata Driven Architecture. End-user preferences are stored in form of Metadata and UI is composed using this metadata. User interface metadata defines connections into user interface elements, such as menus, Windows Forms controls, and HTML.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms954610.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/library/ms954610.aspx&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://www.microsoft.com/technet/solutionaccelerators/cits/iwp/ibf/soldev/moibf1_sdg_07.mspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://www.microsoft.com/technet/solutionaccelerators/cits/iwp/ibf/soldev/moibf1_sdg_07.mspx&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa480019.aspx#aj1metadat_topic13"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/library/aa480019.aspx#aj1metadat_topic13&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/ms136029.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/library/ms136029.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Database Configurability:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;For a SaaS application we can use different databases for each client and also use single database for every client depending on the need of the application. This asks us to design a &lt;SPAN style="COLOR: black"&gt;Multi-Tenant Data Architecture (where tenant is equivalent to client).&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;This involves choosing an approach to in a given scenario and also how to realize that approach. There is a very good article dedicated to developing a Multi-Tenant database system. I would recommend going through that article while going to develop the data model for your application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa479086.aspx#mlttntda_topic4"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/library/aa479086.aspx#mlttntda_topic4&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Arcast:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://www.skyscrapr.net/blogs/arcasts/archive/2006/07/18/232.aspx"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://www.skyscrapr.net/blogs/arcasts/archive/2006/07/18/232.aspx&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Security: (Most of the content of this heading is from the famous Catching the Long Tail article)&lt;/SPAN&gt;&lt;/B&gt;&lt;SPAN style="FONT-SIZE: 12pt; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;As we discussed earlier, security is an important aspect of a SaaS application (in fact any application). Security requires special attention for a SaaS application because a single application instance is serving different clients. This poses two major challenges:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL style="MARGIN-TOP: 0in" type=1&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 10pt; COLOR: black; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l1 level1 lfo3"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;How will the administrative tasks related to security handles? For example, creating new users, security policies, and permissions etc. for every client is obviously different.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 10pt; COLOR: black; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l1 level1 lfo3"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;How to keep client specific request secured? This also involves keeping data for clients secured even if we have data for different clients in same table.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;There are different techniques and patterns such as filtering, encryption etc. Let’s see an overview of how are security requirements handles by a SaaS application.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Common approach is to create security services for the application. So security is also applied in the form of services (sole reason is to incorporate the distinct requirement of SaaS application). SaaS application is built on the foundations of SOA (service oriented architecture) and services are building blocks of any SOA application.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Typically we divide security services into two components:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 10pt; COLOR: black; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l0 level1 lfo4"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Authentication Services&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 10pt; COLOR: black; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l0 level1 lfo4"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Authorization Services&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;The SaaS provider typically delegates to each tenant the responsibility for creating and maintaining its own user accounts, a process known as &lt;I&gt;delegated administration&lt;/I&gt;. Delegated administration creates a situation in which the customer is responsible for creating individual user accounts, but the vendor has to authenticate them. To accommodate this delegated-administration model, SaaS designers use two general approaches for handling authentication: a centralized authentication system, or a decentralized authentication system. The approach that you choose will have ramifications for the complexity of your architecture and the way end users experience the application, and you should consider what your business model says about the needs of the application, customers, and end users when making a decision.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;In a centralized authentication system, the provider manages a central user account database that serves all of the application's tenants. Each tenant's administrator is granted permission to create, manage, and delete user accounts for that tenant in the user account directory. A user signing on to the application provides his or her credentials to the application, which authenticates the credentials against the central directory and grants the user access if the credentials are valid.&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;This approach requires a relatively simple authentication infrastructure that is comparatively easy to design and implement, and that does not require any changes to the tenant's own user infrastructure. An important disadvantage to this approach is that a centralized authentication system makes it much more difficult to implement &lt;I&gt;single sign-on&lt;/I&gt;, in which the application accepts the credentials that the user has already entered to gain access to his or her corporate network. Without single sign-on, users are frequently presented with an inconvenient login prompt when logging in to the application, and they must enter their credentials manually.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;In a decentralized authentication system, the tenant deploys a federation service that interfaces with the tenant's own user directory service. When an end user attempts to access the application, the federation service authenticates the user locally and issues a security token, which the SaaS provider's authentication system accepts and allows the user to access the application &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&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 10pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;This is an ideal approach when single sign-on is important, because authentication is handled behind the scenes, and it doesn't require the user to remember and enter a special set of credentials. The decentralized approach is more complex than the centralized approach, however, and a SaaS application with thousands of customers will require individual trust relationships with each of the thousands of tenant federation services.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;In many cases, the SaaS provider may want to consider a hybrid approach—using the centralized approach to authenticate and manage users of smaller tenants, and the federated approach for larger enterprises that demand, and will pay for, the single sign-on experience.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;To understand more about security concepts and how to apply them you can refer following resources:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://download.microsoft.com/download/5/c/4/5c49d9c8-a3e9-4806-8c6d-a621b8d2402b/Windows-basedHosting_CentralizedManagement.doc"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://download.microsoft.com/download/5/c/4/5c49d9c8-a3e9-4806-8c6d-a621b8d2402b/Windows-basedHosting_CentralizedManagement.doc&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://www.microsoft.com/technet/security/guidance/identitymanagement/idmanage/P1Fund_4.mspx?mfr=true"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://www.microsoft.com/technet/security/guidance/identitymanagement/idmanage/P1Fund_4.mspx?mfr=true&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;To configure security at database level use guidelines given in following resource:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa479086.aspx#mlttntda_topic4"&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/library/aa479086.aspx#mlttntda_topic4&lt;/SPAN&gt;&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&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 10pt; LINE-HEIGHT: normal"&gt;&lt;B style="mso-bidi-font-weight: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scalability:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scalability refers to the capability of an application to handle large concurrent requests. There are two approaches generally used to scale an application:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scale Up: &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scaling-up is process of upgrading the existing computer. For example, you can upgrade your Server computer from a 4 processor machine to an 8 processor. &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scale Out: &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scaling-out is the process of adding additional computers. This ways if a server reaches its maximum number of requests, another server takes up further requests. SaaS solutions generally use Scale out. &lt;SPAN style="TEXT-TRANSFORM: uppercase"&gt;A &lt;/SPAN&gt;Common techniques used for scaling out is clustering.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scaling an application can typically be done at 3 levels:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL style="MARGIN-TOP: 0in" type=disc&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l4 level1 lfo5"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scaling the backend database&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l4 level1 lfo5"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scaling the Web Server on which the web application is running (scale up and scale out)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: list .5in; mso-list: l4 level1 lfo5"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scaling the application itself&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal; tab-stops: list .5in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Please refer to following resources to learn about different scaling techniques:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&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 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scaling SQL Server:&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="https://aps.mail.microsoft.com/OWA/redir.aspx?URL=http%3a%2f%2fwww.microsoft.com%2fsql%2fprodinfo%2fpreviousversions%2fscalability.mspx" target=_blank&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://www.microsoft.com/sql/prodinfo/previousversions/scalability.mspx&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Techniques used for scaling application:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;A href="https://aps.mail.microsoft.com/OWA/redir.aspx?URL=http%3a%2f%2ftechnet2.microsoft.com%2fWindowsServer%2fen%2flibrary%2f4842d992-2b2f-41f8-b681-3696c6b23d5c1033.mspx%3fmfr%3dtrue" target=_blank&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://technet2.microsoft.com/WindowsServer/en/library/4842d992-2b2f-41f8-b681-3696c6b23d5c1033.mspx?mfr=true&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Architecture and design review of application for scalability&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="https://aps.mail.microsoft.com/OWA/redir.aspx?URL=http%3a%2f%2fmsdn2.microsoft.com%2fen-us%2flibrary%2fms998544.aspx" target=_blank&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/library/ms998544.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;A href="https://aps.mail.microsoft.com/OWA/redir.aspx?URL=http%3a%2f%2fmsdn2.microsoft.com%2fen-us%2flibrary%2faa479040.aspx" target=_blank&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://msdn2.microsoft.com/en-us/library/aa479040.aspx&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Another good resource on scaling&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;A href="https://aps.mail.microsoft.com/OWA/redir.aspx?URL=http%3a%2f%2fdownload.microsoft.com%2fdownload%2fa%2f7%2fe%2fa7ea6fd9-2f56-439e-a8de-024c968f26d1%2fScaleNet.pdf" target=_blank&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://download.microsoft.com/download/a/7/e/a7ea6fd9-2f56-439e-a8de-024c968f26d1/ScaleNet.pdf&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Scaling the Web Server:&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Good resource on Scaling a Microsoft® Windows® Server 2003 running IIS 6 (also included is a case study of scaling an asp.net website on IIS 6.0)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;A href="https://aps.mail.microsoft.com/OWA/redir.aspx?URL=http%3a%2f%2ftechnet2.microsoft.com%2fWindowsServer%2fen%2flibrary%2f12dc2cfc-9b2f-480d-9838-892a135e7ff11033.mspx%3fmfr%3dtrue" target=_blank&gt;&lt;SPAN style="COLOR: blue; mso-bidi-font-size: 11.0pt"&gt;http://technet2.microsoft.com/WindowsServer/en/library/12dc2cfc-9b2f-480d-9838-892a135e7ff11033.mspx?mfr=true&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.3in; TEXT-INDENT: -0.3in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;I will keep posting new entries on SaaS in future.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.3in; TEXT-INDENT: -0.3in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Please let me know your comments/questions.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt 0.3in; TEXT-INDENT: -0.3in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&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 0.3in; TEXT-INDENT: -0.3in; LINE-HEIGHT: normal"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','sans-serif'; mso-fareast-font-family: 'Times New Roman'"&gt;Rahul's&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1967112" width="1" height="1"&gt;</content><author><name>rahulgangwar</name><uri>http://blogs.msdn.com/members/rahulgangwar.aspx</uri></author><category term="Gangwar" scheme="http://blogs.msdn.com/rahul/archive/tags/Gangwar/default.aspx" /><category term="Software" scheme="http://blogs.msdn.com/rahul/archive/tags/Software/default.aspx" /><category term="Rahul" scheme="http://blogs.msdn.com/rahul/archive/tags/Rahul/default.aspx" /><category term="SaaS" scheme="http://blogs.msdn.com/rahul/archive/tags/SaaS/default.aspx" /><category term="Service" scheme="http://blogs.msdn.com/rahul/archive/tags/Service/default.aspx" /></entry></feed>