Re: Objects Everywhere!
> 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
RE: Objects Everywhere!
I think the idea you are referring to is a container class, which is an object which contains 1 or more of the same object. -Original Message- From: Rich Z [mailto:[EMAIL PROTECTED] Sent: Saturday, August 09, 2003 8:46 PM To: CF-Talk Subject: RE: Objects Everywhere! Umm, not sure really. Lemme throw out an extreme example. Let's say a "user" (to further the illustration below) has 230 "bookmarks." Let's also assume that there are all sorts of properties associated with a bookmark (e.g. description, date added, title, url, etc.) but all I need to display are the url's on the user page. It just seems that to use a getter for each of the 230 bookmarks for 1 or 2 fields is overkill. An alternative I suppose is to just have a person.bookmarks property that carries an array (or query) with the information that is populated from the bookmark object? I guess all I'm asking is - as far as OO approaches is concerned - how should one handle a scenario where an object's composition includes many instances of the same object? Thanks for the response on the first. My 200 users are looking MEASLY. Heheh. -Rich -Original Message- From: Sean A Corfield [mailto:[EMAIL PROTECTED] Sent: Saturday, August 09, 2003 7:06 PM To: CF-Talk Subject: Re: Objects Everywhere! On Saturday, Aug 9, 2003, at 15:33 US/Pacific, Rich Z wrote: > 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. concurrent > logged-in users, is this an inefficient way to do things? macromedia.com uses session scope instances of CFCs and supports 15,000-20,000 concurrent sessions during peak traffic - I wouldn't worry about a few hundred users! > 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. Why do you think it's inefficient? Sean A Corfield -- http://www.corfield.org/blog/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| 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
Re: Objects Everywhere!
On Saturday, Aug 9, 2003, at 17:45 US/Pacific, Rich Z wrote: > Umm, not sure really. Lemme throw out an extreme example. Let's say a > "user" (to further the illustration below) has 230 "bookmarks." Let's > also assume that there are all sorts of properties associated with a > bookmark (e.g. description, date added, title, url, etc.) but all I > need > to display are the url's on the user page. It just seems that to use a > getter for each of the 230 bookmarks for 1 or 2 fields is overkill. Right, so the issue here is all about which 'objects' in your model are really important objects that actually have behaviors and which are just data. While a bookmark object may be very reasonable if you are focusing on the bookmarks themselves, that implementation may be overkill if you're really focused on the user. > An alternative I suppose is to just have a person.bookmarks property > that carries an array (or query) with the information that is populated > from the bookmark object? Yes, or have a bookmarks object that holds all the bookmarks in some internal format (such as a query, for example) with some methods to make it easier to retrieve data from that internal format. Again, it's the decision about whether an individual bookmark is important enough to model on its own or whether you really just want to model the collection of bookmarks. > I guess all I'm asking is - as far as OO approaches is concerned - how > should one handle a scenario where an object's composition includes > many > instances of the same object? There's no hard and fast rule. If the collection itself is important, model that as an object. If the contents of the collection are the most important part, an array of objects is reasonable. Sean A Corfield -- http://www.corfield.org/blog/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| 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 Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Objects Everywhere!
Umm, not sure really. Lemme throw out an extreme example. Let's say a "user" (to further the illustration below) has 230 "bookmarks." Let's also assume that there are all sorts of properties associated with a bookmark (e.g. description, date added, title, url, etc.) but all I need to display are the url's on the user page. It just seems that to use a getter for each of the 230 bookmarks for 1 or 2 fields is overkill. An alternative I suppose is to just have a person.bookmarks property that carries an array (or query) with the information that is populated from the bookmark object? I guess all I'm asking is - as far as OO approaches is concerned - how should one handle a scenario where an object's composition includes many instances of the same object? Thanks for the response on the first. My 200 users are looking MEASLY. Heheh. -Rich -Original Message- From: Sean A Corfield [mailto:[EMAIL PROTECTED] Sent: Saturday, August 09, 2003 7:06 PM To: CF-Talk Subject: Re: Objects Everywhere! On Saturday, Aug 9, 2003, at 15:33 US/Pacific, Rich Z wrote: > 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. concurrent > logged-in users, is this an inefficient way to do things? macromedia.com uses session scope instances of CFCs and supports 15,000-20,000 concurrent sessions during peak traffic - I wouldn't worry about a few hundred users! > 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. Why do you think it's inefficient? Sean A Corfield -- http://www.corfield.org/blog/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| 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 Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Objects Everywhere!
On Saturday, Aug 9, 2003, at 15:33 US/Pacific, Rich Z wrote: > 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. concurrent > logged-in users, is this an inefficient way to do things? macromedia.com uses session scope instances of CFCs and supports 15,000-20,000 concurrent sessions during peak traffic - I wouldn't worry about a few hundred users! > 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. Why do you think it's inefficient? Sean A Corfield -- http://www.corfield.org/blog/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| 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 Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Objects Everywhere!
Thanks for the insights. Very helpful. -Rich -Original Message- From: Sean A Corfield [mailto:[EMAIL PROTECTED] Sent: Saturday, August 09, 2003 11:09 PM To: CF-Talk Subject: Re: Objects Everywhere! On Saturday, Aug 9, 2003, at 17:45 US/Pacific, Rich Z wrote: > Umm, not sure really. Lemme throw out an extreme example. Let's say a > "user" (to further the illustration below) has 230 "bookmarks." Let's > also assume that there are all sorts of properties associated with a > bookmark (e.g. description, date added, title, url, etc.) but all I > need > to display are the url's on the user page. It just seems that to use a > getter for each of the 230 bookmarks for 1 or 2 fields is overkill. Right, so the issue here is all about which 'objects' in your model are really important objects that actually have behaviors and which are just data. While a bookmark object may be very reasonable if you are focusing on the bookmarks themselves, that implementation may be overkill if you're really focused on the user. > An alternative I suppose is to just have a person.bookmarks property > that carries an array (or query) with the information that is populated > from the bookmark object? Yes, or have a bookmarks object that holds all the bookmarks in some internal format (such as a query, for example) with some methods to make it easier to retrieve data from that internal format. Again, it's the decision about whether an individual bookmark is important enough to model on its own or whether you really just want to model the collection of bookmarks. > I guess all I'm asking is - as far as OO approaches is concerned - how > should one handle a scenario where an object's composition includes > many > instances of the same object? There's no hard and fast rule. If the collection itself is important, model that as an object. If the contents of the collection are the most important part, an array of objects is reasonable. Sean A Corfield -- http://www.corfield.org/blog/ "If you're not annoying somebody, you're not really alive." -- Margaret Atwood ~| 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 Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4