Kevin A. Boucher

The Art of .Net

  Home :: Contact :: Syndication  :: Login
  34 Posts :: 6 Stories :: 15 Comments :: 3 Trackbacks

Article Categories

Archives

Post Categories

Image Galleries

Blogs Worth Reading

Developer Tools

Saturday, May 10, 2008 #

So, we are going back to mainframes (sorta).  First it was big computers in big rooms.  Then everyone had to have their own computer.  We figured out how to connect them, but the model still wasn't quite right.  We've had thick clients and thin clients and problems with each.  We've had shrink wrap software and online software.  We've heard of Software as a Service (SaaS), but it always seemed like a dream wrought with performance and scalability problems. 

The new world is Cloud Computing where the Services are hosted in scalable data warehouses.  The clients follow the client hybrid approach using a technology such as Silverlight or sophisticated Ajax to consume the services and present a rich user experience.  On the server side IT data center issues go away, scalability is built in, and shared resources make it greener.

Software + Services
http://msdn.microsoft.com/en-us/architecture/aa699384.aspx

SaaS Architecture
http://www.microsoft.com/feeds/msdn/en-us/architecture/media/SaaS/splusarcperspectives.asx

Live Mesh (bringing it together)
http://blogs.msdn.com/livemesh/

Microsoft Software Online
http://www.microsoft.com/presspass/press/2008/mar08/03-02AllSizeBusinessesPR.mspx

Bill talks of the Cloud (top priority)
http://www.microsoft.com/winme/0802/32460/Sharepoint_BillG_JaniceKapner.asx

Coca-Cola Online
http://online.wsj.com/article/SB120451096788306801.html?mod=rss_whats_news_technology&apl=y&r=375403

Others
  Amazon EC2: 
http://www.amazon.com/gp/browse.html?node=201590011
  Google:  https://www.google.com/accounts/ServiceLogin?service=ah&continue=http://appengine.google.com/_ah/login%3Fcontinue%3Dhttp://appengine.google.com/<mpl=ae&sig=2441550b0617bb4eb9e7f8c3eb9e63b1

 

posted @ 12:47 PM | Feedback (0)

Friday, November 30, 2007 #

I found the recent article “What's Ailing ASP.NET WEB Forms” by Rick Strahl to be very interesting.  I still agree that the ASP.NET server side has a strong advantage over alternate technologies, but the client needs to be richer.  Web Forms are too simple and people are not ready to fully except Silverlight (and the control set is not there yet).  Integrating a client side framework like ExtJS seems like the best approach... for now.

posted @ 3:51 PM | Feedback (0)

Friday, July 06, 2007 #

In today's Web 2.0 world developers are creating very rich clients with plenty of JavaScript code and little to no logging.  With the tools available today there is no reason not to log on the client side.

Logging is an important tool in any developers toolbox.  If done right logging gives the developer detailed context for application failures.  Logging should not be confused with testing or debugging although in certain instances it can help with the later.

The following is a quick example of how logging on the client side can easily be acheived using Google Gears.  There is potential to expand this small demo into a more sophisticated logging mechanismn with reporting features and server-side transfer of logs if desired.

The basic code and idea behind client side logging is very simple.  Let's look at a little sample logger that uses Google Gears:

Sample Client Side Logger using Google Gears

To get client side logging running on your site all you need to do is include the following JavaScript files in your head section as follows:

  <script type="text/javascript"  src="gears_init.js"></script>
  <script type="text/javascript"  src="glogger.js"></script>

Then you are set to add client side logging in your scripts like this:

  // Log to Google Gears client side database
  log("INFO", "Hello World");

The client side database creation is done in the initialization function of the included glogger.js script.  You can see here how it checks for existence of Google Gears and the database before it tries to create it.

  if (!window.google || !google.gears) {
    return;
  }
  try {
    db = google.gears.factory.create('beta.database', '1.0');
  } catch (ex) {
    setError('Could not create database: ' + ex.message);
  }
  if (db) {
    db.open('database-glogger');
    db.execute('create table if not exists glogger' +
               ' (level varchar(50), msg varchar(1024), timestamp int)');
  }

Inserting, selecting, and deleting from the log table is just as easy.  There are examples of each of these in glogger.js.

