Controlling our ClientIDs in ASP.NET 4

December 10, 2010 § Leave a comment

Introduction to ClientIDs in ASP.NET 4

Microsoft has released ASP.NET 4 with a lot of new features. One that seems small on the surface is a feature that I am very excited about. It has the potential to really clean up my code, and make JavaScript a lot easier for me to write and maintain. This little feature that could is the ClientIDMode property that lets you define how client ids are maintained in your ASP.NET code.

What are ClientIDs?

Each control on an ASP.NET page has two names. The first is the control name, and this is the name of that object as it relates to code on the server side. When you want to access the text property of a text box you will use the control name to do so. In the .aspx file you would declare the text box control:

  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

And in your code behind you would refer to it as so:

  string newName = TextBox1.Text;

But when it comes to referring to this text box from within the browser (most likely with JavaScript or a framework on JavaScript like JQuery) ASP.NET generates a client side ID for it. This is called the client id. In many scenarios this client id is the same as the control id. If you view the source of your site, you will see this in action. If we put a textbox and a button on a normal .aspx page you will see this for the HTML:

  <div id="topPanel">
       <input name="TextBox1" type="text" id="TextBox1" />
       <input type="submit" name="Button1" value="Button" id="Button1" />          
  </div>

This isn’t too bad to work with since the client id matches the control id we are used to. But when you put these same controls inside a content placeholder as part of a master page (or a grid, or any other control container), a whole new set of client ids appear. This is because they now have a nested relationship.

  <div id="ctl00_ContentPlaceHolder1_topPanel">
          <input name="ctl00$ContentPlaceHolder1$TextBox1" type="text"     id="ctl00_ContentPlaceHolder1_TextBox1" />
          <input type="submit" name="ctl00$ContentPlaceHolder1$Button1" value="Button" id="ctl00_ContentPlaceHolder1_Button1" />    
  </div>

So now in my JavaScript I have to refer to a control called'ctl00_ContentPlaceHolder1_Button1' instead of just 'Button1'. This leads to messy, hard to maintain code.

How the Control Tree Works

All controls on your page are organized in a tree structure on the page by ASP.NET. In our first example, all of the controls were direct children of the form itself. In our second example they became children of the content placeholder control, which itself was a child of the form. This tree represents the hierarchy, or family structure, of the controls and how they related to one another.

ASP.NET generates names for your controls at runtime based on this tree. If there is just one level, they are given names that are the same (or similar) to their control id. If, you have controls nested, then the name is a concatenation of the controls name, and all of its parents, in one long string. This is to avoid any naming conflicts between all of the controls on the page.

This doesn’t look hard in our simple sample, but take a look at a dynamically generated grid with a hundred rows and ten columns and your head will explode (sample not provided because we are concerned with your safety).

How to Control your Client ID

ASP.NET 4 has a new feature that lets you control the client ids generated for your controls. You can control this at the application level, the page level, or at the control level, to suit your needs. You can control this behavior by setting a property called ClientIDMode.

There are four options for this new property:

  • AutoID: This follows the old behavior, resulting in long, complex, and extremely unique client ids. You might use this mode if this behavior doesn’t bother you, or perhaps you have some legacy JavaScript you don’t have time to update yet.
  • Static: This forces the client id to always match the control id (or the ID parameter on the control). This is very nice and gives you a consistent naming structure on the client and the server, but does leave open the problem of conflicting control names in some scenarios. This is my preferred setting when I can get away with it.
  • Predictable: This uses the same algorithm as the AutoID mode to generate names, but it avoids the crazy parent control prefixes like ct100_. This setting makes sure you have no conflicts in names, but keeps them somewhat cleaner. When working with a container control, like a grid, that will have a lot of child controls you can force your own prefix (example: salesGrid), giving you some control over your code readability. To do this you would set the ClientIDRowSuffix property on the parent control.
  • Inherit: This mode tells the control to inherit its naming behavior from its naming container (which may not necessarily be its control container).

How to Use It

To declare this for the entire web application you have to add a setting to your web.config in thesystem.web section.

  <system.web>
  	<pages clientIDMode="AutoID"></pages>
  </system.web>

In this example I set the behavior to AutoID. Remember that this feature is only supported in ASP.NET 4, so you have to change the .NET framework version of your project in the project properties before this will work.

