Infosys Microsoft Alliance and Solutions blog

« February 2008 | Main | April 2008 »

March 31, 2008

MS Software Factories...

There are some rumbling on the software factories from MS.

It has been nearly 4 years since Jack Greenfield articulated Microsoft Software factories vision. He talked about state of software engineering in his famous book. We have got bunch of PnP guidance packages(http://msdn2.microsoft.com/hi-in/practices/bb969097(en-us).aspx - scroll to then end of the page) that adresses solution domain rather than the problem domain. To some people, these guidance packages have given a different understanding of software factories rather than what was articulated in the vision. Software factories have become synonymous with code generation. These PnP software factories give good guidance and productivity gains but they are not full vision of software factories.

Every one knows that as of now MS has not released tools to realize all the four pillars ( Software Product Lines, Domain Specific Models, Context Guidance and Architecture Frameworks) of software factory vision. Currently, DSL tools like GME from Vanderbilt university have better features than DSL tools from MS.

Complete vision of software factory as articulated few years back is not realized yet but on the other side MS is coming up with Software factory tools support in next version of Visual Studio "Rosario". Check the DSL tools roadmap . Check the updates that are present in Rosario CTP's. These new tools in Rosario represent a definitely a way forward (assuming that they will make it to final release!) but the question is would they give the kind of benefits envisaged in the software factories vision? Only time will tell. 

For latest happenings, refer to software factory community at http://sf.devrevolution.com/

March 27, 2008

Device Profile Web Service (DPWS)

In my previous post, We saw how devices and sensors could comminicate with each other using RF based Z-Wave technology. Now, we have a technology by which any device (even highly resource constrained ones) can advertise its identity, cpabilities to other devices and also know about other devices in the network. Not only that, any device can invoke actions of interest in the other device through Device Profile Web Service, So what is DPWS?

 

 Device Profile Web Service

The Devices Profile for Web Services (DPWS) defines a minimal set of implementation constraints to enable secure Web Service messaging, discovery, description, and eventing on resource-constrained devices. Its objectives are similar to those of Universal Plug and Play (UPnP™) but, in addition, DPWS is fully aligned with Web Services technology and includes numerous extension points allowing for seamless integration of device-provided services in enterprise-wide application scenarios.

The DPWS specification,  defines an architecture in which devices run two types of services: hosting services and hosted services. Hosting services are directly associated to a device, and play an important part in the device discovery process. Hosted services are mostly functional and depend on their hosting device for discovery.
In addition to these hosted services, DPWS specifies a set of built-in services:
Discovery services: used by a device connected to a network to advertise itself and to discover other devices.
Metadata exchange services: provide dynamic access to a device’s hosted services and to their metadata.
Publish/subscribe eventing services: allowing other devices to subscribe to asynchronous event messages produced by a given service.

DPWS builds on the following core Web Services standards: WSDL 1.1, XML Schema, SOAP 1.2, WS-Addressing, and further comprises WS-MetadataExchange, WS-Transfer, WS-Policy, WS-Security, WS-Discovery and WS-Eventing.
.Net MicroFramework 2.5 has extensive support for DPWS.Microsoft's Windows Windows Vista and CE6R2 platforms natively integrates DPWS with a stack called WSDAPI.

A Simple Scenario

DPWSseq1.jpg

 

March 26, 2008

WPF - Updating XmlDataProvider when source XML changes

Some days back i had answered a question on the WPF Forum on how to ensure that when the base XML file changes, the XmlDataProvider is udpated and hence the bound control on the UI.

The key is to set a watch on the particular XML file for changes and then update the provider appropriately. See details here. This solution works fine, but I didn't particularly like my initial code that I wrote since the FileSystemWatcher was set externally. It would be better if this could be self contained within the XmlDataProvider itself.  

I hence decided to write my own XmlDataProvider for this purpose. Well, not write entirely, but obviously extend the existing provider. Following is the class that I wrote for this purpose. Since all I am really interested in is to get the FileSystemWatcher setup, I modify the Source property implementation and on the file change event, I force a refresh on the provider.

    public class MyXmlDataProvider : XmlDataProvider

    {

        public new Uri Source

        {

            get { return base.Source; }

            set

            {

                base.Source = value;

 

                FileSystemWatcher watcher = new FileSystemWatcher();

                //set the path of the XML file appropriately as per your requirements

                watcher.Path = AppDomain.CurrentDomain.BaseDirectory;

 

                //name of the file i am watching

                watcher.Filter = value.OriginalString;

 

                //watch for file changed events so that we can refresh the data provider

                watcher.Changed += new FileSystemEventHandler(file_Changed);

 

                //finally, don't forget to enable watching, else the events won't fire           

                watcher.EnableRaisingEvents = true;

            }

        }

 

        void file_Changed(object sender, FileSystemEventArgs e)

        {

            base.Refresh();

        }

    }

This is all that is required. Using this in XAML is pretty straightfoward and following is a sample XAML.

<Window x:Class="TestWPFApp.XmlRefreshTest"

   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

   xmlns:local="clr-namespace:TestWPFApp" 

   Title="XmlRefreshTest" Height="300" Width="300">

    <Window.Resources>

        <local:MyXmlDataProvider x:Key="xmlFromFile" Source="PersonXml.xml" XPath="persons/person" />

    </Window.Resources>

    <Grid>

        <ListView ItemsSource="{Binding Source={StaticResource xmlFromFile}}" x:Name="list" >

            <ListView.View>

                <GridView>

                    <GridViewColumn Header="FirstName" DisplayMemberBinding="{Binding XPath=@firstname}" />

                    <GridViewColumn Header="LastName" DisplayMemberBinding="{Binding XPath=@lastname}" />

                    <GridViewColumn Header="Age" DisplayMemberBinding="{Binding XPath=@age}" />

                </GridView>

            </ListView.View>

        </ListView>

    </Grid>

</Window>

For my testing, I used the following Xml file. Note that I had marked the Xml as Content and Copy if newer in its properties to ensure that the Xml file is available in the output directory.

<?xml version="1.0" encoding="utf-8" ?>

<persons xmlns="">

    <person firstname="Atul" lastname="Gupta" age="35" />

    <person firstname="Sidharth" lastname="Ghag" age="30" />

    <person firstname="Virendra" lastname="Wadekar" age="30" />

</persons>

Comments are welcome !

March 20, 2008

Why is the concept of a list so important in SharePoint

List is a powerful concept in SharePoint. It forms the basic storage mechanism. Everything in SharePoint be it simple item stores like tasks, customlists or more complicated ones like surveys, Calendar entries, project tasks, blogs, wikis, etc are all internally stored as list entries. Infact even Document Library leverages the list infrastructure.

If you open the Onet.xml file in the Global Template directory ( <Installation Drive >\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\XML\ONET.XML, The following nodes will be seen under Base Types

-  <BaseTypes>
      <BaseType Title="Generic List" Image="/_layouts/images/itgen.gif" Type="0">
    <BaseType Title="Document Library" Image="/_layouts/images/itdl.gif" Type="1">
    <BaseType Title="Discussion Forum" Image="/_layouts/images/itdisc.gif" Type="3">
    <BaseType Title="Vote or Surevy" Image="/_layouts/images/itsurvey.gif" Type="4">
    <BaseType Title="Issues List" Image="/_layouts/images/itgen.gif" Type="5">
 </BaseTypes>
Any list that will be used in SharePoint will be from one of these base types. What is seen as Type here is the ID of the list. As I understand this classification is mainly because the basc purpose and the storage mechanism will be slightly different with each of these.

March 18, 2008

Expression Blend issue with WPF Data binding debugging

Some days back I had pointed to the blog by Beatriz on how to debug WPF data binding errors. I have been using the PresentationTraceSources.TraceLevel feature (available with .NET 3.5) since then and have found it very easy to use and very effective in resolving my data binding errors.

However recently when I opened a XAML, which had this debugging feature enabled, in Expression Blend 2.5 March Preview, I got an error. The XAML won't open in designer and showed "Invalid XAML" with details as 'The member "TraceLevel" is not recognized or is not accessible'.

You can use the following very trivial XAML to reproduce the error.

<Window x:Class="TestWPFApp.Window2"

       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

       xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"  

       xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

       xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"

       Title="Window2" Height="300" Width="300" x:Name="wnd" >

    <StackPanel>

        <Button x:Name="button1" Content="Click" />

        <Button x:Name="button2" Content="{Binding ElementName=button1, Path=Content, diag:PresentationTraceSources.TraceLevel=Medium}" />

    </StackPanel>

</Window>

Microsoft has confirmed this to be a bug with Expression Blend 2.5. We can expect to see a fix for this in future releases. Check here for details on this bug.

Note that I have set the TraceLevel to Medium. For basic data binding debugging, this can also suffice since it shows the final Transfer value used by data binding. Setting it to Low will not help much. For most detailed information, however, you need to set it to High.

[Updated: March 26, 2008] I got notification from the MS Connect site that this issue has been fixed. Hopefully this means that the next preview release will have this fix included.

March 12, 2008

Collaborative Learning,SCORM and DotnetSCORM

Collaborative Learning System  :Building a  Learning Management System which not only provides the content but which in addition is able to provide rich user experience,high level of interactivity and which is able to communicate with learning systems built in different ecosystems , having different content types and share them would be a collaborative learning system in the real sense.

The Sharable Content Object Reference Model (SCORM) and its .NET implementation DotnetSCORM  target the challenges discussed above

SCORM and DotnetSCORM

The Sharable Content Object Reference Model defines a specific way of constructing Learning Management Systems and training content so that they work well with other SCORM conformant systems. Shareable Content Object Reference Model (SCORM) is an XML-based framework used to define and access information about learning objects so they can be easily shared among different learning management systems (LMSs). SCORM was developed in response to a United States Department of Defense (DoD) initiative to promote standardization in e-learning. Basically, the different versions of SCORM all govern the same two things: packaging content and exchanging data at runtime.


Packaging content determines how a piece of content should be delivered in a physical sense.  At the core of SCORM packaging is a document titled the "imsmanifest". This file contains every piece of information required by the LMS to import and launch content without human intervention. This manifest file contains XML that describes the structure of a course both from a learner’s perspective and from a physical file system perspective.  Questions like, "Which document should be launched?" and "What is the name of this content?" are answered by this document. 
 
Runtime communication, or data exchange, specifies how the content ”talks” to the LMS while the content is actually playing.  This is the part of the equation described as delivery and tracking.  There are two major components to this communication.  First, the content has to "find" the LMS.  Once the content has found it, it can then communicate through a series of "get" and "set" calls and an associated vocabulary.  Conceptually, these are things like "request the learner’s name" and "tell the LMS that the learner scored 95% on this test."   Based on the available SCORM vocabulary, many rich interactive experiences can be communicated to the LMS.

The DotnetSCORM(ref:DotnetSCORM-.NET Open Source Learning Project)

DotNetSCORM™ project is an Open Source Learning Management System using .Net technologies. DotNetSCORM™ is an N-Tier application with Custom Business Objects from DotNetNuke into the components so that objects can be filled from the database with one line of code.

DotNetSCORM Architecture

DotNetSCORM-LMS-Framework.gif

Future releases of DotnetSCORM would accomodate

Simple HTML Player Module
eCommerce Module
Crystal Reports Module
LCMS Module
DotNetNuke API Module
phpNUKE API Module
mamba API Module
User Import Module
Advantage DataProvider
Oracle DataProvider
VoIP Collaboration Module
Server Farm Module

 

WPF TextBox Memory Issue

Some days back, I had blogged about this issue and suggested how to set global style to counter this. However it turns out that with that you may run into 'Cannot use UndoService while it is disabled' related error. To address that, you will need to modify the style using a DataTrigger as below.

        <Style TargetType="{x:Type TextBox}">

            <Style.Triggers>

                <DataTrigger Binding="{Binding Path=IsLoaded, RelativeSource={RelativeSource Self}}" Value="True">

                    <Setter Property="UndoLimit" Value="0" />

                </DataTrigger>

            </Style.Triggers>

        </Style>

MS has accepted the behavior behind this as a bug. Read more discussion on this here.

March 10, 2008

WPF XmlDataProvider, Working with External XML Files

Recently on the WPF Forum I came across an interesting problem about use of XmlDataProvider in XAML and its ability to load external XML files. It took a bit of a struggle, but eventually I did manage to get it working. Here I will try and explain it in some detail so that others can also benefit.

We all know that one can easily bind to inline XML in XAML or can load that from external file. If working with inline XML, you usually use XData to specify the XML file content.

        <XmlDataProvider x:Key="Persons" XPath="persons/person">

            <x:XData>

                <persons xmlns="">

                    <person name="Person 1" age="20"/>

                    <person name="Person 2" age="30"/>

                    <person name="Person 3" age="40"/>

                </persons>

            </x:XData>

        </XmlDataProvider>

If working with external file, the Source attribute is set to point to the specific XML File.

        <XmlDataProvider x:Key="xmlFileRes" Source="XMLFile1.xml" XPath="persons/person" />

Note that when you add a new XML file to the project, by default, it is marked as Resource. This means that it will be compiled as a resource inside of the application assembly and personally I don't see much value in that. XML files are typically used so that you can modify them without having to recompile the code, so set the properties of the XML file as
Build Action - Content
Copy to Output Directory - Copy if newer

You can also set Copy to Output Directory to Copy always if you prefer it. That said, if you there is no need for XML file to be modified, you can leave it as a Resource. Also if you do want the XML file to be externally modifyable, take care of appropriate updating to Application logic to ensure that it can pick up the latest XML.

With the above XML you can easily bind this to say a ListBox as

        <ListBox ItemsSource="{Binding Source={StaticResource xmlFileRes}}" ItemContainerStyle="{StaticResource listStyle}" Height="70" Name="list" />

In my case, I have used a style for the ListBox which is defined as below.  

        <Style x:Key="listStyle" TargetType="{x:Type ListBoxItem}">

            <Setter Property="Template">

                <Setter.Value>

                    <ControlTemplate>

                        <TextBlock Text="{Binding XPath=@name}" />

                    </ControlTemplate>

                </Setter.Value>

            </Setter>

        </Style>

Compile and run and all works fine. If you don't see any content in the ListBox, make sure that the settings on the XML file are properly done and physically verify that the XML file is indeed present in the same path as the Application executable.

This entire logic can be moved inside of a UserControl and all still works fine. However the issue occurs if this is moved inside of a new project altogether. In my case, I created a new WPF User Control library and created a User Control inside of it. In the VS and Expression designer the user control loads fine, but when added to the Window of my parent project and executed, the XML files to load. The output window shows that some error occured while loading the XML file -

System.Windows.Data Error: 43 : XmlDataProvider cannot load asynchronous document from Source because of load or parse error in XML stream.; Source='<null>' IOException:'System.IO.IOException: Cannot locate resource 'ucxmlfile1.xml'.
   at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
   at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
   at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
   at System.IO.Packaging.PackWebResponse.GetResponseStream()
   at System.Windows.Data.XmlDataProvider.CreateDocFromExternalSource(WebRequest request)'

If you look at this strack trace, the call seems to have orginated from XmlDataProvider.CreateDocFromExternalSource(WebRequest). I don't know why the data provider is thinking this to be an XML coming from Web, but this could be the reason for the failure to load. Looks like some bug in the way the XML file is loaded.

To fix this,  here is what I did in the user control's code behind. I modified the constructor logic to as below

        public UserControl1()

        {

            InitializeComponent();

 

            XmlDataProvider xdp = this.TryFindResource("xmlFileRes") as XmlDataProvider;

            if (xdp != null)

            {

                XmlDocument doc = new XmlDocument();

                doc.Load("UCXMLFile1.xml");

                xdp.Document = doc;

                xdp.XPath = "persons/person";

            }

        }

With this change, the application now works fine. You might wonder if we are modifying the Source of the XmlDataProvider in the code behind, do we really need to specific it in the XAML also. It isn't necessary and you can very well modify the XAML as below. However I didn't do it to continue to get designer support. If you remove the Source and XPath details from XAML, the control will not display anything in the designer view and hence designing the layout may become an issue.  

        <XmlDataProvider x:Key="xmlFileRes" />

That said, things aren't still completely fixed. If only both VS and Expression designer's would behave in the same way !!! If you open the Window.XAML in Expression it looks fine and is even able to load the UserControl and show the XML contents inside it as expected. However for some reason now the VS designer goes for a toss. You may see a "Could not create an Instance of type 'UserControl'" error and the VS designer fails to load. To fix this, you can further modify the UserControl's constructor as below.

        public UserControl1()

        {

            InitializeComponent();

 

            if (DesignerProperties.GetIsInDesignMode(this))

                return;

 

            XmlDataProvider xdp = this.TryFindResource("xmlFileRes") as XmlDataProvider;

            if (xdp != null)

            {

                XmlDocument doc = new XmlDocument();

                doc.Load("UCXMLFile1.xml");

                xdp.Document = doc;

                xdp.XPath = "persons/person";

            }

        }

Now both VS and Expression designer work fine, but since the XML load logic isn't executed in design time, the XML contents that were earlier visible in Expression are not visible anymore. You will only see the bounds of the control, but no data inside of it. So based on which designer you prefer to work with, you can take a call of how to write the code.

BTW, I have used Visual Studio 2008 RTM and Expression Blend 2.5 March 2008 Preview. 

 

 

March 07, 2008

Additional Relational Metadata for artifacts in MOSS -- Part 2

Last week we saw the First Part of the blog "Adding Additional Metadata to the list/library". Today we will see what next to be done post creation of the database.

The following activities will have to be done to take this to completion

• Remove the existing edit metadata page
• Create a new ASPX page which can be used to capture both the standard flat metadata and the hierarchical metadata
• Link this page with the document library
• Create a custom Edit Metadata page which would contain both the linear and the hierarchial metadata.
• Replace the existing edit metadata page with the custom one

 

This calls for the creation of a new Document Library Type as a feature and be installed in the Web Application. When the end user needs to create a document library, (s)he will create the same using this custom library so that they have the custom edit page for the metadata.

Custom Document Library

The easiest way to start on this is to create a copy of the existing document library feature (<<Install Drive>>:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES). Post giving the custom name to the feature, the following files needs to be updated in the feature folder
• Feature.xml – The following node
<ElementManifests>
        <ElementManifest Location="ListTemplates\DocumentLibrary.xml" />
    </ElementManifests>

Needs to be replaced by the one shown below

<ElementManifests>
        <ElementManifest Location="ListTemplates\DocumentLibrary.xml" />
 <ElementFile Location="MyDocLib\schema.xml" /> 
 <ElementFile Location="MyDocLib\Basic.aspx" />
</ElementManifests>

Here in the above code we are registering the customized schema file and the editform.aspx

Schema File – This is required to remove the existing edit contextual menu and add our custom edit form in its place. Search for the below mentioned code in the schema file

<Forms>
      <Form Type="DisplayForm" SetupPath="pages\form.aspx" Url="Forms/DispForm.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="editform.aspx" WebPartZoneID="Main" />
      <Form Type="NewForm" Url="Forms/Upload.aspx" WebPartZoneID="Main" />
      <Form Type="NewFormDialog" Path="EditDlg.htm">
Change the editform,aspx to the <<custom file>>.aspx

After adding the files to the feature library install the feature using stsadm –o –installfeature command.
Activate the feature for the specific site.

Hope this was useful and enjoyed the reading. You can try the same and get back in case there are any issues.

Organizing Using Statements - New Feature in Visual Studio 2008

One cool new feature which might not be apparent to us unless and until we really go through all the new features that have been incorporated into the Visual Studio 2008 IDE is the feature which allows us to organize the Using statements that we always use in our source code files. This would be really useful as i have often seen that people use more Using statements than what is actually required, and we always have the habit of adding Using statements as and when required. But at the end of our development process, we would like to do a clean up and make sure that we have put Using statements only for the required namespaces and possibly make it more readable by sorting these statements alphabetically etc.

The Visual Studio 2008 IDE provides the following options to organize and remove usings/imports statements:

  • Remove Unused Usings
    Removes using directives, using aliases, and extern aliases that are not used in the source code.
  • Sort Usings
    Improves the readability of the source code by alphabetizing and organizing using directives, using aliases, and extern aliases in the following order:
    • extern aliases
    • using directives
    • using aliases
  • Remove and Sort
    Does both removal as well sorting discussed above.

Organize Usings

To see the available options in the Visual Studio IDE, on the Edit menu, point to IntelliSense, and then point to Organize Usings. An easier way to do this would be to Right-click anywhere inside the code editor, point to Organize Usings as shown in the figure above and click on any of the 3 options available.

For more information on this feature please read this msdn article.

A very small but useful feature indeed!

A Refactorability Approach to Software Reusability

“If creating a cyborg by plugging human limbs and machine components could become a reality, why is it difficult to create software just by plugging other software components?”, a pal once asked me. “The answer is in the question”, I replied, “Creating reusable components is as much of a trick as a cyborg”.

Five years back, reusability used to be as big a term as it is today. New technologies and increasing business complexities warranted creating reusable components to improve productivity and faster go-to-market times. Five years later, today, we still have the same problems. Technology has grown, programming paradigms have changed, business needs are becoming complex. Factually speaking, reusability hasn’t solved our problems. The reason is simple: Reusability is generally approached with an as-is usage in mind – create once and use many times. On the other hand, reusability needs to be approached with an altogether different angle. Here’s why!

Traditionally reusability is about the infrastructure aspects of a software like caching, runtime management, monitoring etc. It takes time to understand new technology, identify reusable pieces, design generic frameworks around them, pilot them and roll out across projects. The question of creating reusable business components is even trickier to answer as business requirements vary across applications even within a given domain. Even if you do manage to create reusable components, the next problem is to gain customer acceptance for such reusable components and break even on the investments. Add the learning curve required to understand such components as well.  By the time all of these happen, we have the next version of the technology or a change in business requirement to contend with, and we run into issues of upgrading the components or creating new ones.

Oops. Did I say “create new ones”? Well, weren’t we talking about “reusability”?

Only such code can be reused if it does something that you want it to do again in some other application at some other time. But applications are as distinct from each other as are the sun and the moon. Although commonalities do exist, there is also a significant variability to contend with. Reusability in its traditional view does not deal with this variability factor. But then how do we really address all this buzz about reusability improving productivity, and faster go-to-market times?

The answer lies in looking at reusability through the mirrors of Software Refactorability. The ability of a software component to be quickly refactored and fitted into the new application is how I would define the term. Instead of aiming to create components for using as-is across many applications, this approach to reusability insists on creating refactorable components, so that, such components can quickly adapt itself to different applications and amend its behavior as needed.

I would further expand on this idea and ways to achieve it in the following posts.

March 06, 2008

Interesting times for Customer Service Industry

Worldwide Customer experience is increasingly being seen as one of the key drivers to grow customers, increase loyalty and drive revenues, second only to the Product or Service offerings that an organization has. While we see an increase in the number of channels and technologies that are available to a customer to reach out an organization, contact centres still remain the core of customer experience like “a face of the organization”.

We have seen a never before phenomenon of speed at which the products and services offerings change in today’s internet world, while this means that with every passing minute the choices that the customer has are increasing, it also means that it’s increasingly becoming important for organizations to keep their contact centres agile to understand offerings, convince customers about the products and services, and deliver superior customer experience consistently, with every interaction..

In the last couple of years organization have invested a lot on enterprise applications,  we see a lot of these applications being used in Contact centres as well , like CRM, Marketing, Billing , Logistics, Order management, Customer information management  to name a few. All of the above them have sub applications and multiple fields that an agent needs to be carefully aware of while handling a customer. While the applications make all the data available to an agent about a customer, they also make work complex, as for any information an agent needs to remember the right application and the right field and the right steps to get to that.

It is a well known fact that close to 70 % of the contact centre costs are all related to the human costs, like salary, training etc. Organizations today realise that they have to start right at the agent’s level to overcome the overall challenge of “Operational Efficiency”. In many studies in the recent past this has emerged as the top most focus area of many contact centres.

“A survey of contact center professionals conducted by independent market analyst Datamonitor (DTM.L) reveals contact center and contact center agent optimization are viewed as key investment priorities over the next 3 years. According to the report, "Contact Center Markets & Technology, Technology Evolution," pressure on contact center managers to do more (services) with less (budget) is increasing the demand for optimization technologies. According to Datamonitor as vendors look to develop multi-component solutions, effective integration and partnering will become a necessity taking vendors a step closer towards performance management solutions. In turn, the complexity of deploying such solutions will create a bigger role for professional services.

Datamonitor's report highlights the way contact centers are improving customer service through greater efficiency, using a range of optimization technologies. The report considers the role these technologies can play in delivering superior customer services from contact centers.”                      -Courtesy Datamonitor

It is an interesting time for the Customer Service industry, there is a lot of focus all of a sudden on a big word ‘Optimization’. Our internal research (both primary and secondary) reveals that there are a few big challenges that Customer care centers face today...

·         —  Low Agent & Enterprise productivity

·         —  Low Customer satisfaction

·         —  Application Silos

·         —  High Cost of operations

·         —  Weak Knowledge management & sharing practice.

If we look back .. way back in early late 50’s or 60’s, probably the time when the first so called ‘customer service cell’ was set up by Ford Motors with the help of AT & T who gave them and the first ‘Toll free’ number … to today, when a call to CITI or BA is answered thousands of miles away by an agent from a different continent, a lot has changed, or I should say evolved.

Customer service has evolved from a service department somewhere in the corner in a huge organization to a grown and matured industry. Analysts say it is around 45 Billion today from 35 Billion what it was in 2004, a huge growing industry. Today it’s needs are different from what they were say in early 80’s when ACD was a ‘Wow’ or 90’s when WFM, QMS and the big brother of reporting ‘Crystal’ was all the managers wanted. In the days to come optimization at all levels is gonna be a huge focus area, we’d see a lot of investment going in the software components, IP is already established and supposedly gonna over take the traditional TDM shipments this year, we’re also witnessing a huge amount of openness of data, and a shift towards ‘Presence’ and ‘De Centralized’ customer service centers. There are a couple of areas where we see the investments happening in the future.

Agent optimization: We’d see that a lot is gonna change in the way an agent desktop looks , from a complex where there is a spread of some 12- more applications to a smart, context based unified desktop that brings in a complete view of the customer.

Work force Optimization: These set of technologies would enable managers in these center to look at performance from a completely new perspective, combining data from various systems.

Metric that matter: No longer the traditional AHT, ACW etc.. but complete resolution ( also FCR) ,revenue per customer, time spent on applications so that the stuff available there could either be simplified or taken to a self service portal.

Unified Communication: Ability to serve a customer based on his/her choice of medium, virtually from any location and with ability to quickly look for information, people with the right skills.

Compliance:  Ability to ensure that the processes coupled with technologies around are designed in such a way that while the agents gets all that he wants to, they also get a pre designed flow to take a call/task to closure.

We’re confident that the above set of solutions would not only ensure that the Customer Service centers of the future are agile but also proactive in understanding and evolving with the changing needs… definitely nobody would want to lose a customer not because of poor product /service but to poor service

 

Calculate Code Metrics feature in Visual Studio 2008

With more than 250 new features, Visual Studio 2008 includes significant enhancements in every edition, including Visual Studio Express and Visual Studio Team System. In this post,  I would like to draw your attention to this new feature in Visual Studio 2008 called “Calculate Code Metrics”.

In Visual Studio 2008, you will get the context menu option which reads “Calculate Code Metrics” (as shown in the figure below) for a Visual Studio solution as well as projects. This essentially means that you can calculate code metrics at a solution level as well as project level. Many of the third party Code Metrics tools that were available earlier were not capable of analyzing at a solution level, and hence I think it’s great that we have this feature now and what more do you want? – Its integrated with the Visual Studio. But please note that code metrics are available only for C#, Visual Basic, and C++/CLI projects that are not Web Site projects. So if you do a calculation on the solution, the website projects are skipped.

Currently the tool calculates the following 5 code metrics:

  • Maintainability Index
  • Cyclomatic Complexity
  • Depth of Inheritance
  • Class Coupling
  • Lines of Code

Now it’s really important to make some sense out of these numbers that the tool comes up with, so let’s briefly discuss what each of these means.

Maintainability Index
This number actually tells you how maintainable and good your code is. Ease of maintainability is a key metric, and a higher number here would mean that you have done a good job in making your code maintainable. This will be a number between 0 and 100, and higher the value better your code is.

Cyclomatic Complexity
Now if you have done FxCop analysis, you would come across this term many a time. At least that’s how I came to know more about this. This is calculated at a method level. It shows the number of linearly independent paths code can execute. The more the number of decision statements like if, switch, while etc.  you have in your method, higher will be the value of cyclomatic complexity, which means that your code is becoming less maintainable. A method with a low cyclomatic complexity is generally better.

Depth of Inheritance
This tells you the number of base classes. This is calculated as the (number of classes between say a class A and System.Object class) + 1. It’s good to keep this value to 6 or below as a value higher than that would mean that the code is less maintainable.

Class Coupling
This metric is calculated at a class level. This number shows the number of classes a particular class depends on. Now the classes being considered here will be the distinct non-inheritance related classes. Again we are expected to keep this number as low as possible, as this would make the class a more stable one and hence makes it a good candidate for reuse.

Lines of Code
Needless to explain what this metric means, isn’t it? This metric gives you the number of executable lines of code. This excludes white space, comments, braces and the declarations of members, types and namespaces themselves.  Again it is important to note that this would count the lines of code regardless of whether it was generated or manually written, so be a little careful when you use this information for project estimation purpose Laughing.

The results for all these metrics would come up in the Code Metrics Results window in Visual Studio 2008 as shown below.

Code Metrics Results Window

Another good feature that you have as part of this tool is the export to excel  feature, which means you can export the whole code metrics information from the VS window into an MS Excel sheet for further analysis.

The tool also provides filtering capability. You can select any metric and specify a range for the value and find the code elements which match the filter criteria.

All in all, I think this will be a very useful feature, which would give us a quick look at the quality of the code we are writing and ensure that we write good code and code that would be easily maintainable.

To know more about this tool, I would recommend you read the Code Analysis Team Blog.

Expression Blend 2.5 still has some issues with Globalization

Last week I had blogged about an issue with Expression Blend Dec 2007 Preview when working with Globalization and Localization. Yesterday at MIX 2008 Microsoft has launched Expression Blend 2.5 March 2008 Preview along with SilverLight 2.0 Beta. For a list of all the products announced during MIX check here.

With the new version of Expression Blend available, I went ahead and upgraded my machine with it and decided to give it a shot for the Globalization issue I had faced earlier.

The good news is that the bug seems to have been fixed and Expression Blend is now able the load the Window and UserControls targetted for globalization and localization without issues. However, I had a case where I was using an ObjectDataProvider in my XAML. Something like

        <ObjectDataProvider x:Key="mtcList" ObjectType="{x:Type GenericWPFApp:MTCList}" x:Uid="mtcList_12" />

The x:Uid got added when I modified the application with MSBuild to add the Uid tags. After this Expression Blend again started having issues in being able to load the particular control to which this ObjectDataProvider was data bound to, as can be seen in the following figure.

Globalization.jpg

This can however be easily fixed. Since the ObjectDataProvider in my case wasn't affected by Globalization and localization, I deleted the x:Uid attribute and Expression Blend once again loaded the control without issues.

Usually any specific localization logic will be inside fo the object referenced by ObjectDataProvider and hence we will not need explicit globalization and localization for it via XAML.

White paper on Monitoring Workflows with WF

Last week a white paper on Monitoring Workflows with WF authored by our architects (Ganesan and Prashanth BG) was published on MSDN at http://msdn2.microsoft.com/en-us/library/cc299397.aspx.

Few other white papers authored by our architects were also published last year on MSDN

Integration and Migration of COM+ Services to WCF by Ganesan and Sripriya at http://msdn2.microsoft.com/en-us/library/bb978523.aspx

BizTalk Server and WCF integration by Atul, Amit and Jitendra
http://msdn2.microsoft.com/en-us/library/bb973215.aspx

Well, Ganesan authored those papers while he was with Infy!

Please let us know any specific feedback or comments on the papers through this blog.  

March 04, 2008

Move Sites Across Content Databases in MOSS using STSADM

Content Databases of web sites in MOSS can get reach their maximum storage limit at times. In a real world scenario there may arise a need to move a Site from one Content Database to another to accommodate the proper functioning and performance which can be directly dependent on the available storage limit of the Content Database. Hence it is always advised that you change the Sites Content database. The STSADM tool provides the functionality of performing this operation with ease.

Steps:

1)At the Command Prompt use STSADM and Pipe the results into an XML file       

Example : stsadm -o enumsites -url http://InfySite/ >c:\Infysite.xml

2)Modify the ‘xml’ file to contain only the details of the ‘InfySite’       