The Code:
glogger.html - Web page that logs to client
glogger.js - Logging implementation
gears_init.js - Main Google Gears code


Helper Utilities:
sqlitebrowser.sourceforge.net - SQLiteDatabase Browser
dbquery.html - Web interface to SQLite query analyzer

Happy Client Side Logging!

Let me know if you make any extensions to this code...

posted @ 12:09 PM | Feedback (0)

Friday, February 16, 2007 #

If you're like me you have a ton of bookmarks. Some you go back to frequently and some you only use every so often. The problem is keeping them in sync on all your computers or remembering how to Google the page back. The answer is simple and easy to get used to. The answer is Foxmarks. If you don't use this extension go grab it. Try actually organizing your bookmarks and use ctrl-b to bring them up, and quickly search through them.

While I'm talking about Firefox extensions, if you are a web developer you have to try out Firebug.

For a more complete list of useful extensions, check out this list.
posted @ 8:02 PM | Feedback (0)

Wednesday, July 26, 2006 #

WPF/E?

(Where WPF = Windows Presentation Foundation and E stands for "Everywhere")

 

What is this?  It’s the supposed Flash killer.  A plugin/extension for all browsers on all platforms that knows how to render XAML and has a mini CLR running on the client.

 

http://channel9.msdn.com/showpost.aspx?postid=193367

 

Some day maybe the client will not matter…

posted @ 10:34 AM | Feedback (2)

Friday, January 27, 2006 #

Quail is a real-time log viewing program that I wrote to support large files with color highlighting and search functionality.  Quail also provides a front end to LogParser enabling SQL query support for your logs.

Update (2/25/2006): Fixed bugs around display issues, key handling, and file reload on log rollover.

Update (5/22/2006): Enhanced highlight feature and added load from non-working directory.

Update (10/1/2006): Launch external commands, and window positioning added.

posted @ 1:25 PM | Feedback (1)

Usually you want to control settings in your application via MetaData instead of hard coding values that may change.  With C# serialization this is so easy that you will gladly place settings in a config file.  Take the following example that I have recently been working on:

XML Config File:

