> 1. One of the things I'd like to do is populate a user's session > with a user object that persists. Now my concern here is that this > object is being created for each authenticated user. I'm assuming that > all methods effectively get copied ot every user as well (again I'm > assuming). This sounds expensive. If I get to 200, 300, etc. > concurrentlogged-in users, is this an inefficient way to do things?
Although there could be 200 instances (object) of a CFC (class), there would only be one definition of a particular method, and thus only one instantiation of that method, IIRC. > > 2. Another sort of related quesiton is the idea of an object having > other objects (i.e. composition). Here's my concern here. Let's > say I've > got a user object that has one to many bookmarks associated with > it. If > a user has say 15 bookmarks, this also seems inefficient. Hal Helms > explained composition nicely with a simple Person-Address composition > relationship (i.e. a person has an address). This makes sense and > isn'tworrisome b/c it is more or less a one-to-one relationship > (or close to > it). But if an object is composed of potentially many objects - is > thisstill the best way to go? The alternative obviously is to just > pull back > the bookmarks as part & parcel of the person object's get method and > just make it a native property of person (structure/query/whatever). Well, according to the Gang of Four, you should favor composition over inheritance, as well as make classes responsible for themselves. So, your present approach sounds good from a design point of view. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4