N
Nemisis
Hi everyone, i have currently got a classic asp web application and am
wanting to upgrade it to asp.net 2.0, and also take advantage of OOP.
Our current application is not using OOP so you can imagine how hard it
is too upgrade.
I have read documentation all over the net, but still have some
questions (if anyone has any good documentation, i would love to read
it!!). i should warn you the questions maybe stupid/easy but i just
need to confirm that answer, so i know i am thinking along the correct
lines, or wrong lines as it may be. lol
1. My web application has many users, but not all users have the same
connection string to connect to their database. In order to keep the
each layer (data, business, presentation) separate, how could i go
about this?? I do not really want to pass the connectstring down each
layer, do i??
2. In my database, we have a company which has many contacts (one to
many relationship).
I have a Company function called GetByCompanyID, which returns a
company object
and i have a Contact function called GetByContactID, which returns a
contact object.
If i want to get all the contacts at a company, how do i go about it?
I do not want to repeat code, i gather i would create a function like
GetContactsForCompany(id), which would extract the data from the
database and fill in a business object?
Once i have done that, do the child objects go into a collection class,
or should i reference them something like Company.Contacts.Item(x)?
3. I am trying to build the data access layer myself, as i really
dont want to some software doing it for me, so i know exactly how it
works etc. Does anyone know of a really good article, that also
explains about relationships and how to extract that data correctly?
I know that some of these questions really depend, on how the system is
setup, and maybe there is no right/wrong way, but i would really
appreicate your comments.
Cheers
wanting to upgrade it to asp.net 2.0, and also take advantage of OOP.
Our current application is not using OOP so you can imagine how hard it
is too upgrade.
I have read documentation all over the net, but still have some
questions (if anyone has any good documentation, i would love to read
it!!). i should warn you the questions maybe stupid/easy but i just
need to confirm that answer, so i know i am thinking along the correct
lines, or wrong lines as it may be. lol
1. My web application has many users, but not all users have the same
connection string to connect to their database. In order to keep the
each layer (data, business, presentation) separate, how could i go
about this?? I do not really want to pass the connectstring down each
layer, do i??
2. In my database, we have a company which has many contacts (one to
many relationship).
I have a Company function called GetByCompanyID, which returns a
company object
and i have a Contact function called GetByContactID, which returns a
contact object.
If i want to get all the contacts at a company, how do i go about it?
I do not want to repeat code, i gather i would create a function like
GetContactsForCompany(id), which would extract the data from the
database and fill in a business object?
Once i have done that, do the child objects go into a collection class,
or should i reference them something like Company.Contacts.Item(x)?
3. I am trying to build the data access layer myself, as i really
dont want to some software doing it for me, so i know exactly how it
works etc. Does anyone know of a really good article, that also
explains about relationships and how to extract that data correctly?
I know that some of these questions really depend, on how the system is
setup, and maybe there is no right/wrong way, but i would really
appreicate your comments.
Cheers