To change the naming behavior for just a single page (perhaps you want to migrate one page at a time from the old way to the new way) you would add a property to the page declaration in the aspx file.

<%@ Page Title="" Language="C#" MasterPageFile="~/Site1.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="Code.WebForm1" ClientIDMode="Inherit" %>

In this example we set the property for all controls on this page to Inherit.

And finally, to change how a single control might name itself and its children (most likely on a grid or some sort of control) you would add a property to the controls declaration:

  <asp:Button ID="Button1" runat="server" Text="Button" ClientIDMode="Static" />

Summary

Prior to ASP.NET 4 client ids were generated for you, sometimes resulting in ids that were very hard to work with. This behavior did make sure that with all of the nested controls on the screen you never ended up with a naming conflict on a control, it did result in some hairy JavaScript.

With ASP.NET 4 you can now use the ClientIDMode property to control how ASP.NET names your controls. The setting can be declared for the whole application, just a page, or a single control. You can set it to continue naming controls the old way, forcing a specific control name, or to use a new cleaner way to name them. You also have the option of telling a control to inherit the naming behavior from its naming parent.

Awaiting Future C# Asynchronous Features Brought to you by .NET Parallel Computing

December 10, 2010 § Leave a comment

Introduction

New C# programming feature announcements are always big news. Microsoft recently announced new C# programming features for making asynchronous programming easier. This is good for developer’s building applications requiring asynchronous programming, but why venture into asynchronous code if it’s not required? The short answer is application users are always looking for a better experience. Look to the adoption of the Graphical User Interface and increasingly more powerful mobile applications for examples of tech savvy consumers demanding a better experience.

Make the skills involved in creating a new user experience more accessible to the average developer and every developer starts incorporating the new user experience into their application. Eventually the new experience is common and not long afterward the new experience becomes a necessity. By making asynchronous coding easier, will this new language feature turn the application responsiveness developers get with asynchronous code into a needed experience?

To help answer that question, using sample code from the “Async CTP”, I’m going to walk through the new asynchronous development experience and contrast the development experience with asynchronous code and synchronous code written using current techniques. I’ll start with an overview of the sample code.

Sample Overview

Improved User Interface responsiveness is the canonical business case for employing asynchronous code. You’ll find the source code for the “Netflix” sample among the resources at the end of the article. As I mentioned earlier this is a Community Technology Preview (CTP). Like all CTPs and Betas, unless explicitly stated, the underlying implementations are subject to change.

A graphic of the sample in action appears below.

[Demo.gif]
Figure 1 Sample in action

As you can see a user enters a year and the application displays all the movies of that year. The code is divided into three samples:

  • A sample developed using the synchronous experience.
  • An asynchronous sample developed using delegates (Actions).
  • An asynchronous sample developed using the new Async features.

As stated earlier, I’ll walk through each sample comparing and contrasting the synchronous, current asynchronous and new asynchronous development experience.

Synchronous

The code from the synchronous sample appears below.

  void LoadMovies(int year)
  {
      resultsPanel.Children.Clear();
      cts = new CancellationTokenSource();
      statusText.Text = "";
      var pageSize = 10;
      var imageCount = 0;
      try
      {
          while (true)
          {
              statusText.Text = string.Format("Searching...  {0} Titles", imageCount);
              // (status text doesn't work because the UI never has a breather to show it)
              var movies = QueryMovies(year, imageCount, pageSize, cts.Token);
              if (movies.Length == 0) break;
              DisplayMovies(movies);
              imageCount += movies.Length;
          }
          statusText.Text = string.Format("{0} Titles", imageCount);
      }
      catch (TaskCanceledException)
      {
      }
      cts = null;

  }

  Movie[] QueryMovies(int year, int first, int count, CancellationToken ct)
  {
      var client = new WebClient();
      var url = String.Format(query, year, first, count);
      var data = client.DownloadString(new Uri(url));
      var movies =
          from entry in XDocument.Parse(data).Descendants(xa + "entry")
          let properties = entry.Element(xm + "properties")
          select new Movie
          {
              Title = (string)entry.Element(xa + "title"),
              Url = (string)properties.Element(xd + "Url"),
              BoxArtUrl = (string)properties.Element(xd + "BoxArt").Element(xd + "LargeUrl")
          };
      return movies.ToArray();
  }

