I avoid using beans for list pages... I've seen people do it, but it's
not very efficient... granted, I don't like beans in the traditional
sense, but I do use objects (I call them DAO's) which in my
applications function similarly to the way people use beans. But I
don't use those in list pages either. If you've got a big long hairy
list of users and you only need their email address in that list, then
using beans or daos, etc. isn't imo an appropriate use of those types
of objects. The beans or dao objects really are helpful mostly for
things like forms or "profile/detail" pages... With users in
particular in my Members onTap plugin I also have a memberFactory
object which is stored in persistent (application) memory and then
internally stores all the member (user for you) objects so that when
you request a member from the factory it's frequently coming from
resident memory rather than going to the database, which makes it more
efficient than creating the object each time, and often more efficient
than running an ad-hoc query any time you need that data. I do this
with members in particular because I know that my applications are
likely to be liberally hosed down with member information. :) Like the
names of members who've authored or edited particular bits of content.
I also store NameFormat objects in the MemberFactory which provides a
reasonably simple and consistent method of producing internationalized
names for members since the rules for displaying names can vary rather
dramatically between regions.

> Mike, your descriptions are helpful.  I do have one
> question though:  do you
> always instantiate the user bean with *all* the columns in
> the user table?
> Sometimes I might want to only access the user's email
> address for example.
> In one application I have about 25 columns in the user
> table, much more than
> the usual name/address/email/phone etc.  So, there would
> be a performance
> hit in carrying all the columns when maybe I only need the
> email address for
> certain things.  Apply this to a whole recordset with 1000
> rows for example,
> rather than a bean, and the performance hit is multiplied.
> Do you handle
> this with a conditional in the CFC, or do you just get all
> the columns no
> matter how the user bean is being used?

> -- Josh





> ----- Original Message -----
> From: "Mike Kear" <[EMAIL PROTECTED]>
> To: "CF-Talk" <[email protected]>
> Sent: Monday, March 06, 2006 3:51 PM
> Subject: Re: OOP, why me?


>> That seems fair enough, Rick.  That was what was really
>> missing when I
>> tried
>> to dig into this OOP world.   Part of the difficulty is
>> that if you make
>> it
>> dead simple so mugs like me can understand it, you end up
>> making it so
>> simple it doesnt work.
>>
>> I'm up to my armpits in work (as in people are paying
>> me!!) right now, but
>> I'll tell you what i'll do - i'm about to deploy my new
>> AFPWEBWORKS.COM
>> site
>> in a couple of weeks, built on the new CMS.    I'll put
>> an example and
>> descriptive text on there but it wont be for a few weeks.
>> In the mean
>> time
>> if you want to see an example and work through it
>> yourself, I can send you
>> one off line, but it wont have any notes with it. I just
>> dont have all the
>> time to write them right now.
>>
>> Is what I'm saying in this thread making sense for you?
>> I'm trying to
>> explain without using the jargon (even though you really
>> should get to
>> learning it) but there's a big risk of getting it all
>> wrong by doing so.
>>
>>
>> Cheers
>> Mike Kear
>> Windsor, NSW, Australia
>> Certified Advanced ColdFusion Developer
>> AFP Webworks
>> http://afpwebworks.com
>> ColdFusion, PHP, ASP, ASP.NET hosting from AUD$15/month
>>
>>
>> On 3/7/06, Rick Faircloth <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> How about a sample (and simple) app that shows
>>> the OOP method at work...(as simple as possible
>>> to demonstrate the concept) wihtout any jargon
>>> in the explanation...
>>>
>>> Or perhaps there is one already that you can reference?
>>>
>>> Rick
>>>
>>>
>>
>>
>>

> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:234353
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to