Why rebuild the entire object from the database? Just update the part that has changed.
> > Hello, > > I have a question about designing a multi-user application with objects. > I am creating a Survey system, and I have an large object design to > represent a survey: there are over 50 types of objects chained together > in some way. For example, a Survey has Questionnaire -> Pages -> > Questions. Questions have Choices and Responses . The Survey also has > Participants who have Responses to Questions. > > In a perfect world, I would like to build a large object structure to > represent my Survey and persist it in the Application scope so that all > users modifying or taking a Survey would access the same object. A Survey > manager who adds a new Question to the Questionnaire would add a Question > object to the Survey object in the Application scope. Survey Participants > would immediately see the new Question because they are referencing the > object in the Application scope. > > I have 2 concerns about this approach: > 1) If I run into modifying any part of the Survey object, I will have to > rebuild the entire Survey object in the Application scope and each user > will be locked out of the application until the Survey object is rebuilt > properly from the database. > 2) Modifications of any part of the Survey object will have to use > exclusive locks on the entire Survey object. (This might be prohibitively > slow if there are 100's of users.) If exclusive locks are not used, if > there are 2 simultaneous calls to modify the Survey object and 1 of the > calls fails, the Survey object will be rebuilt due to the error while the > second call is in the middle of modifying the Survey object. > > Is there as standard O-O design methodology to give me some direction? > > Is it a bad idea to persist large, complex, dynamic objects in the > Application scope? > > Should I break the object structure into pieces and persist in the > Application scope the parts of the object that are less likely to break, > and build the other objects dynamically in the Session scope? > > Or, should I feel comfortable putting the whole object in the Application > scope and spend my time writing really good error-handling code to > minimize the need to rebuild the object on a failure? > > Thanks for the help! > Jon > > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' > in the message of the email. > > CFCDev is run by CFCZone (www.cfczone.org) and supported > by Mindtool, Corporation (www.mindtool.com). > > An archive of the CFCDev list is available at > www.mail-archive.com/[EMAIL PROTECTED] > ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