Example : <Sites Count="3">
<Site Url="http://InfySite1" Owner="ITLINFOSYS\InfyUser1"                   ContentDatabase="WSS_Content_InfyDB1" StorageUsedMB="0.2" StorageWarningMB="0" StorageMaxMB="0" />
<Site Url="http://InfySite2" Owner="ITLINFOSYS\InfyUser1" ContentDatabase="WSS_Content_InfyDB2" StorageUsedMB="0.4" StorageWarningMB="80" StorageMaxMB="100" />
<Site Url="http://InfySite" Owner="ITLINFOSYS\InfyUser1" ContentDatabase="WSS_Content_InfyDB" StorageUsedMB="99" StorageWarningMB="99" StorageMaxMB="100" />
</Sites>
      
After Modifying
              
<Sites Count="1">
<Site Url="http://InfySite" Owner="ITLINFOSYS\InfyUser1" ContentDatabase="WSS_Content_InfyDB" StorageUsedMB="99" StorageWarningMB="99" StorageMaxMB="100" />
</Sites>

3)Move the ‘InfySite’ from “WSS_Content_InfyDB” to new DB

Example :

stsadm -o mergecontentdbs -url http://InfySite/ -sourcedatabasename WSS_Content_InfyDB -destinationdatabasename WSS_Content_NewInfyDB -operation 3 -filename c:\Infysite.xml

