473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 18 '05 #1
1 848
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 18 '05 #2

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

Similar topics

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. ...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.