Help with Use Case approach

Help with Use Case approach

Old forum URL: forums.lhotka.net/forums/t/8118.aspx


white911 posted on Wednesday, December 09, 2009

My question today is as follows:

I need to track appointments. Each appointment has 2 people involved, who both need the general person details as name, address, city, state, zip, phone, fax, email etc. It's usually not repeatable, so I really don't need the people in a separate table to reuse in another appointment. However, my question is, for normalizing the database, I can create a people table, and the main appointment table would have 2 FK id fields linking to the people table, and it's always going to be a 1 to 1, since I will never reuse the same person. By doing it this way, I have normalized the database, since I did not repeat general fields, however, the CSLA object to handle it, I have 2 ways

1)  To have 1 class 'Appointment' and I will repeat all fields twice for each person, and pass in all fields to a stored procedure which will save the data into the correct tables and return the new PK id's for each table/record.

2) Have a class for person and include it twice into the appointment class as a single child class, once for each person, and then call it's own save before saving the appointment. The problem is that I would need a reference in the main table to all fields in the children person tables in order to do form binding ???

Another approach to the whole idea is to include all fields into the appointment table and repeat the fields again for each person needed (we may need a third one too). The database would not be normalized, however, the CSLA class would be like any regular class since it only deals with one table.

Think it over, and let me hear your suggestions. You may have a different and better approach. I may not be clear with my question, so please ask me.

Thanks

Copyright (c) Marimer LLC