Archive for February, 2010

.net remoting vs web services

Sunday, February 28th, 2010

Do you choose .net remoting or web services for distributed programming? In a homogeneous environment within an enterprise, the .net removing is a good choice. They are fast and can keep the state between calls. The web services are stateless, low performance compared to .net remoting. The .net remoting requires advanced programming and works on many different protocols like http, tcp, msmq, smtp etc… The web services works over http. The web services are easy to implement and works in heterogeneous environment. The web services are reliable because it runs on IIS and can use it’s security. The .net remoting is not reliable as web services. It does not have a secure model.The web service handles primitive data types primarily for performance. The .net remoting can handle complex data type like dataset.

Developing REST Vs SOAP

Saturday, February 27th, 2010

At this stage, looking at the tools available from Microsoft, it is easy to develop a soap or wcf service. The REST anticipates two steps (1) create a service via soap, wcf (2) upgrade with handlers to confirm to the REST.

Browser Plug-in

Friday, February 26th, 2010

Internet Explorer is my favorite browser. There is a lot of development possibilities with IE for an Enterprise. To develop an IE based application, you have to implement the interfaces of Web Browser and mshtml controls. There is a lot of plumping code to develop an extension for IE if you use. Microsoft has come up with a frame work called SpicIE to develop extensions for IE fast and easy.

To extend the behaviors of the IE, the binary behavior is an interesting thing to consider. The behavior in .htc files can be implemented as binary components in dll.

It is interesting to see how the BHO (Browser Helper Object) has grown to plug-ins, add-ons, browser enhancements.

Don’t be surprised by the output of this program.

Thursday, February 25th, 2010

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Linq;
using System.Collections;

namespace Linq2Xml
{
public partial class MainForm : Form
{
class Rss
{
public string Name;
public string Url;
};

public MainForm()
{
InitializeComponent();
}

private void OnLoad(object sender, EventArgs e)
{
try
{
XDocument feedsXML = XDocument.Load(“Feeds.xml”);

var feeds = from feed in feedsXML.Descendants(“Feed”)
where feed.Attribute(“status”) == null || feed.Attribute(“status”).Value != “disabled”
select new Rss
{
Name = feed.Element(“Name”).Value,
Url = feed.Element(“Url”).Value
};

List<Rss> rsslist = feeds.ToList();

comboBoxBlog.DisplayMember = “Name”;
comboBoxBlog.ValueMember = “Url”;
comboBoxBlog.DataSource = rsslist;
}
catch
{
}
}
}
}

Answer:

Make this change and see the output:

class Rss
{
public string Name {get; set;}
public string Url { get; set; }
};

C# default constructor

Wednesday, February 24th, 2010

Will this code compile?

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Constructor
{
class Animal
{
// Default constructor is not available because there is one custom.
public Animal(string color)
{
}
}

class Dog : Animal
{
public Dog() : base(“black”)
{
}
}

public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}

private void button1_Click(object sender, EventArgs e)
{
Dog booboo = new Dog();
}
}
}