Chris Ongsuco's Weblog
Information Technology, business, life, food...

June 2005 Entries

Sign of a bad architecture

Imagine your business entities would be something like this: public string Firstname { get { LoadInfo(); return _firstname; } set { LoadInfo (); if (_firstname != value) { _firstname = value; ExecuteQuery("UPDATE Table SET Firstname = '" + _firstname + "' WHERE ID = " + _id.ToString()); } } } public string Lastname { get { LoadInfo(); return _lastname; } set { LoadInfo (); if (_lastname != value) { _lastname = value; ExecuteQuery("UPDATE Table SET Lastname = '" + _lastname + "' WHERE ID = " + _id.ToString());...

C# 2.0 static classes

After playing with C# 2.0 I noticed something funny about static classes. According to the updated C# 2.0 specification (March 2005), static classes are classes that are not intended to be instantiated and which contain only static blah…blah…blah. If so then suppose to be if I make my class as static then automatically all its methods and properties will also be static BUT that's not the case here. Making a class static will look something like this: using System; namespace DotNet { public static...