Re: Proper OOP Use
- From: "RobinS" <RobinS@xxxxxxxxxxxxxxx>
- Date: Wed, 3 Jan 2007 19:09:37 -0800
I have 3 projects in my solutions like this: one for Data Access,
one for Business Logic, and the UI.
The classes are in the BL layer. It calls the DAL and loads the
data into the class.
In this case, I would have a class for Customers, and I would
have another class called CustomerList. This would implement
BindingList(Of Customer) so I could bind it to a DataGridView
(or whatever) for display. I put all of the fields in it, and
use a method on the Customer class to populate the rows.
I use data binding to bind my classes to the fields on the
screen.
I can send you some sample code for the list stuff if you like;
I just posted it to the c# newsgroup, although the code is in VB.
Robin S.
----------------------------------
"Ivan Weiss" <ivan.weiss@xxxxxxxxxxxx> wrote in message
news:%23CxsX$3LHHA.2028@xxxxxxxxxxxxxxxxxxxxxxx
I am using VB.net and have a question on how to handle one aspect of
OOP
programming.
I have a class for Customers, Vendors, and Employees each of which
inherits a master class, Contacts
Now on my customer center screen I want to fill a list box with all of
my customers in my database on the left and on the right have their
individual account information shown when the user selects a customer.
What is the proper way to fill the database? in VB6 days I would just
directly access the database and create a list of customers and
everytime one was selected directly call their information for the
right
from the database.
With OOP should there be a class that has all of the customers in
them?
Should it be a collection? Not quite sure which direction to take
this
in...
Of course when I select a user I will fill my appropriate Customer
class
with the customer the user selected and populate the appropriate
fields
that way...
-Ivan
*** Sent via Developersdex http://www.developersdex.com ***
.
- Follow-Ups:
- Re: Proper OOP Use
- From: Ivan Weiss
- Re: Proper OOP Use
- References:
- Proper OOP Use
- From: Ivan Weiss
- Proper OOP Use
- Prev by Date: Re: How to create and reference an Arraylist at run-time
- Next by Date: Re: MainMenu in 2005?
- Previous by thread: Re: Proper OOP Use
- Next by thread: Re: Proper OOP Use
- Index(es):
Relevant Pages
|