N
news.microsoft.com
I'm trying to develop a ASP.NET app with OO + 3-tier design, here is a
scenario:
if there is a People class which is defined as below,
class People
{
string ID;
string FirstName;
string LastName;
string Address;
string Tel;
}
Then there are 2 webform page, one will display only ID,FirstName and
LastName properties of
the People object but another one will display all the properties.
Q1: both the two webform pages can use same People object or I should create
and declare two
classes as below for each webform page? which one is better on maintenance
and performance?
class BasePeople
{
string ID;
string FirstName;
string LastName;
}
class People: BasePeople
{
string Address;
string Tel;
}
Q2: The Data layer should read all the columns from db and the Biz Logic
layer selects required fields to
fill in the People object?
or the data layer only fetches required columns from db in the beginning?
Thanks in advance.
scenario:
if there is a People class which is defined as below,
class People
{
string ID;
string FirstName;
string LastName;
string Address;
string Tel;
}
Then there are 2 webform page, one will display only ID,FirstName and
LastName properties of
the People object but another one will display all the properties.
Q1: both the two webform pages can use same People object or I should create
and declare two
classes as below for each webform page? which one is better on maintenance
and performance?
class BasePeople
{
string ID;
string FirstName;
string LastName;
}
class People: BasePeople
{
string Address;
string Tel;
}
Q2: The Data layer should read all the columns from db and the Biz Logic
layer selects required fields to
fill in the People object?
or the data layer only fetches required columns from db in the beginning?
Thanks in advance.