Successful operation shows the following message on the command prompt.

http://InfySite
Moving sites...
Operation completed successfully.
IIS must be restarted before this change will take effect. To restart IIS, open
a command prompt window and type iisreset.

4)Do an IISReset

Go to Command Prompt -> Open Run à Type IISRESET

March 03, 2008

Microsoft and Dependency Injection

At last some exciting news from Microsoft P&P Group about Dependency Injection (DI) and Inverse of Control (IoC) patterns. Grigori Melnik, the product manager for Ent. Lib 4.0 announced the roadmap for Unity and Enterprise LIbrary 4.0. I have been a big fan of DI Containers and have been playing around with Castle Windsor and Spring DI Containers for quite some time now. If you are new to DI and IoC, I would suggest you to go through the article written by Martin Fowler. In a nutshell, Dependency Injection is all about writing loosely coupled and testable software. In fact earlier version of Ent. Lib. has been using ObjectBuilder as a Dependency Injection Framework but it never was a full blown DI Container. You can build (Theoritically at least. Although, in reality I am scared to even think about it) your own container using ObjectBuilder.

ObjectBuilder seems to implement all the patterns in the world like Builder, Strategy, Factories, Locator to name a few. It is quite a formidable and intimidating opponent to have a duel with and the lack of documentation makes matter worse. So after trying to master it for a couple of weeks, I gave up as there were already lots of other alternatives at my disposal(And Better ones from Open Source Communities, I admit). But with the anouncement of Unity now it seems that Microsoft has admitted the importance of a DI Container in order to build loosely coupled, flexible and testable software components. Still these are early days to state the real usability of the framework but after playing around with it for a few days, I will come up with my own viewpoints on it vis-a-vis other well established open source DI Containers.

One good thing about Ent. Lib. 4.0 is the fact that it is being re-architected to use DI (Read Unity) for all its application blocks which means you are free to use any container of your choice. More importantly we can now hope that Microsoft will come up more softwares in future which support pluggable architecture and a greater degree of flexibility. How this container is going to fare against a myriad of other well known open source DI Containers like Windsor, Spring, StructureMap etc. is still to be seen. But at least we can see a ray of light at the end of a dark tunnel. So hoping for the best while keeping my fingers crossed.

You can download the weekly drop of Unity Framework from here