Hi all,
I've trying to figure out a good stategy for dealing with denormalized tables (or badly designed data stored in general). How would the following scenario usually be handled using CSLA?
Say you have a customer table that looks something like this:
CustomerID, ....., BillingName, BillingAddress, BillingZipCode,...., ShippingName, ShippingAddress, ShippingZipcode,..., CraditCardName1, CreditCardNo1, CreditCardName2, CreditCardNo2, etc...
Get my point?
Ofcourse I don't want my Customer BO to follow this design. If I design my Customer BO such that I have a main Customer object and BillingContact, ShippingContact child objects as well as a list of CreditCardOnFile (or whatever) objects can I still perform CRUD operations using a single SQL statement (e.i 1 for inserts 1 for updates, etc...)
Would it be as simple as not implementing DataPortal methods on the childe objects and doing everything on the parent BO?
In the current project I'm working on dealing with a horrible data model will be my gratest challenge .
You can normalize the data in the dataportal_fetch method and de-normalize
it back in dataportal_update. You can populate data in the list of
addresses or list of credit cards using single row in the datareader.
Sergey Barskiy
Senior Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: dctc42
[mailto:cslanet@lhotka.net]
Sent: Friday, April 11, 2008 7:12 PM
To: Sergey Barskiy
Subject: [CSLA .NET] CSLA BOs and denormalized data store
Hi all,
I've trying to figure out a good stategy for dealing with denormalized
tables (or badly designed data stored in general). How would the following
scenario usually be handled using CSLA?
Say you have a customer table that looks something like this:
CustomerID, ....., BillingName, BillingAddress, BillingZipCode,....,
ShippingName, ShippingAddress, ShippingZipcode,..., CraditCardName1, CreditCardNo1,
CreditCardName2, CreditCardNo2, etc...
Get my point?
Ofcourse I don't want my Customer BO to follow this design. If I design my
Customer BO such that I have a main Customer object and BillingContact,
ShippingContact child objects as well as a list of CreditCardOnFile (or
whatever) objects can I still perform CRUD operations using a single SQL
statement (e.i 1 for inserts 1 for updates, etc...)
Would it be as simple as not implementing DataPortal methods on the childe
objects and doing everything on the parent BO?
In the current project I'm working on dealing with a horrible data
model will be my gratest challenge .
Copyright (c) Marimer LLC