The code above works like you would expect. LoadMovies is the main body of the collection process. Using the WebClient class QueryMovies gathers the movie information into one large XML string, parses the string and creates an array of Movie classes. DisplayMovies renders Bitmaps from the URLs stored in the array of Movie classes.

If you run the synchronous sample, it won’t take long before you want to simply cancel it and move on to running the other samples. Far more performant code can be written using asynchronous functions. As stated earlier the first asynchronous sample is written with delegates.

Async with Delegates

Sample code written using delegates (Actions) appears below.

  void LoadMoviesAsync(int year)
  {
      resultsPanel.Children.Clear();
      cts = new CancellationTokenSource();
      statusText.Text = "";
      var pageSize = 10;
      var imageCount = 0;
      Action<Movie[],Exception> action = null;
      action = (movies,ex) =>
      {
          if (ex != null)
          {
              cts = null;
              if (ex is TaskCanceledException ||
                  (ex is WebException && (ex as WebException).Status == WebExceptionStatus.RequestCanceled))
              {
                  return;
              }
              else
              {
                  throw ex;
              }
          }

          statusText.Text = string.Format("Searching...  {0} Titles", imageCount);
          if (movies.Length > 0)
          {
              DisplayMovies(movies);
              imageCount += movies.Length;
              QueryMoviesAsync(year, imageCount, pageSize, cts.Token, action);
          }
          else
          {
              statusText.Text = string.Format("{0} Titles", imageCount);
          }
      };

      QueryMoviesAsync(year, imageCount, pageSize, cts.Token, action);
  }

  void QueryMoviesAsync(int year, int first, int count, CancellationToken ct, Action<Movie[], Exception> processMovies)
  {
      var client = new WebClient();
      var url = String.Format(query, year, first, count);

      ct.Register(delegate
      {
          client.CancelAsync();
      });

      client.DownloadStringCompleted += (sender, e) =>
      {
          if (e.Error != null)
          {
              processMovies(null, e.Error);
              return;
          }
          if (e.Cancelled)
          {
              processMovies(null, new TaskCanceledException());
              return;
          }

          var data = e.Result;
          var movies =
              from entry in XDocument.Parse(data).Descendants(xa + "entry")
              let properties = entry.Element(xm + "properties")
              select new Movie
              {
                  Title = (string)entry.Element(xa + "title"),
                  Url = (string)properties.Element(xd + "Url"),
                  BoxArtUrl = (string)properties.Element(xd + "BoxArt").Element(xd + "LargeUrl")
              };
          processMovies(movies.ToArray(), null);
      };

      try
      {
          client.DownloadStringAsync(new Uri(url));
      }
      catch (Exception ex)
      {
          processMovies(null, ex);
      }
  }

The sample leverages the WebClient asynchronous function versions.

One of the main differences between this sample and the prior sample is this sample wires up a lot of code and then sets the code in motion. Much of the control flow in the application has moved from theLoadMovies function to the execution status of the WebClient class.

Moving the code required some new exception handling. Sprinkled throughout the sample are cancellation checks after the asynchronous invocations.

Core application execution happens in code defined inLoadMoviesAsync and executed inside of QueryMoviesAsync. So, it’s difficult to understand where the execution of the movie search actually begins and ends. A developer must read all the code to understand where it starts and ends. Contrast this with the synchronous example that starts at the top and drops out of the bottom.

The third example attempts to strike a happy medium and give a developer the performance of asynchronous, but the readability of synchronous.

Async with Await Statement

The sample code leveraging the Await statement appears below.

  async void LoadMoviesAsync(int year)
  {
      resultsPanel.Children.Clear();
      cts = new CancellationTokenSource();
      statusText.Text = "";
      var pageSize = 10;
      var imageCount = 0;
      try
      {
          while (true)
          {
              statusText.Text = string.Format("Searching...  {0} Titles", imageCount);
              var movies = await QueryMoviesAsync(year, imageCount, pageSize, cts.Token);
              if (movies.Length == 0) break;
              DisplayMovies(movies);
              imageCount += movies.Length;
          }
          statusText.Text = string.Format("{0} Titles", imageCount);
      }
      catch (TaskCanceledException)
      {
      }
      cts = null;

  }

  async Task<Movie[]> QueryMoviesAsync(int year, int first, int count, CancellationToken ct)
  {
      var client = new WebClient();
      var url = String.Format(query, year, first, count);
      var data = await client.DownloadStringTaskAsync(new Uri(url), ct);
      var movies =
          from entry in XDocument.Parse(data).Descendants(xa + "entry")
          let properties = entry.Element(xm + "properties")
          select new Movie
          {
              Title = (string)entry.Element(xa + "title"),
              Url = (string)properties.Element(xd + "Url"),
              BoxArtUrl = (string)properties.Element(xd + "BoxArt").Element(xd + "LargeUrl")
          };
      return movies.ToArray();
  }

