David Buhler
Member since Dec 11, 2008
- Profile: /members/328-david-buhler.htm
- URL: http://davidbuhler.com
- Comments: 45
Recent Blog Comments By David Buhler
-
Use A Return Statement When Invoking Callbacks, Especially In A Guard Statement
Posted on Feb 1, 2012 at 12:56 PM
Actually, I messed up: true === true ? successHandler() : failHandler());... read more »
-
Use A Return Statement When Invoking Callbacks, Especially In A Guard Statement
Posted on Feb 1, 2012 at 11:38 AM
Technically, the ternary operator suggests there are only two possible conditions. You define a predicate, the consequent, and the ONLY alternative. If there were more than one alternative, you would wish to use a switch-case or if-else. Your approach could become unwieldy if new logic was introduce... read more »
-
Use A Return Statement When Invoking Callbacks, Especially In A Guard Statement
Posted on Feb 1, 2012 at 11:21 AM
var successHandler = function(){ document.write( "Success!" ); }; // ------ Define a fail handler. var failHandler = function(){ document.write( "Fail" ); }; // ------ Now, let's create a mock function that makes use of the success and fail callback handlers.*/ var doSo... read more »
-
Use A Return Statement When Invoking Callbacks, Especially In A Guard Statement
Posted on Feb 1, 2012 at 11:11 AM
This could be simpler and easier to read using a Ternary operation.... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Oct 10, 2009 at 11:42 AM
John, Can you show how your ORM Object properties reference the preInsert() and preUpdate() methods? This is a problem I was thinking about this morning, without a solution, so your post couldn't have come at a better time. Best, David... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 30, 2009 at 2:49 AM
@Justice, I'm looking at the Stub Generator from Adobe, and in their Beta stub generator, the 'event' parameter it generates (specific to my project) is type-casted to an "Event" (schedules, owner, ID, etc). Then, Adobe's stub generator is calling EntitySave(event) for both Update and Create Opera... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 30, 2009 at 12:46 AM
You can omit all of the setters and just save a strongly typed Entity, too. So in my case, I'm just updating two properties on the server, and the client-side is updating the other 100 updated properties. I pass in the object already modified from the client, and all I write in CF for a Create or U... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 29, 2009 at 12:56 PM
@Hatem, Looking at the current project I am rebuilding in CF9, the knowledge portion of the equation, with regard to 'writing better code', is the improvement in the use of abstract classes for security, and the addition of more strongly typed objects. The use of Hibernate ORM in CF9 has allowed m... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 26, 2009 at 2:42 PM
@Justice, I'll do it. I need a couple of days to finish cleaning up the login script, and it would eat up most of Ben's database volume if I posted the related methods (and their SQL), but if I post the old Login versus the new Login with the ORM script, the differences should be apparent. I'd fe... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 26, 2009 at 12:14 PM
@Justice, It is magical. I "finished" rebuilding my user login last night using Hibernate, and to make a single Hibernate request to retrieve all of the same information that once took 1000+ lines of functions and SQL absolutely astounded me. It's a scary time to be a DBA.... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 26, 2009 at 10:36 AM
Got it: http://bit.ly/wRB2D... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 26, 2009 at 9:45 AM
@Ben,@ Justice In Hibernate, if I run a query to retrieve a specific User() object using ORMExecuteQuery(), I successfully get back all of the object properties. I want to return the entire object to my client (Flex). Some of those properties, like the "uPassword", I want to eliminate from the re... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 25, 2009 at 11:32 AM
@ Justice, What does someone typically use the Hibernate events for?... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 25, 2009 at 11:29 AM
For the record: "ColdFusion will automatically save any changes made to a persisted object at the end of the request regardless of whether you call EntitySave or not. You can override this behaviour by adding this line to Application.cfc this.ormsettings.flushatrequestend = false;" Then, you hav... read more »
-
Learning ColdFusion 9: Understand ORM Events (Thanks John Whish!)
Posted on Aug 25, 2009 at 9:54 AM
Can preUpdate be called with an abort/return to prevent the ORM from updating? For example, a user is trying to update a record he does not own, so I want to bail out of the update. What's the best way to handle this?... read more »
-
Learning ColdFusion 9: Trying To Understand ORM Event Handling
Posted on Aug 24, 2009 at 3:43 PM
@ Ben, I had the same problem. This information helped me to resolve things: http://bit.ly/14ejFr... read more »
-
Learning ColdFusion 9: From SQL To ORM - A Conceptual Shift In Relationships
Posted on Aug 3, 2009 at 6:12 PM
You also benefit from the database agnostic capabilities of an ORM.... read more »
-
Learning ColdFusion 9: From SQL To ORM - A Conceptual Shift In Relationships
Posted on Aug 3, 2009 at 1:11 PM
With Hibernate and CF9, is there a way to specify the database indexes that you want created if you elect to have Hibernate create the entities?... read more »
-
Learning ColdFusion 9: When Does An ORM-Enabled Object Get Persisted
Posted on Jul 31, 2009 at 11:55 PM
This would make for a nice demo at the next NYCFUG.... read more »
-
Learning ColdFusion 9: IsNull() And Working With NULL Values
Posted on Jul 19, 2009 at 2:55 PM
@Justice. Noted and appreciated.... read more »