Brian Kotek wrote:
>I use it quite a bit, and have modified it a bit for my own needs,
>such as adding an updateBean() method, option to call super() in
>init() and updateBean() if the bean has a superclass, and lock bean
>setters if the bean will be persisted in session/application scope.
>Peter did a great job with it and it is fairly easy even for a
>Javascript dunce like myself to tweak it as necessary. Thanks Peter!
>
>Brian
>
>
Thanks Brian. I've been thinking of things for an updated version - let
me know what you think of any of these. Although my beans rarely extend
another object, I like the idea of being able to call the super.init()
option.
You mentioned an updateBean() method. I can only can only assume that
you mean a method to send in an argument collection to update a bean
(such as multi-step forms) and run only the setters for the arguments
that have a corresponding variables in the bean? I've been doing a lot
of mult-step forms lately.
I've also been thinking of adding some sort of boilerplate validation
outline instead of an empty validate() method. I use a custom error
handling systemt that I've thought about releasing. In most of my
beans, you pass in an ErrorHandler object reference to set errors in.
Ironically, it's similar to a component found in MG - however, I wrote
it a month or so before I saw MG. You can then pass the ErrorHandler to
my custom ErrorMessage object that reads the error codes set in the
ErrorHandler to human readable messages (set via an XML file).
For example (a snip):
<cfargument name="eH" required="true" type="errorHandler" />
<cfscript>
// applicants_per_hire
if (NOT len(getApplicants_per_hire())) {
arguments.eH.setError("applicants_per_hire",
"bizTools.costPerHireBean.applicants_per_hire.null");
} // END IF
If the applicants_per_hire is "", then it sets an error for that field
(this option allows you to set multiple errors per field and group the
output) and the error code of
bizTools.costPerHireBean.applicants_per_hire.null (which always follows
object group, object name, field name and then error). The error code
corresponds to an entry in my XML file. This system allows me to use a
standard error code (which is still pretty readable to a developer
instead of error 19 or 789 etc), but customize the output for the
customer easily. Some of the apps I work on are schedule to be
co-branded to other companies - customized error messages was high on
the list.
As a recap:
- option that allows you to call the super.init()
- option to generate a boilerplate validation skeleton
- option for a updateBean() or setStepInstance() for updating the bean
with an argument collection
I don't know what version you modified - but rooibos generator (2.0)
version has an entirely new JS code base for easier editing (broke up
the huge bean creation method into sections...like createGettersSetters,
createInit, etc and call those from a main createBean method(). I
haven't released the zip for it yet, but I'm planning on it soon -
including the much nicer looking UI then the Mach-II Beaner.
Best,
.Peter
P.s. I'm totally zonked today - so I hope this email makes sense ;-)
--
Peter J. Farrell :: Maestro Publishing
blog :: http://blog.maestropublishing.com
email :: [EMAIL PROTECTED]
________________________________
R O O I B O S G E N E R A T O R...
Create boilerplate beans and transfer objects for ColdFusion!
Rooibos is free to use at: http://rooibos.maestropublishing.com/
________________________________
Member of Team Mach-II - The next rev is coming...
----------------------------------------------------------
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).
CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]