Background What differentiates a workflow from a typical process written in code is the ability of multiple actors (human or otherwise) to interact with the long-running workflow process during the course of execution. This allows the executing process to behave in a manner that external actors want it to, as opposed to just performing a sequence of operations along a single pre-defined path. The rule-of-thumb while choosing between Sequential and State-Machine Workflows is based on a simple premise based on the scenario for which the workflow is being created:
Sequential Workflow: Use when a pre-defined sequence of activities need to be executed, involving no external input, and the only repetitive activity executions are through loops.
State-Machine Workflow: Use when external actors are involved, causing the workflow to stop and wait for input from the actor. Also use if the same activity needs to be executed multiple times based on a user-input or external event during the course of workflow execution.
Note: You can choose to use a Sequential workflow even when external actor interaction is involved. However, this will not allow you to jump to another activity, other than the one next in the sequence.
Developing a State-Machine workflow in Visual Studio 2005 Read the following posts to learn how to develop a state-machine workflow in VS 2005.
Apart from the workflow code file (*.cs and/or *.xoml), the workflow project should include the following files:
feature.xml (Contains information about the SharePoint feature)
workflow.xml (Specifies the workflow properties for the SharePoint feature)
PostBuildActions.bat (A batch file executed as a Post-build event inside Visual Studio that creates a sub-folder in the 'FEATURES' directory under 12 hive [C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE] and copies feature.xml and workflow.xml files into it; also executes the stsadm command to activate the deployed feature on a SharePoint site)
Note: You can avoid creating the PostBuildActions.bat file if you use WSPBuilder to generate a SharePoint solution file (*.wsp) and deploy it from within the VS2005 environment.
The life-cycle of a workflow involves the following stages:
Development: Visually creating the workflow in VS2005/VS2008 Workflow Designer and writing code for each activity. Also includes creating workflow.xml, feature.xml, and PostBuildActions.bat
Deployment: Deploying the workflow to a SharePoint Server farm and activating it either using the PostBuildActions.bat batch file or using WSPBuilder. In either case, a new folder is created in the FEATURES directory (explained above), the workflow.xml & feature.xml files are copied to it, the workflow assembly (*.dll) is installed into the GAC or copied to the Virtual Directory's bin folder, and the stsadm command is used to activate the feature
Association: Attaching the workflow to a list or content type and specifying when a new workflow instance should kick-off; either manually, OR automatically when a new item is created and/or updated.
Execution:This stage involves the following sub-stages
Initiation: This is the first stage for any workflow instance, happens ONLY once during the course of execution, and is marked by firing of the OnWorkflowActivated event.
Passivation or De-hydration: This is the process of persisting the workflow instance to a datastore so that it can subsequently re-loaded into memory for further execution. Also, passivation or dehydration occurs when the workflow instance wants to wait for an external input or event to execute further.
Re-hydration: This stage involves the workflow instance being loaded back into memory by the workflow engine, after a user input is received OR an external event fires.
Activity Execution: This is characterized by the workflow engine executing the code in each of the workflow activities in the defined sequence, or transitioning states in case of a state-machine workflow.
Modification: This stage is optional, but it allows workflow actors to inject new values into the workflow instance while it is in execution to alter its behavior. This also entails that the workflow has the logic built into it to process the new values.
Completion: The competion stage is marked by the workflow instance completing execution successfully, and the status being written to the data store.
Termination: This stage refers to the workflow instance stopping abruptly due to an internal error, or an actor explicitly ending the workflow instance. Any data written to the list by the workflow instance is NOT rolled-back if the workflow is terminated. Terminated workflows cannot be restarted again.
Having got the above off my chest, lets delve into how users (workflow actors) interact with the workflow.
Workflow Forms Workflows Forms (as the name implies) are typical forms that allow user input to be communicated to the workflow. In addition, workflow forms also allow data within the workflow to be presented to the actor so that they can take appropriate action. The 4 types of workflow forms that can be created are:
Association Forms: Displayed to the user at the time the workflow is being associated to a list or content type to allow user to enter any additional values that can be used in the workflow association process.
Initiation Forms: When the users initiates a workflow instance, the Initiation Form is displayed to allow entry of additional parameter values that the workflow instance can process during execution.
Modification Forms: Modofication forms are displayed either when the workflow instance encounters the EnableWorkflowModification activity, OR the user clicks the Modification link on the workflow status page.
Task Forms: During execution, a workflow creates tasks in the Tasks List that tell the user what they need to do, and in most cases, move the workflow forward when a task is marked as complete. From the users' perspective, tasks enable them to know where the workflow stands, and what needs to be done to get to the next process in the flow sequence.
In my next post, I will cover how to develop each of the Workflow forms in a state-machine workflow using both ASP.NET and Microsoft InfoPath 2007.
In my previous post, I gave an overview of how to mimic State Machine behavior using sequential workflows developed in SharePoint Designer (SPD) 2007. This post is actually a walk-thru of the development process in SPD 2007.
Create Lists Create the following 2 lists (See description in previous post cited above):
Core.NET Content (Document Library)
Core.NET Approval Workflows (Custom List with following columns)
Title: Single line of text
File URL: Hyperlink or Picture
Workflow Status: Choice (with following choice values)
Content Analyst: User
Awaiting Approval
Pending Analysis & Review
Awaiting Approval
Approved
Create 'Approval Initiation Workflow' on the 'Core.NET Content' list Open an instance of SharePoint Designer 2007 on your machine. Go to File > Open Site... and enter the URL for the site you created the lists on. Go to File > New... > Workflow..., enter Approval Initiation Workflow as the name of the workflow, and select Core.NET Content from the drop down list. Make sure that only the second checkbox (Automatically start this workflow when a new item is created) is checked, and click Next .
Create workflow action to insert an item into the second list Enter Initiate Approval process for uploaded content as the Step Name. Click the Actions dropdown button and select Create List Item from the dropdown. Click the this list link on the action, select the Core.NET Approval Workflows list from the drop down at the top of the 'Create New List Item' dialog, and specify the values for each of the columns as shown below:
Title = Core.NET Content:Name
File URL = Core.NET Content:URL Path
Workflow Status = Awaiting Assignment
Click the Finish button to publish the workflow.
The above step simply takes values from the document library (Core.NET Content) and inserts into the Core.NET Approval Workflows list. We now turn our focus to the other list, and the second workflow.
Create 'Approval Process Workflow' on the 'Core.NET Approval Workflows' list Create the workflow as below; enter Approval Process Workflow as the name of the workflow, and select 'Core.NET Approval Workflows' list from the drop-down. Make usre that the last 2 checkboxes (Automatically start this workflow when a new item is created + Automatically start this workflow whenever an item is changed) are checked.
Create Variables for the workflow Click the Variables... button in the Workflow Designer window, and create variables as below:
The 'Approval Process Workflow' will consist of the following 3 steps:
Get Workflow Data
Process Workflow Status
Process Approval/Rejection by Manager
Update Workflow Status
Note: By updating the list in the very last step, the subsequent instance of the workflow (started on item update) can kick off immediately. If the current workflow updates the list while it still has some more activities to perform, the second workflow fails.
An explanation of each of the step follows:
Step 0: Terminate Workflow if already approved This step is optional, hence I did not include it in the above list of steps. It simply checks to see if the item has already been approved, and if it is, terminates the workflow using the Stop Workflow activity.
Step 1: Get Workflow Data This step simply intializes the values of the variables and comprises the following 2 steps:
Set the ContentAnalyst variable to the value of the Content Analyst column in the Current item. (This value will be empty when the first instance executes)
Initialize the UpdateStatus variable to 'No'.
Step 2: Process Workflow Status This step relies on IF condition activities to process the workflow according to the Workflow Status for that particular instance of the workflow.
Refer to the diagram above; starting from the top
The first time the workflow executes, the status is set to Awaiting Assignment, causing ONLY the Actions for the first Condition to execute. The action themselves are pretty straight-forward and self-explanatory.
The second condition (where status equals 'Pending Analysis & Review') may be true a number of times, depending on the number of times the manager rejects the document.
Just like the second condition, this may be true multiple times depending on the number of times the workflow was submitted to the manager for approval.
Alternatively, you can also add a condition here to check if the workflow status is set if 'Approved', and terminate the workflow (as shown below).
Note: You can get the user input for a 'Collect Data from a User' action by simply referencing the column of the Tasks list named after that specific input you specified in the 'Custom Task Wizard' dialog.
Step 3: Process Approval/Rejection by Manager This step was included since its not possible to have a nested IF statement in the Actions sections of a step.
Either one of the conditions can only be true if and only if the workflow status is Awaiting Approval. If the Manager APPROVED the document, the NewStatus variable is set to Approved, if the Manager REJECTED the content document, the NewStatus variable is set to Pending Analysis & Review, sending the workflow back to the Analyst specified by the Repository Manager.
Step 4: Update Workflow Status This step MUST execute at the very end, to allow the successful termination of the current workflow instance and initiation of the subsequent workflow instance. Also, the UpdateStatus variable was explicitly set to 'No' at the very start of the workflow instance, and unless a step hasn't set it to 'Yes', the update action in this step will not execute.
This step updates the 'Workflow Status' column to the value in the NewStatus variable, and the 'Content Analyst' column to the value in the ContentAnalyst variable (shown below).
Sequential workflows are fairly straight forward to create whether you are developing in Visual Studio (VS) or SharePoint Designer (SPD) 2007 and can be used to model most single or multi-step approval workflows. The only downside to Sequential workflows is that you cannot make the workflow jump back to a previous step/activity that may or may not have already executed or, in other words, cannot move from being in one state to the other like a state machine workflow. For most workflow developers/creators, this is reason enough to go for workflow development in VS. While VS worksflows work just the same as those develped using SPD 2007, keep in mind that SPD 2007 is more suited for managers and/or business analysts (non-developers) who may be reluctant to assign workflow development task because of time, resource, and budgetary constraints. This is where the following intuitive solution may come in handy. Lets look at a hypothetical scenario in detail.
Scenario: A technical document needs to be analyzed, revised (if need be), and approved to exist in the repository.
Actors:
Repository Managers
Content Analysts
Managers
Workflow (see state-machine diagram above):
Document Uploaded to MOSS 2007 Document Library. [Document Status updated to Awaiting Assignment]
Repository Manager assigns document to Content Analyst. [Document Status updated to Pending Analysis & Review]
Analyst views documents, makes required changes, and submits document to Manager for approval. [Document Status updated to Awaiting Approval]
If Manager rejects document, document routed to Content Analyst. [Document Status updated to Pending Analysis & Review]
If Manager approves document, it is kept in the document library. [Document Status updated to Approved]
The above workflow is pretty straight-forward, and could easily have been created using SharePoint Designer if it were not for step 4, which can happen any number of times until the document gets approved by the Manager. To create a State Machine behavior in a SPD 2007 workflow, create a separate list (say "Content Approval Workflows") to maintain the state of the workflow at any given point in time. A separate list also ensures that the user cannot go and manually change the status. Also, 2 workflows would need to be created; one on the actual document library (called "Core.NET Content") that houses the uploaded documents, and the other on the Content Approval Workflows list. The 2 lists we are working with are summarized below:
Core.NET Content List Type: Document Library Workflow Name: Approval Initiation Workflow Workflow Executed: On Item creation
Core.NET Approval Workflows List Type: Custom List Workflow Name: Approval Processing Workflow Workflow Executed: On Item creation ; On Item update
Columns: Title, Document Status (Choice Column with each of the workflow states), WorkflowInstance Id (Lookup column that references ID column in the Core.NET Content document library)
To get an even better idea, take a look at the following diagram.
The steps modeled in the diagram above are:
Document uploaded to Core.NET Content Document Library.
Item creation in Core.NET Content Document Library kicks off Approval Initiation Workflow which creates an item in the Content Approval Workflows list (with the Document Status value set to "Awaiting Assignment") and completes.
Creation of item in Content Approval Workflows list kicks off the Approval Processing Workflow that performs the following operations recursively i.e. completion of every step below updates the Document Status column value and in-turn starts another Approval Processing Workflow instance on the same item.
Start on item creation - If Document Status is "Awaiting Assignment", create a task in the Tasks list for Repository Managers, using the "Collect Feedback from user" activity, assign the task to the username entered in the task, and set the Document Status value to "Pending Analysis & Review".
Start on item update - If Document Status is "Pending Analysis & Review", create a task in the Tasks list for the user in the Content Analysts group who was assigned the Analysis & Review task in the preceding step, using the "Collect Feedback from user" activity, and set the Document Status value to "Awaiting Approval" when the user clicks the "Complete Task" button.
Start on item update - If Document Status is "Awaiting Approval", create an approval task in the Tasks list for Managers using the "Collect Feedback from user" activity, to either approve or reject the document. If Manager approves the document, set the Document Status value to "Approved", else set the Document Status value to "Pending Review & Analysis" which re-starts the workflow from step 3-2.
Note: The IF condition on every step ensures that the workflow takes only one path depending on the value for Document Status. Also, using the "Collect Feedback" activity in SPD 2007 ensures that the workflow stay in the wait state until the actor specifies the required input, and clicks the "Complete Task" button.
[UPDATE: Read the process of creating the State-machine workflow using SharePoint Designer 2007 in the following post here]
With physical presence at Lahore and Islamabad in addition to Karachi, the Pakistan Developer Conference 2007 would be the biggest annual developer event in the country.
Register now! I hope to see you there in Lahore and Karachi.
I blogged about SitePal a long time ago. I am blogging about it again, since I now have a demo account. This post is more of a strategy guide than a technology roadmap. If you have a Flash player installed (or you are reading this post while the demo account is still valid and active), you will be able to see (and hear) it on the right sidebar of my blog.
The technology news coming out of the World Economic Forum that concluded in Davos, Switzerland not very long ago, was abuzz with talk of Web 2.0. The essence of Web 2.0 are Rich Internet Applications that give users not only a rich user experience, but which may in fact comprise of data and services from many other 3rd party websites and online resouces.
In the Web 2.0 world, businesses increasingly have to rely on setting themselves apart through a mixture of content and design to ensure a continued audience and user-base. While the SitePal you see on the right is just a small demonstration of what websites can achieve using this technology, a SitePal can achieve a lot more for your online service than just playing a welcome message. Apart from its obvious usage on Social Networking sites, a SitePal can be leveraged in teaching students online, and for assisting users on insurance, healthcare, or recruitment wesbites. Imagine a website where students learn chemistry from Harry Potter, physics from Dexter, and computer programming from Jimmy Neutron; OR in a completely different scenario, allowing senior citizens to hear about diabetes, cancer, and health insurance benefits from a doctor SitePal, without having to read long text from a website or printed brochure.
The process of creating a SitePal character is pretty straight forward too. The tutorial movie on the SitePal website provides an easy-to-follow walk-thru of setting up and hosting a SitePal character. An existing SitePal character can be modified literally within seconds. I modified the current SitePal character on this blog within minutes, and amazingly, she looked completely different (see picture below). [Since I am very fond of blondes with glasses, I ended up using the previous version].
SitePal is not just limited to webpages. You can also embed a SitePal character into your PowerPoint presentation, taking interactivity to a whole new level.
Try it out for yourself. Certainly reminds one of S1m0ne (Simone), doesn't it?
Oh boy! I have a lot of things to blog about, mainly posts on "Atlas [now ASP.NET AJAX Extensions] at last" and "MS Speech Application SDK". My reason for staying away from blogging was that I was buried in a project in Pakistan till December 2006, after I came back from the MVP Open Days in Turkey in September. Anyway, I have just shifted to USA, and will try to blog regularly from now on.
As developers (and architects) come to terms with the changes that would come with LINQ and the ADO.NET Entity Framework, and the impact it would have on business applications, many existing applications developed or ported to C# 2.0 or VB 8.0 from previous version would never be able to exploit its benefits. Architects and developers working on new software applications or application functionality, however, can make the wise choice of using the Web Service Software Factory to generate business entities, and expose them through web services. (more on that coming up in future posts, HOPEFULLY).
Hardly any developer would want to be bogged down with writing business object classes to represent the entity tables in an enterprise application. The alterative for O/R Mapping, in most cases, is to turn to techniques for code generation, that allow generation of business object code for data access; NHibernate being one of the most popular ones.
SubSonic is yet another O/R Mapper or DAL code generator on the horizon, and does not involve using a separate application for code generation. All the developer needs to do to use SubSonic is add a reference to the actionpack.dll file and add some tags to the web.config file, and thats it. Even more amazing is the fact that SubSonic allows developers to swiftly generate web pages for inserting, updating, and deleting records in the table, kind of like the ones used in administration sections of most websites. Check out the SubSonic site to learn more.
Without a doubt, code generation can give development teams a head-start, when it comes to rapidly generating business entities as soon as they have a database design in place. However, a fact that is often overlooked in enterprise applications, when there are literally hundreds of tables the code needs to be generated for, is that business entities seem to loose their original meaning, and instead exist only as code stubs for data access logic pertaining to the tables they were created for. The same thing happens if you use strongly typed datasets to represent business entities.
A good data-access pattern within a good system architecture, would be to have a separate layer between the DAL (mainly stored procs and logic residing on the database), and the business logic layer (which includes business objects). This new layer would comprise the code generated using an O/R Mapper. While developers building a project from scratch, and trying to get it completed in the scheduled time, would very much want to overlook this important aspect, since it would need to done manually without any code generation. I will try to illustrate using an example. A typical "Employee" business entity generated using an O/R Mapper might have methods like Insert() and Update() for saving and updating a record in the Employee. For most development teams trying to meet the dealine, this is good enough. However, a great design would create the same Employee class (in a different namespace) that would have methods like Hire(), Create(), ChangeAddress(), IncrementSalary() etc. calling the same Insert() and Update() methods under the covers. Not only does this make the code far more readable and self-explanatory, but also highly maintainable. The advantage of using this approach becomes even more profound when you are dealing with tables that do not necessarily represent real-life entities, and require methods like Debit(), Credit, TakeBack(), Adjust(), Reconcile() etc.
For now, I would recommend a Webcast that should get you up and running with DAL generation at SubSonic speeds.
That's the slogan of the Turkish tourism advertisement I saw on my flight from Istanbul to Antalya, on my way there for the Microsoft MVP Open Days event for MEA (Middleast and Africa) region this week, and let me tell you, I dream about Turkey from now on too.
So much can change between 2 posts is hard to imagine. For one, WinFX was renamed; now its called .NET 3.0 (combining WPF, WCF, WF, WCS). I touched upon the idea of WPF in the web browser in the previous Atlas at last post. An article on MSDN titled "Deploying Microsoft .NET Framework Version 3.0" explains how to detect if .NET 3.0 is installed on a PC from within JavaScript/JScript code running inside a browser. Get ready; we would be seeing sites developed using .NET 3.0, with WPF on the presentation tier, very soon. The keyword to remember is "Smart Client"; browser-based applications lending a rich presentation to a SOA (Service-Oriented Architecture) strategy.
There's more than one way to skin a cat, or so I heard, and that really depends on what you want to do after you've done it. In the same way, you have a choice to develop with Microsoft "Atlas" using 2 different approaches, depending on the type of project you are building, the development time you have, and/or the amount of responsiveness and richness you want in your web app. The 2 approaches are: Server-Centric and Client-Centric Development. The diagram below provides a glimpse of what these 2 approaches encompass.
Very briefly, the Server-Centric approach primarily involves using Atlas Server Controls to achieve the desired result. This essentially means adding the "UpdatePanel" control, and enclosing all other server controls within it. Control Extenders, as the name implies, allow developes to add DHTML behaviors to existing server or client controls. Although the current online literature on Atlas does not classify the use of Control Extenders as a server-centric approach, it is easy to explain Control Extenders to developers in context of the server-centric approach, mainly because they encapsulate DHTML behaviors, shielding the user from the complexity of the JavaScript code, and are used pretty much like pre-developed ASP.NET server controls.
The Client-Centric approach relies on client-side script (no surprises there) running inside the web browser to not only achieve most of the things possible with the server-centric approach, but to also create and add rich client-side interactivity within the webpage. Remember, these 2 approaches are not alternatives to each other. A single website, or even a single webpage, can have implementations of both approaches. The next 2 "Atlas at last" posts would look into more detail of both these approaches separately.
It is incorrect to assume that only the client-centric approach involves scripting. There are no clear guidelines in existence that would mandate the use of one approach instead of the other. Many web/ASP.NET developers who are just getting started with Microsoft "Atlas" would want to go with the UpdatePanel control since it requires the least effort and development time. However, the UpdatePanel might not hold the answer to what you wanted to achieve in the first place. I received a couple of queries from people who wanted to know which approach they should follow for their projects, and my answer was always the same: it depends. Its better to choose the approach for each webpage accordingly instead of making a choice of the approach to follow at the beginning of the project and adhereing to it throughout. Let me elaborate through some scenarios.
The webpage comprises of static information. Recommended approach:None; Since the data contained in the page does not change, it is pointless to use Atlas in it.
The webpage is used to present dynamic information stored on the server in a database/XML file, and loads inside a particular region of the page depending on the query string value. Recommended approach:Server-Centric; The UpdatePanel would only change a portion of the page after a response is received from the server, while static portions of the page like header images, logos, menus etc. would not reload.
The webpage lists information from a database table, and the user should not have to navigate to a different webform page to enter new, or modify existing data from that table. Recommended approach:Control Extenders; The 'Modal Popup Control Extender' provides an easy-to-implement mechanism to dislay a webform in a modal popup window, graying-out the rest of the portion of the screen outside the popup window, allowing the user to enter new, or change existing, information; When the modal popup closes, the portion of the page that lists the data from the table refreshes to show the updated information from the server (without a full postback).
The webpage consists of multiple dropdown lists (combo-boxes), and each one after the first dropdown list populates with values based on the value selected in a previous dropdown, like a City dropdown populating everytime for the Country seleted from another dropdown list. Recommended approach:Control Extenders; The 'Cascading DropDown Control Extender' allows a dropdown list to call and web service in response to a selection made into it and populate the next dropdown list in the sequence.
You want to give the user the ability to either enter a new value into a textbox or else select from a list of values already stored in the database. Recommended approach:Both Client-Centric and Server-Centric approaches support the Auto-Complete behavior (Also see next point).
You want to give the user the ability to either enter a new value into a textbox or else select from a list of values already stored in the database, based on a selection or preference specified ealier. Recommended approach:Client-Centric; Only JavaScript would allow the Auto-complete list to be populated based on a condition, since XML-Script and the AutoComplete Control Extender only attach a web service (hard-code) to an autocomplete list, whereas JavaScript code provides the flexibility to select from a list of web services depending on a condition.
The above does not (and cannot possibly) cover all the scenarios that Microsoft "Atlas" is designed for. Stick around for more "Atlas at last" posts.
I apologize for not uploading the "Building Next Generation GUIs using Microsoft Expression Interactive Designer" presentation earlier. I just uploaded it to the Core.NET Yahoo Group in the "Files > PDC 2006 Slides and Demos > EID" Folder.
For samples and application demos, check out these URLs.
I got an overwhelming response from both of my presentations during the 3-day Pakistan Developer Conference 2006, or PDC 2006 as we like to call it. I have uploaded my presentation slides and demo code for all applications I demonstrated at Core.NET's Yahoo! Group account. Download away!
The three files pertaining to the presentation uploaded in the "Files > PDC 2006 Slides and Demos > AJAX & Atlas" folder are
Atlas_AdnanHashmi.PDF
PDC06.Demos.NaukriAtlas.ZIP
PDC06.Session.Demos.ZIP
* The term 'Naukri' in Urdu means 'Job'. NaukriAtlas.NET is an AJAX-enabled job portal.
Interestingly, the announcement made about .NET 3.0 on June 9 by Somasegar on his blog was exactly what I had forecasted and blogged about in my post just 3 days prior, and I had absolutely no idea at that time that it would come so soon.
I am not sure how the decision to rename WinFX (which encompasses WPF, WCF, and WF) to .NET 3.0 will go down with developers who are still in the process of trying to explore, and gradually coming to terms with the changes that new technologies like Atlas and WinFX brought to .NET 2.0. Developers, however, were content, knowing that WinFX was built on top of .NET 2.0 and will be supported for the next decade. This new change, in addition to creating a lot of confusion, will also raise a number of questions; Will existing investments in .NET 2.0 go down the drain soon? Should we wait for the new 3.0 platform to mature before we implement it? Is .NET 2.0 gone?
Hopefully, Microsoft would move swiftly to allay a lot of fears in the coming days. My best guess is that .NET 2.0 (along with its underlying technologies) would be a subset of .NET 3.0 along with Orcas/C# 3.0, WinFX, and LINQ. For now, I am keeping my fingers crossed.
The following text is my own take on the AJAX/Atlas future, and DOES NOT reflect any future Microsoft strategy.
Lets face it; web sites today, regardless of the technology they've been built on, do not come even close to providing the utility envisaged and hyped about in the Dot Com era. Though the future outlook initially looked very promising for e-learning, e-business, and e-everything, the reality has been very different. And so, as it happens, once in a while a technology comes along that holds the promise of changing something that we have become so accustomed to that we don't realize needs fixing. Question is, does AJAX fall under that category? Certainly not. AJAX, as time will tell, is not an end, but a means to an end. AJAX (and all its implementation frameworks) will do nothing more then allow the idea of asynchronous call-backs to the server without mandating a page refresh to gain acceptance. This would enable a much richer class of web applications then ever before. The trade-off to this, however, is a much longer inital loading time for the page.
Imagine having to tune your television to the channel you want to watch everytime you want to watch it. Isn't that what has been going on for so many years the internet has been in existence; the whole page refreshing just to display a message on a small portion of the webpage.
Going with the analogy of television, imagine turning on your television and seeing a "Loading...Please wait" message on the screen. Isn't that what AJAX would put web surfers through when the page loads for the first time? If you happen to have a slow internet connection as I do, it would take a couple of "manual" page refreshes just to see the whole UI on the screen, hopefully without a JavaScript error appearing in the web browser's status bar. Thankfully, such considerations will not slow the buzz that has been generated in web developer circles since the advent of the AJAX approach.
Getting back to the point I made about asynchronous call-backs and initial loading time above, developers and users/surfers alike would attune to the idea of longer initial loading times just so they get fast responses and a richer experience once the UI has loaded; communicating with web services asynchronously without whole round-trips to the server and complete page refreshes.
For the time being, that looks like the change we will be seeing in websites. However, if you think that the story ends there, think again. For the Web 2.0 idea to become a reality, and not fade into oblivion after a while, the web has to be a platform. That would put more pressure on the web browsers, since no one would want to see one website work on IE and FireFox but break down in Opera. These unresolved issues are still in abundance as companies move to invest in web applications that would make use of the AJAX approach.
How do we move forward then? What does the future hold for AJAX and Atlas? Well, to answer these questions, architects and developers would need to focus on the Smart Client paradigm. The biggest benefit Smart Clients have is that they only need to be installed once on the client PC after being downloaded from the Internet (Click Once deployment). This would allow the application to be used without visiting any website again and wait for the UI to load. The reason the Smart Client model was sidelined (by AJAX) was because it killed the web browsing experience; it did not function inside the web browser, but instead appeared as a stand-alone application. To cut a long story short, for the next generation of web applications, 3 things are of utmost importance:
Responsiveness (brought about using communication with web services)
Rich User Experience and UI
Least or No download time
Uptill now, only the first of the 3 above has been addresed by the AJAX approach. The only way I see 2 and 3 (along with 1) becoming a reality is with XAML and Windows Presentation Foundation (WPF). XAML or eXtensible Application Markup Language in its current form still has a long way to go, but it does hold a promise, simply because it has the capacity to encompass a lot of UI logic declaratively (using tags) without any scripting language. Hence, the next generation web applications UI's would be developed in tools such as Microsoft Expression Interactive Designer, and exist as WPF Express applications. The third point of least or no download time can be made possible by caching the XAML UI after it has loaded into the web-browser so that it does not need to download the next time the user visits the site. Webpages are kept in the browser's cache even now, but that serves no purpose in making the next visit to that page more responsive. Some might argue the need for keeping large amount of UI data in the web-browser's cache even if the surfer may be visiting the site for the first and last time; to which my answer would be: You keep the phone number of the people you call frequently stored in your cellphone so that you dont have to memorize them, or even dial them everytime. However, even if you make a call to someone for the first (and possibly last) time, even then, that number remains in your cellphone's memory for some time. So, web-browsers may prompt the users if they want to keep the UI cached so they dont have to download it again in the next visit. Ideally (and for good reason), web surfers would keep the websites they visit frequently cached in their browsers. What a surfing experience that would be?!
For now, the idea of declarative programming will gain wider acceptance in the web developer community as they use tags in Atlas to bind UI elements to data or extend existing web controls with control extenders. If nothing else, one thing is certain; JavaScript is back from her death-bed (if not her grave), and has become something for companies to explore and take seriously for the next couple of years.
Awright! Its that time of the year again which developers in Pakistan look forward to; the annual Microsoft Pakistan Developers Conference 2006 (June 28 ~ June 30). This year, the conference would be bigger and better then previous years, since it would take place in Karachi and Lahore simultaneously. The event in Karachi would be 3 day long, whereas in Lahore, it would only be a single day event. Check out the agendas for both cities here. I will be speaking in 2 sessions this time around; "Developing Rich Internet Applications using AJAX and Atlas" and "Building Next Generation GUI's using Microsoft Expression Interactive Designer". I will be posting more about my demos in the coming weeks.