Seth, my experience on this list shows there to be very little difference between how most people here define a bean and LTO with the exception that the LTO stores its variables in the public "this" scope and the bean stores it in the private "variables" scope.
however, some people have defined beans to be a bit heavier in that they also encapsulate the validation logic for it's properties whereas a LTO doesn't provide anything but a structured method of passing those properties around. This is actually been an oft discussed topic on this list and the answers that have come up have caused quite a bit of confusion at times between the differences between the two object types. Some people here create validation objects that they pass the bean into along with a "logging" object that tracks the error messages created during validation and in that case the bean is just a LTO with getters/setters. Others include the validation logic in the bean. I prefer to have the validation logic for the bean's data in the bean. Bill On 11/15/05, Seth Johnson (KW) <[EMAIL PROTECTED]> wrote: > I'm currently preparing to create my first substantial OO/CFC based > application, so you guys will probably be seeing a lot of questions from > me in the near future :) > > I was reading the list archives looking for form validation practices, > and I found this thread > (http://www.mail-archive.com/[email protected]/msg09518.html). In the > thread a number of people mention "beans", and that they often allow any > string value to be used in the bean's mutator methods, but they > reference a validator method before doing anything with the bean. > > What exactly is a "bean" in regards to CFCs? My (very limited) > understanding of JavaBeans is that they are simple classes that conform > to special naming conventions, and these conventions make it possible to > plug those beans into editors that know how to reference the beans. > > So in "CFC land" is a bean just a simple object with getter/setter > methods, but no business logic? If this is true, how are they different > from lightweight transfer objects? In what situations do you use beans, > and when do you use heavyweight objects? > > Thanks in advance, > Seth > > > ---------------------------------------------------------- > 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] > > > -- [EMAIL PROTECTED] http://blog.rawlinson.us If you want Gmail - just ask. ---------------------------------------------------------- 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]