<?xml version="1.0" encoding="utf-8"?>
<Options xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Option>
    <DefaultLogLocation>c:\temp\mtlog.txt</DefaultLogLocation>
    <AutoLoadLog>false</AutoLoadLog>
    <TailTimeout>1000</TailTimeout>
    <MaxBytesToLoad>100000000</MaxBytesToLoad>
    <BackgroundColor>WhiteSmoke</BackgroundColor>
    <FilterColor>Teal</FilterColor>
    <DefaultColor>Black</DefaultColor>
  </Option>
  <HighlightItem>
    <ContainsString>[DEBUG</ContainsString>
    <HighlightColor>Black</HighlightColor>
  </HighlightItem>
  <HighlightItem>
    <ContainsString>[INFO</ContainsString>
    <HighlightColor>Navy</HighlightColor>
  </HighlightItem>
  <HighlightItem>
    <ContainsString>[WARNING</ContainsString>
    <HighlightColor>Orange</HighlightColor>
  </HighlightItem>
  <HighlightItem>
    <ContainsString>[ERROR</ContainsString>
    <HighlightColor>DarkRed</HighlightColor>
  </HighlightItem>
  <HighlightItem>
    <ContainsString>[FATAL</ContainsString>
    <HighlightColor>Red</HighlightColor>
  </HighlightItem>
  <HighlightItem>
    <ContainsString>***</ContainsString>
    <HighlightColor>DarkRed</HighlightColor>
  </HighlightItem>
</Options>

 

C# Class to Read and Save:

using System;
using System.Collections;
using System.IO;
using System.Xml;
using System.Xml.Serialization;
namespace Quail
{
  /// <summary>
  /// Options class which will be serialized.
  /// </summary>
  [XmlRoot("Options")]
  public class MyOptions
  {
    [XmlElement("Option")]
    public Option option;
    private ArrayList mHighlightItems;
    public MyOptions() 
    {
      option = new Option();
      mHighlightItems = new ArrayList();
    }
    [XmlElement("HighlightItem")]
    public HighlightItem[] HighlightItems 
    {
      get 
      {
        HighlightItem[] items = new HighlightItem[ mHighlightItems.Count ];
        mHighlightItems.CopyTo( items );
        return items;
      }
      set 
      {
        if( value == null ) return;
        HighlightItem[] items = (HighlightItem[])value;
        mHighlightItems.Clear();
        foreach( HighlightItem item in items )
          mHighlightItems.Add( item );
      }
    }
    public int AddItem(HighlightItem item) 
    {
      return mHighlightItems.Add( item );
    }
    public bool Save()
    {
      // Serialization
      XmlSerializer s = new XmlSerializer( typeof( MyOptions ) );
      TextWriter w = new StreamWriter( @"options.xml" );
      s.Serialize( w, this );
      w.Close();
      return true;
    }
    public static MyOptions Load()
    {
      // Deserialization
      XmlSerializer s = new XmlSerializer( typeof( MyOptions ) );
      MyOptions opt;
      TextReader r = new StreamReader( @"options.xml" );
      opt = (MyOptions)s.Deserialize( r );
      r.Close();
      return opt;
    }
  }
  public class HighlightItem 
  {
    [XmlElement("ContainsString")] 
    public string ContainsString;
    [XmlElement("HighlightColor")]
    public string HiglightColor;
    public HighlightItem() 
    {
    }
    public HighlightItem(string containsString, string color) 
    {
      ContainsString = containsString;
      HiglightColor = color;
    }
  }
  // Option
  public class Option 
  {
    [XmlElement("DefaultLogLocation")] 
    public string DefaultLogLocation = @"c:\temp\mtlog.txt";
    [XmlElement("AutoLoadLog")] 
    public bool AutoLoadLog = false;
    [XmlElement("TailTimeout")] 
    public int TailTimeout = 1000;
    [XmlElement("MaxBytesToLoad")] 
    public long MaxBytesToLoad = 100000000;
    [XmlElement("BackgroundColor")] 
    public string BackgroundColor = "WhiteSmoke";
    [XmlElement("FilterColor")] 
    public string FilterColor = "Teal";
    [XmlElement("DefaultColor")] 
    public string DefaultColor = "Black";
  
    [XmlElement("BorderColor")] 
    public string BorderColor = "WhiteSmoke";
    public Option() 
    {
    }
  }
}

posted @ 11:25 AM | Feedback (0)

Sunday, September 25, 2005 #

Data lives in many different places and the middle layer is always struggling to get it together for the clients.  LINQ will allow developers to treat data in a standard way whether it is in memory or not.  Query set operations become first class citizens in the programming language allowing you to query against objects (that support  IEnumerable), relational databases, or XML.  LINQ allows you to join in memory data with data in the database. 

See: The LINQ Project

 

posted @ 10:24 AM | Feedback (0)

Wednesday, July 06, 2005 #

AJAX or Asynchronous JavaScript and XML is by no means a new technology.  I have been using this technique to prevent page refreshes and create dynamic pages for 5 years now.  However, it seems that tossing a new acronym at technology makes people believe it will save the world.  No wait that is XML.  Alas, I'm not sure Microsoft has the right idea with the Atlas project (and they are a bit late).  To me it seems the user is still stuck in an environment that was not created for a rich end user experience.  I have written an article (Putting Performance into Your ASP.NET Application with Managed Client Side Controls) that proposes a work around to this problem for now.  In the end, I do think Avalon's Express Applications may be the real answer (as long as we don't leave Firefox behind).  I'm not crazy about another markup language like XAML, but often creating a specific language can be the best way to solve a discrete problem.

There is obviously still a place for AJAX in simple web applications that require an interactive dynamic element to improve usability.

posted @ 8:20 PM | Feedback (0)

Thursday, May 19, 2005 #

I believe every level of developer will benefit from reading “The Pragmatic Programmer” by Andrew Hunt and David Thomas.  This book looks at the complete software life cycle and gives insightful tips at each stage.  By the end you will take pride in every line of code you write.  It is also full of useful design techniques such as tracer bullets.  A must read for every developer.

posted @ 3:37 PM | Feedback (0)

"A little learning is a dangerous thing;
Drink deep, or taste not the Pierian spring:
There shallow draughts intoxicate the brain,
And drinking largely sobers us again."
- Pope