Re: OO development question...
- From: Spam Catcher <spamhoneypot@xxxxxxxxxx>
- Date: Thu, 13 Dec 2007 20:53:06 GMT
"Brad Pears" <bradp@xxxxxxxxxxxxxxxxxxxxx> wrote in
news:OYT4V4ZPIHA.1756@xxxxxxxxxxxxxxxxxxxx:
I am unsure how I should develop the business classes, whether I
should have just one business class which includes collection
properties to house the two 1-M relationships or whether I should
create three business classes (one for each table) with the high level
class containing one collection property for it's 1-M relationship
with the 2nd class and in the second class, also include a collection
property to house the 1-M relationship it is in with the 3rd class...
You should have 3 classes, for each 1->M relationship, use a collection
to house the objects.
i.e,
Parent
Property Child as List(of Child)
Child
Property GrandChild as List(of GrandChild)
GrandChild
just a bunch of properties
your parent object - you may even want to inherit from a base object so
that you can put in generic helper functions (i.e. Save to Database,
Delete, etc.)
You should also take a look at LLBLGen Pro and Typed Datasets - LLBLGen
Pro is a OR Mapper which does this sort of mapping for you. Typed
Dataset is a VS.NET feature which does something similar but is MUCH
more primative ;-)
--
spamhoneypot@xxxxxxxxxx (Do not e-mail)
.
- Follow-Ups:
- Re: OO development question...
- From: Brad Pears
- Re: OO development question...
- References:
- OO development question...
- From: Brad Pears
- OO development question...
- Prev by Date: Reading WndProc Messages
- Next by Date: Re: Reading WndProc Messages
- Previous by thread: OO development question...
- Next by thread: Re: OO development question...
- Index(es):