473,472 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Interface, class or collection Question

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
Nov 15 '05 #1
2 1466
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Andrea Williams" <an*******@hotmail.IHATESpam.com> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
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

Nov 15 '05 #2
No. I've read up some more on interfaces, but it seems that they are mostly
used to execute a function that does something. Only in the MSDN Library
have I seen sample code that exposes properties instead of exposing
functions. I'm still a bit lost on the common implementation. And since my
properties should not be shared, I'm thinking that a Table object would work
better to hold the property values and pass them back and forth between the
layers.

Any advice would be helpful...

Thanks,
Andrea
"Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Your post went unanswered. Have you resolved this issue?

--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
"Andrea Williams" <an*******@hotmail.IHATESpam.com> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
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


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Anon Email | last post by:
Hi people, I'm learning about header files in C++. The following is code from Bartosz Milewski: // Code const int maxStack = 16; class IStack
3
by: Sai Kit Tong | last post by:
I posted for help on legacy code interface 2 days ago. Probably I didn't make it clear in my original mail. I got a couple of answers but none of them address my issues directly (See attached...
3
by: Guthrie Phalanx | last post by:
HI all Bit of a newbie on interfaces, I hope this is not a silly question. I am stuck on a problem where I want to create a custom collection of objects, all of whom implement the same...
21
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered...
9
by: Chris Dunaway | last post by:
I have created an Interface called IClientModule in a class libarary and have compiled the library to a .dll. In my main app, I scan a folder for .dll's and load each one that implements the...
15
by: mr.peteryu | last post by:
Hi, Can someone explain the idea behind casting to an interface? For example: -> I have an IInterface that contains a Read() method. -> I have an object "obj" that implements IInterface. ...
8
by: khalprin | last post by:
Hello, I'm trying to create a component that will be used from .net clients and COM clients. I've got an object model that looks something like this: ISystem IRuntime IConfiguration...
15
by: Gustaf | last post by:
Using VS 2005. I got an 'IpForm' class and an 'IpFormCollection' class, containing IpForm objects. To iterate through IpFrom objects with foreach, the class is implemented as such: public class...
15
by: Xah Lee | last post by:
On Java's Interface Xah Lee, 20050223 In Java the language, there's this a keyword “interface”. In a functional language, a function can be specified by its name and parameter specs....
13
by: =?Utf-8?B?RGF2ZSBXZWVkZW4=?= | last post by:
Hi all, I'm having trouble with a project that I've distilled down to the following code. Unfortunately it won't compile and gives the following error (caused by the call to GetHorses() in...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.