At first glance the code looks a lot like the synchronous example. Closer inspection reveals three new components absent in the prior two samples:

  1. An “Async” keyword tagged to the functions.
  2. The Await keyword
  3. New Extension Functions for the WebClient class

According to the documentation “Async” is needed to signal the compiler that an “Await” statement will be used in the function. “Await” is really where all the action happens, but before looking at Await some discussion of the Task class is in order.

A complete introduction to the Task class is beyond the scope of this article, but you’ll find helpful material here in my repvious article, Understanding Tasks in .NET Framework 4.0 Task Parallel Library.

To summarize, think of a Task as a wrapper for a piece of work (delegate). Tasks can be sent to a “Scheduler” for execution and can be aborted during execution. Tasks can return values, accept parameters, and return exceptions. Tasks can be joined to other Tasks, so the completion of one Task can start another Task (Continuation).

Await leverages the attributes of the Task class. I’ll walk through what “Await” is doing using theQueryMoviesAsync function as an example. QueryMovieAsync function returns a Task<movie[]> class as soon as the function encounters the Await statement. In the “Async with delegates” sample, some other code does similar work, however the work had to be arranged according to the patterns in theWebClient class. In the Async sample, the complier does the arranging for you. So, when the Task completes the remaining part of the function executes.

New Extension Functions have been added to existing .NET Framework classes to take advantage of the “Await” statement’s capabilities. These new functions return Task<t> classes instead of the usual Type.

Most important to notice is; though the code has synchronous readability having to deal with Task classes gives it a more asynchronous feel. There are special characteristics of asynchronous code that simply should not be hidden from a developer. So, the “Async” emphasis is more on making the code easier to structure.

Conclusion

“Await” is a new keyword in an upcoming version of C# programming. The new “Await” keyword leverages features of the Task class from the .NET Framework 4.0. Coupled with a new set of Extension Functions on existing .NET classes; the “Await” keyword results in a more approachable asynchronous development experience.

Re-CAPTCHA is a bi-directional challenge response test used on standalone and wireless devices to determine whether a recipient is an authorized human and not not a computer.

December 5, 2010 § Leave a comment

Re-CAPTCHA is a bi-directional challenge response test used on standalone and wireless devices to determine whether a recipient is an authorized human and not not a computer.

From the initial outset of establishing the credibility of solicited/unsolicited wireless communication(s), the remittance broker bears the onus of proving their credential to the recipient, just as much as it is expected of the recipient to prove their identity to the remittance broker.

This is achieved by the recipient examining a Re-CAPTCHA test(s) which is an Anti-Phishing test, issued by the remittance broker, to ensure that the intended recipient has received the communication; and to ensure that the recipient has the correct capability to accept or deny critical financial events.

If the recipient is satisfied with the remittance brokers anti-phishing credential, the recipient then proceeds to authorize or deny financial events such as credit card transactions flagged as suspicious or access to critical online resources. The recipient combines the token key, with that of the anti-phishing key, and their personal key which is randomized to protect the recipient’s static keys from reuse attackers.

Re-CAPTCHA achieve their objective of improving authenticated exchanges by being used in place of forgeable references. A forgeable reference (for example, a path name) identifies an object, but does not specify which access rights are appropriate for that object and the user program which holds that reference. Consequently, any attempt to access the referenced object must be validated by the operating system, typically via the use of an access control list (ACL). Instead, in a system with Re-CAPTCHA capabilities, the mere fact that a user program possesses that capability entitles it to use the referenced object in accordance with the rights that are specified by that capability.

 

Storing Additional User Information with ASP.NET Membership

December 3, 2010 § Leave a comment

