I am refactoring an old procedural loan origination application system and am going through the process of UML design, and mapping out the relationships of all of my objects. I am still somewhat new to OOP, but I have built several small OO projects now and feel pretty comfortable with OO concepts such as composition vs. inheritance, and have built several small OO apps.  I have yet to build a really robust fully OO system.  I am running into a stumbling block in my train of thought in a couple of areas and wanted to get some opinions.

Consider the following relationship.... 

A Company has Users (there are multiple companies)

Users (could) have Loan Applications

Loan Applications (could) have a plethora of their own properties of simple values and objects

I am considering building an application-scoped array of Company objects, each with a property of Users which is a structure of all users tied to that particular company, where each item (instance of a User object) would have its own properties/methods unique to that user.  I have tested that in a small scale (adding/removing users) and it seems to behave like I would expect, so that part makes sense to me so far, but if you see any big things I am missing there don't hold back.

Now, my immediate concern is as follows:   In listening to the Helms An Peters "Objects for maintainable code", I noted that Hal makes the comment along the lines that if we had perfect systems that could hold the objects forever, we really wouldn't need databases to persist the objects.  If I understand that correctly, he is suggesting that all objects are loaded up when the application starts and the only database interaction is when persisting them.  Am I understanding this properly?  My gut feel (which is only slightly more than occasionally right) is that it seems unreasonable from a memory standpoint to hold every user in every companies'  Users property(ies), and the properties/methods of each user within that, and the properties/methods within those, and so on to the end of the relationship tree.   What is the best approach here, keeping in mind that I want to limit the database interaction as much as I can. 


I really hate airing my ignorance publicly, but I appreciate any input on this scenario. :)

--
~Dave Shuck
[EMAIL PROTECTED]
www.daveshuck.com ----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to [email protected] with the words 'unsubscribe cfcdev' as the subject of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting (www.cfxhosting.com).

An archive of the CFCDev list is available at www.mail-archive.com/[email protected]

Reply via email to