Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / July 2007

Tip: Looking for answers? Try searching our database.

Application Design Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
dfa_geko - 24 Apr 2007 05:06 GMT
Hi Everyone,

This is just a simple application design question. I was just wondering how  
different people would approach this problem.

Suppose you had to design a form where you edit a record and in the form
there is a list box. You can select multiple items in the list box that are
tied to that record. (Say for example, suppose you have a record that's a
car. You can select multiple options related to the car. power locks, power
windows, automatic transmission, etc) It would be a 1 - n relationship.

In the database, you have a master record in table A. (The car) And
multiple records in another table B with a foreign key relationship. (The
options on the car)

When a user submits the form. (Or clicks a button, whatever you wish) How
would you attack this problem? Delete all the records in table B and insert
the new records. Or would you compare the values of the list box and table
B and update accordingly?

Which is the better design approach?

Thanks!

dfa_geko
David McCallum - 24 Apr 2007 05:45 GMT
> Hi Everyone,
>
[quoted text clipped - 25 lines]
>
> dfa_geko

We have a similar model, what we do is maintain a toBeAdded and a
toBeDeleted list. When the model is sent to the server we just iterate
through these lists.

David McCallum
RobinS - 24 Apr 2007 06:59 GMT
I would delete the ones there, then add the new ones. Doing a match/merge
to figure out what changed, etc., isn't worth the effort unless you're
doing your own audit trailing.

Robin S.
------------------------
> Hi Everyone,
>
[quoted text clipped - 26 lines]
>
> dfa_geko
Alan T - 11 Jul 2007 01:28 GMT
Yes, I would also do the delete the old ones and then add the new ones.

> I would delete the ones there, then add the new ones. Doing a match/merge
> to figure out what changed, etc., isn't worth the effort unless you're
[quoted text clipped - 32 lines]
> >
> > dfa_geko

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.