Membership, in a nutshell, is a framework built into the .NET Framework that supports creating, authenticating, deleting, and modifying user account information. Each user account has a set of core properties: username, password, email, a security question and answer, whether or not the account has been approved, whether or not the user is locked out of the system, and so on. These user-specific properties are certainly helpful, but they’re hardly exhaustive–it’s not uncommon for an application to need to track additional user-specific properties. For example, an online messageboard site might want to also also associate a signature, homepage URL, and IM address with each user account.

There are two ways to associate additional information with user accounts when using the Membership model. The first–which affords the greatest flexibility, but requires the most upfront effort–is to create a custom data store for this information. If you are using theSqlMembershipProvider, this would mean creating an additional database table that had as a primary key the UserId value from the aspnet_Users table and columns for each of the additional user properties. The second option is to use the Profile system, which allows additional user- specific properties to be defined in a configuration file. See Part 6 for an in-depth look at the Profile system.

This article explores how to store additional user information in a separate database table. We’ll see how to allow a signed in user to update these additional user-specific properties and how to create a page to display information about a selected user. What’s more, we’ll look at using ASP.NET Routing to display user information using an SEO-friendly, human-readable URL like http://www.yoursite.com/Users/username. To read the entire article, Storing Additional User Information with ASP.NET Membership, click here.

 

10 More C# Programming and Microsoft Visual Studio Tips and Tricks

December 3, 2010 § Leave a comment

Introduction

If you hit this page through a search engine, I would recommend the first article of this series, 10 C# Programming and Microsoft Visual Studio Tips and Tricks. Volume 2 of this series brings another bunch of useful recommendations for C# developers.

  1. DataTable.HasRows? – No. This is not part of any framework yet. But it is easy to imitate such a method through extension methods.This does not eliminate the primitive code that checks for the data table object being null or the Rows count, but simply simplifies the code in the applications. Below is the code snippet:
       <CODE>
                          public static bool HasRows(this DataTable dataTable)
               	{
                   		return dataTable.IsNull() ? false : (dataTable.Rows.Count > 0);
               	}
    
       	public static bool IsNull(this object o)
               	{
                   		return (o == null);
               	}
    
       	    To use:
       	If(dataTable.HasRows())
       	{
       	  …
       	}
             </CODE>

