A
Andrea Williams
I need to expose the properties of an User Object to all other classes, but
hide the operations (functions) from all but the Business layer of my app?
The goal is to load up this USER object and pass it from app Layer to bus
layer to Data layer and then back once data has been handled. All requests
to the data layer from the business layer, so that it can validate the data
before Insertion, update, etc.
I've read up on Interfaces... I've tested an implementation turning my User
object into an Interface instead of a class, which is what is was before.
Now I can populate the User Interface with the various properties that a
user needs (FirstName LastName, etc.). This seems to work for me to pass it
between the layers. However, since I'm learning this stuff on my own and
have a classic ASP background, I'm unsure if this is the right approach.
I have also heard of people populating arrays or collections and sending it
from class to class as in the ASP Time Tracker code. They create a
collection class to hold the variable from the form and to pass it to the
data layer. I've seen people create a class just to hold the properties of
the object and that class is used on all three layers. With so many
different ways to accomplish the same thing, which would be considered a
"best practice" and would be better for performance?? Are there any articles
that talk about the best ways to pass data from your form through the layers
and back again?
I'm not at the point where I can test for performance right now, so can
anyone more knowledgeable than me tell me which implementation would be
faster at runtime. A pros and cons list of the different options would be
great!
Thanks in advance,
Andrea
hide the operations (functions) from all but the Business layer of my app?
The goal is to load up this USER object and pass it from app Layer to bus
layer to Data layer and then back once data has been handled. All requests
to the data layer from the business layer, so that it can validate the data
before Insertion, update, etc.
I've read up on Interfaces... I've tested an implementation turning my User
object into an Interface instead of a class, which is what is was before.
Now I can populate the User Interface with the various properties that a
user needs (FirstName LastName, etc.). This seems to work for me to pass it
between the layers. However, since I'm learning this stuff on my own and
have a classic ASP background, I'm unsure if this is the right approach.
I have also heard of people populating arrays or collections and sending it
from class to class as in the ASP Time Tracker code. They create a
collection class to hold the variable from the form and to pass it to the
data layer. I've seen people create a class just to hold the properties of
the object and that class is used on all three layers. With so many
different ways to accomplish the same thing, which would be considered a
"best practice" and would be better for performance?? Are there any articles
that talk about the best ways to pass data from your form through the layers
and back again?
I'm not at the point where I can test for performance right now, so can
anyone more knowledgeable than me tell me which implementation would be
faster at runtime. A pros and cons list of the different options would be
great!
Thanks in advance,
Andrea