Archive for Development

C# Inheritance Tutorial

C# inheritance model is quite simple to understand. Typical example would be a “Person” class that gets extended by “Employee” and “Customer” classes etc. I have defined two classes below to show the concept.

public class Person

{

public String Name;

public int ID;

public int Age;

public Person()

{

}

// Defined a virtual PersonType method

public virtual string PersonType()

{

return “Person”;

}

}

public class Employee : Person

{

// When employee constructor gets called, it also calls the constructor defined on the parent class automatically.

public Employee() : base()

{

}

public DateTime DateHired;

public overrides string PersonType()

{

return “Employee”;

}

}

Now the Employee class has all the fields defined in “Person” class available and in addition there is a DateHired field.

To use your classes:

Person person = new Employee();

This creates a new instance of an Employee class and puts the reference into the person variable. This is possible since the Employee class inherits from the Person class. If you call the PersonType method on “person” object instance what do you think will be the result?

“Person” or “Employee”?

The beauty is that the overridden method gets called even though the variable instance is of type “Person” and PersonType method returns “Employee”.

I’ll be posting more tutorials soon that build up on this one.

Advertisements

Leave a Comment

A cool article that shows how to implement MetaWebLog API in .NET

I have been researching various blogging software and tools for last few days. Mostly out of curiosity I started looking at various published APIs that allow client side tools to interact with blogs. My curiosity led me to this cool article that shows how to implement MetaWebLog API in .NET. There are three main API sets that I came across and those are Blogger, MetaWebLog and LiveJournal. MetaWebLog from what appears to be is a superset to Blogger API, but LiveJournal is different.

The article goes into details on how to create an HttpHandler and then also define the MetaWebLog data structures. Checkout the article here.

Leave a Comment

Drawing in plain old javascript

I just found this really cool article that shows how to draw lines in javascript and then I found this tool called EasyDiagram.net it is a diagramming tool built in ASP.NET and AJAX.

Amazing!

Comments (1)

Is Astoria (ADO.NET Data Services) going to be the answer to cloud computer?

I think there is a lot of confusion in developer community as to where is Microsoft going with Astoria, Silverlight, SQL Server Data Services and Entity Framework.  I just read an article on VS Magazine titled Manipulate Data in the Cloud with ADO.NET. After reading I realized that article simply covers Data Services and REST implementation etc but doesn’t really show anything remotely related to cloud. I guess the author forgot the cloud in a cloud 🙂

Don’t get me wrong I liked the article but don’t agree with the title.  Sometimes I feel I am the only one pulling my hair looking at some of the new stuff being thrown in by Microsoft.  I think my dream of being able to create applications by just thinking about them isn’t going to be a reality anytime soon.

Comments (1)

Is Silverlight going to kill Flash?

I saw this article on a website

http://arstechnica.com/news.ars/post/20070501-microsofts-flash-killer-steals-the-show-at-mix07.html

I don’t agree with the news title or the content. Even though I like what Silverlight has to offer and it is a great product. Flash has been around for a very long time and is very mature and huge user base.

There are some things about Silverlight that simply rock but then there are plenty of drawbacks that won’t allow mainstream corporate applications to be written on Silverlight. The other day a co-worker mention that in couple of years no one will be using XHTML and everyone will switch to Silverlight. Somehow I don’t see that happening anytime soon either

Comments (5)

Community Credit

I recently found this site that promotes community participation among .NET Developers. Its pretty cool that each participant’s efforts are tracked and “stupid prizes” are awarded.

Check this out…

http://www.community-credit.com/DevCommunity.aspx

Leave a Comment