Other rules pertaining the Extension methods remain same.

  • ToTitleCase – The Titlecase is a casing behavior that converts the first character of a word to uppercase and the rest of the characters in the word to lowercase.For e.g. “look below for a sample” in titlecase becomes “Look Below For A Sample”.

    Yes, the TextInfo class that is part of the System.Globalizationnamespace does this but it has the following problems of its own.

    1. The current culture
    2. If the input string is in complete uppercase.

    The following extension method takes both this pitfalls into consideration.

       <CODE>
                   public static string ToTitleCase(this string inputString)
                   {
                      return Thread.CurrentThread.CurrentCulture.TextInfo.
       	ToTitleCase((inputString ?? string.Empty).ToLower());
           }
              </CODE>
  • Explicit and Implicit Interface Implementation – Does it matter?Yes, very much. Did you know other than the syntax difference between the two, there existed a fundamental difference.

    Implicit interface implementation on a class would be a public method by default and is accessible on the class’s object or the interface.

    Explicit interface implementation on a class would be a private method by default and is only accessible through the interface and not through the class object unlike the implicit implementation. Yes, through this you can force you clients to use the Interface and not the objects that implement it.

    Examine the code sample below:

      <CODE>
    
        	INTERFACE
      public interface IMyInterface 
      {
         void MyMethod(string myString);
      }
    
         	CLASS THAT IMPLEMENTS THE INTERFACE IMPLICITLY
      public MyImplicitClass: IMyInterface
      {
         public void MyMethod(string myString)
         {
          ///
         }
      }
    
      	CLASS THAT IMPLEMENTS THE INTERFACE EXPLICITLY
      public MyExplicitClass: IMyInterface
      {
         void IMyInterface.MyMethod(string myString)
         {
          ///
         }
      }
    
      MyImplicitClass instance would work with either the class or the Interface:
      MyImplicitClass myObject = new MyImplicitClass();
      myObject.MyMethod("");
      IMyInterface myObject  = new MyImplicitClass();
      myObject.MyMethod("");
    
      MyExplicitClass would work only with the interface:
      //The following line would not work.
      MyExplicitClass myObject = new MyExplicitClass();
      myObject.MyMethod("");
      //This will work
      IMyInterface myObject = new MyExplicitClass();
      myObject.MyMethod("");
    
      </CODE>
  • Auto Properties – This is a favorite replacement for the property creation that involved a public and two private members.Type prop – and press the tab key twice (You need to have code snippets enabled). Voila! An Autoproperty is created for you. Press tab and give a name for the Auto property.
      <CODE>
    
      private double _total;
      public double Total 
      {
      	get { return _total; }
         	set { _total = value; }
      }
    
      </CODE>

    Now becomes,

      <CODE>
    
      public double Total { get; set; }
    
      </CODE>

    Note that you can still apply the access specifiers as per your design. The compiler , would take care of the creation of private member varaibles for you.

  • The Mighty Path.Combine
    Yes, the Path.Combine feature is so powerful that it removes the hassle of trailing slashes and the mixed up path problem. It is simple to use, and does the path string concatenations without much of a hassle.

    It takes a param of string paths and combines it for you.

    C#: Path.Combine Sample
    Figure 1

    Note that you do not have to worry about the valid separator character in the paths or whitespace. You do not have to deal with the less reliable string concatenation methods for path combinations.

  • Quick way to write “Override” methods in a class
    Type “override” and press the space key. You will be listed with the list of overridable methods in the base class.

    C# Override methods in a class
    (Full Size Image)
    Figure 2

  • Use External Configuration Files
    Thanks to the application (app.config) and web configuration (web.config) files, we are able to deal with the intricate application level settings. However, we still deal with problems of dealing with these settings for different environments. Yes, I am talking about the development, testing and production environment settings.

    We would have to revert to a particular environment and carry out an analysis, test or even have a need to debug some parts of the code. It becomes tedious to change each and every setting in this process.

    One such setting section that every application would have is the ConnectionStrings collection. You can now use the “ConfigSource” property to handle this through external file references.

    Look at the markup below that references a configuration file named “deveploment.config“:

      <connectionStrings configSource="configs\ development.config" />

    Yes, you can use this useful attribute with AppSettings sections too.

  • Overcoming the limitations of String.Split method
    So much of delimited data around, who does not have the need to split them? String.Split is the ideal candidate for splitting a delimiting string.

    However, as we know, it has a limitation on the character used to delimit the string. Characters such as “||”, or “::” cannot be used. We have to look at the keyboard for unique single character to use as a delimiter.

    This problem can be overcome by using the Split method provided by the RegEx library. The following sample uses the RegEx Split to split a “||” delimited string.

      <CODE>
    
      	string delimitedString = "String.Split || RegEx.Split");
      	string[] ouputString   = System.Text.RegularExpressions.Regex.Split(
      			delimitedString, 
      			, System.Text.RegularExpressions.Regex.Escape("||"));
      </CODE>
  • Quickly Navigate to and Element’s HTML source to Design View and vice-versa
    We spend a good amount of time on the IDE designing our applications. And the time spent on viewing the HTML content and on the design view accounts for a good part of it. There is a quickly way to navigate between the views and locate the HTML elements.

    If you are in HTML view, locate the element that you want to see in the design view, and then switch to design view. The element would be selected. Moreover, properties window would now show the properties of the selected elements.

    Similarly, when you are in design view, select the element and then switch to source view; the source of the HTML element will be highlighted for you.

  • Quickly search for data in a datatable
    Although the data table supports the Find and the Select method for selecting rows, there are not a good choice against a DataView‘s similar method.

    The DataView provides us the FindRows method which would internally use the index created on the sorted column.

    Conclusion

    Hope these help you save some precious programming time. I’ll be back very soon with some more tricks.

  •  

    10 Best Things Microsoft Did in 2010

    December 2, 2010 § Leave a comment

    10 Best Things Microsoft Did in 2010

    When it comes to the enterprise, Microsoft hit the ball out of the park in 2010. Here’s our favorite offerings.

    It’s been a successful year for Microsoft. The company took a lot of heat, but overall accomplished quite a bit — especially for its enterprise customers. Here’s our top tips for what Redmond got right in the past year.

    BTW: Because we’re an IT publication, we focused on Microsoft’s enterprise offerings, and left off those from its entertainment/gaming division (Go Kinect!), with allowances for Windows Phone 7 because of its enterprise applications. Be sure to post your favorite 2010 Microsoft product — both for IT and consumer — in our comments section!

    10. Office for Mac 2011
    Oft-neglected Mac users finally have an improved version of Office. Most notable is the inclusion of an Outlook client for the Mac.

    9. Bing
    Microsoft completed its integration with Yahoo! (replacing the Yahoo! search engine with Bing) in the United States and Canada in August. It also integrated the ad platform so advertisers have one platform to work with. Bing continues to gain share, but it’s still overshadowed by Google.

    8. Windows Intune
    Microsoft released two beta versions of this cloud-based systems-management tool. When it becomes available next year, Windows Intune will allow midsize IT departments to manage updates, centralize malware protection, perform proactive monitoring and track inventory, among other things. Perhaps best of all, the $11 per PC per month subscription includes Windows 7 Enterprise upgrade rights and the option to purchase the Microsoft Desktop Optimization Pack for an additional $1 per PC per month. As an added bonus, Microsoft released a free version of Microsoft Security Essentials for small businesses.

    7. Visual Studio 2010
    Launched in April, Microsoft’s popular IDE got a major facelift with substantial visual editing improvements, a new code editor, extended language support and parallel programming capabilities. It’s also optimized for SharePoint and cloud development.

    6. Lync Server 2010
    Microsoft released its successor to Office Communications Server 2007, Lync Server 2010, providing what it promises is the first viable alternative to PBXes. Microsoft intends to be a major player in the office telecom market.

    5. SQL Server 2008 R2
    Not only did Microsoft ship SQL Server 2008 R2 this year, but it has started shipping SQL Server 2008 R2 Parallel Data Warehouse Edition (code-named “Madison”) based on the massive parallel processing product that Microsoft acquired nearly two years ago from DATAllegro Inc. The solution appears on hardware in mid-December as part of the new HP Enterprise Data Warehouse Appliance. Microsoft last month released the community technology preview (CTP) of the next version of SQL Server, code-named “Denali,” which it says will up the bar on scalability and availability.

    4. SharePoint 2010
    In May, Microsoft launched SharePoint 2010 with some key new features:
    support for enterprise search, centralized administration, digital asset management and business connectivity services.

    3. IE 9
    Microsoft showed it’s not going to go back to its days of complacency in the browser market with the recent release of the Internet Explorer 9 beta. Among other things, Internet Explorer 9 emphasizes HTML5 support.

    2. Windows Phone 7
    In 2010 Microsoft announced, lined up partners for and delivered its successor to Windows Mobile with a brand-new and unique UI. Whether it’s able to put a dent into the momentum of Droids and iPhones remains to be seen, but Microsoft appears to be back in the game.

    1. Cloud
    Microsoft went “all-in” in the cloud this year. The company released its Windows Azure and SQL Azure cloud Platform as a Service (PaaS) in February and in October announced a roadmap that promises to flesh out the offering in the coming year in support of hybrid cloud services. Microsoft also announced numerous big wins for its Business Productivity Online Suite, which the company is re-branding as Office 365. Moreover, Microsoft announced the Windows Azure Platform Appliance, which will let large enterprises and partners run Windows Azure on-premises.

     

    Wondering why Microsoft Office 2010 isn’t on this list?

    10 Top Office 2010 Features

    Thought we left Office 2010 off the 10 Best Things Microsoft Did This Year list? No, we thought it deserved its own section, as it was perhaps the most important new product from Microsoft in 2010. Here are our 10 favorite features in the new suite.

     

    • The Ribbon: The Ribbon is about as divisive as a speech by Newt Gingrich or Keith Olbermann. Many find it more intuitive, while just as many are confused. Like it or hate it, it’s a centerpiece of the entire suite.
    • Locking the Office Doors: Office is a big target for hackers. One new piece of protection is Data Execution Prevention, which keeps rogue EXEs from running in memory space reserved for data.
    • Backstage: Backstage shows up when you click the file tab. Instead of a simple list of functions, Backstage has a center panel that shows up when you click a task, and it presents options related to that task.
    • Most Excel-lent: Excel 2010 has two main new features: PivotTables, which can be enhanced through Slicers (which offer better filtering of the data), and Sparklines, which can take a single cell and create a mini-popup chart that demonstrates patterns.
    • A Brighter Outlook: Outlook is more and more the master of your communications. Now, it not only manages alternative e-mail back-ends such as Gmail and Hotmail, but it even ties directly to social networks.
    • Office Web Apps: Office 2010 includes scaled-down Web versions of core apps such as OneNote, PowerPoint, Word and Excel. With Office Web Apps, you can work entirely online with a Web browser – even storing files on Windows Live.
    • Get the Picture: PowerPoint and Word feature picture editors that used to be the domain of dedicated programs; the new editors can even adjust saturation and color temperature.
    • Making a Powerful Point: Similar to how Word and PowerPoint can edit pictures, you can now edit video from within PowerPoint 2010.
    • Spell Check: Often we spell a word correctly, but it’s just the wrong word. Word 2010 helps stop that with context-sensitive spell check, and thus should know the difference between “there” and “their.”
    • Found in Translation: Word includes a built-in language translator, perfect for an international company or your kid’s homework.


    The Pros and Cons of Developing for the Cloud

    December 1, 2010 § Leave a comment

    While more and more developers are using the cloud for development, not all of them know what they are getting into. Key issues to consider are: choosing which platform to use, bandwidth, standards, security concerns about data, and the integrity of data.

     

    When developers chose the cloud, they invariably choose that layer of the cloud known as Platform as a Service (PaaS). Two of the best-known and widely used platforms are Google AppEngine and Amazon EC2.

    The other layers of the cloud are APIs and data.

    In terms of PaaS, Google, Amazon and others have taken advantage of the commoditization of hardware (and related software) by building systems made up of a lot of cheap machines, said Rozlog, product manager for Delphi Solutions at Embarcadero Technologies, a provider of tools for developers and database professionals.

    The benefits of this commoditization are that the entire infrastructure continues to work even if individual machines break, and developers can virtualize dozens of hundreds of machines very quickly, said Rozlog.

    “Google and Amazon (to name just two vendors) have enormous infrastructures that they can rent out to developers very cheaply,” he said. “For example, Amazon charges as little at 2 cents per hour for micro-on-demand instances. Users pay only for what they use. There is no minimum fee.”

    The major advantage of cloud computing is being able to quickly turn applications on and off and to elastically grow your computing power on an as-needed basis.

    Google’s and Amazon’s cloud infrastructures, are quite different. Google’s AppEngine is more of a platform for developing Java Web applications. Amazon’s EC2 offering is less of a development platform and more of a generic infrastructure service that hosts virtual machines (which can be Linux- or Windows-based) on which you can run anything you’d like.

    Amazon also offers structured data storage with its SimpleDB service. SimpleDB allows structured data to be saved and queried through a Web services interface.

    The second layer of the cloud – the APIs – is a rich area that developers can mine easily and quickly, said Rozlog.

    Wikipedia defines a cloud API as “a mechanism by which software can request information from one or more cloud computing platforms through a direct or indirect interface into a Cloud Computing Platform.”

    While there are many examples of cloud APIs, there are two broad classes – those created by cloud providers and cross-platform APIs. The cross-platform ones attempt to abstract the details of cloud provider implementations so that a developer writing an application only has to call a single API to get a response regardless of the back-end cloud.

    Cloud APIs can perform infrastructure, service or application functions or some combination.

    “What these APIs provide are lots of time-saving, money-saving ways to do things that would be a big pain or impossible otherwise,” said Rozlog.

    For all its many benefits, the cloud is not without its share of concern, even negatives for developers.

    The main concern for most developers and companies is: will my data be safe?

    “Concern over data security stops many developers from putting their data in the cloud,” said Rozlog. “From what I’ve seen, very few companies entrust their data to the cloud, and those do entrust it, entrust a very small amount of it.”

    While sensitive or personal information about customers or patients is clearly the biggest security issue, companies are also concerned about the safety of non-sensitive but valuable data.

    An example of the latter is aggregate information about users and how they use an application.

    Who is accessing data in the cloud is not the only thing to worry about, he notes. The integrity of the data is a concern for developers. Machine failure has to be expected, so it’s crucial that data can be backed up and restored in case of failures.

     

    Where Am I?

    You are currently viewing the archives for December, 2010 at Naik Vinay.