Dominic
Member since Jan 6, 2010
- Profile: /members/5111-dominic.htm
- URL: https://domwatson.codes
- Comments: 22
Recent Blog Comments By Dominic
-
Wrestling With My Dogmatic Fear Of The REQUEST Scope And Accessing Global Variables In ColdFusion
Posted on Aug 26, 2020 at 7:25 AM
Absolutely :). This is what ColdBox does with their RequestContext object that is made available as event variable in views and handlers (controllers). You can decorate it exactly as you sketched out there. So you could have: event.getRequestId() event.getCallingService() (and it alre... read more »
-
Passing isArray() Decision Function Does Not Ensure Member Methods In Lucee CFML 5.3.3.62
Posted on Jan 27, 2020 at 10:40 AM
It is indeed true. I found this when doing a lot of debugging. For the most part, it won't make much difference. Just when you're doing a big old loop or something like that is used by lots of other logic. I believe I made a PR to Coldbox to do some optimizations for this very thing. But y... read more »
-
Passing isArray() Decision Function Does Not Ensure Member Methods In Lucee CFML 5.3.3.62
Posted on Jan 27, 2020 at 9:46 AM
Its also worth noting that there is a performance impact using these member functions. Some more than others. For instance, doing something like request.keyExists( "somekey" ) is more expensive than mystruct.keyExists( "somekey" ) and both are more expensive than StructKe... read more »
-
Command-Query-Responsibility-Segregation (CQRS) Makes Domain Models Practical
Posted on Dec 29, 2012 at 9:28 AM
Great post Ben, CQRS seems really sensible and frees us from trying to squeeze round pegs through square holes. Out of curiosity, what software did you use to create your diagram (nicely done)?... read more »
-
How Do You Populate Shared Views In A Complex Layout Using MVC?
Posted on Jul 12, 2012 at 11:46 AM
@Adrian, I'm not saying it's bad, just coupled. A decoupled approach *is* doable though. Model Glue (which I believe is based on Mach II), achieves it very well.... read more »
-
How Do You Populate Shared Views In A Complex Layout Using MVC?
Posted on Jul 12, 2012 at 11:23 AM
@Adrian > <cfset runEvent("module:handler.method") /> I think this is the thing that Ben is wanting not to do. This works great, but if you want to keep your views agnostic, it doesn't work so well. ColdBox introduces a fair amount of coupling between Model, View and Controller ... read more »
-
How Do You Populate Shared Views In A Complex Layout Using MVC?
Posted on Jul 12, 2012 at 11:03 AM
@Ben, in ModelGlue, the config layer is absolutely part of the Controller. It defines how requests are handled and manages the routing.... read more »
-
How Do You Populate Shared Views In A Complex Layout Using MVC?
Posted on Jul 12, 2012 at 10:50 AM
I seem to remember the way that Model Glue works is really helpful for this kind of problem. There is a config layer that maps to various controller methods. A single request action can trigger calls to multiple controller methods and render multiple views. The net result is that, by the time your... read more »
-
Creating Service Objects And Value Objects In A Dependency Injection (DI) Framework
Posted on May 11, 2012 at 4:01 AM
@Ben, yeah more testable + more controllable in terms of how you decorate objects and how you switch in different implementations, etc. I'm sure if he could, he'd never use 'new', just that given the language constraints he is somewhat forced to. I probably came over a bit rude with my we're not J... read more »
-
Creating Service Objects And Value Objects In A Dependency Injection (DI) Framework
Posted on May 10, 2012 at 3:29 PM
@Ben, I *think* that he was very much saying that you can't serve up your VOs through the DIF. I believe his reasoning being that you cannot create an object without invoking its constructor in Java (folk correct me if I am wrong), so that a DIF wouldn't automatically know how to create the VO and ... read more »
-
Creating Service Objects And Value Objects In A Dependency Injection (DI) Framework
Posted on May 10, 2012 at 12:29 PM
I think we should always be a little weary of taking advice straight out of Java. Thankfully, ColdFusion isn't Java and the fact that CFCs don't have an automatic constructor means that we *can* use object factories for our VOs. The calling code can get an uninitialized object from your object fact... read more »
-
Good APIs Are Transparent In Their Expectations And Dependencies
Posted on May 9, 2012 at 11:09 AM
In The Pragmatic Programmer, they relate this to The law of Demeter . http://en.wikipedia.org/wiki/Law_of_Demeter Briefly, any object should know as little about the outside world as possible (e.g. it shouldn't need to know about the many methods and properties of the 'event' object when it rea... read more »
-
ColdFusion 10 Beta - Closures, Function Expressions, And Functional Programming
Posted on Mar 21, 2012 at 6:57 PM
@Thom, @Ben I agree with Thom that it would be great / expected to see these functional functions implemented natively. I've just blogged about it here and linked back to your (excellent) post: http://fusion.dominicwatson.co.uk/2012/03/my-first-bit-of-ruby%2C-nice-to-see-in-coldfusion.html... read more »
-
Building Executable Scripts For The Mac OSX Command Line With Node.js
Posted on Feb 14, 2012 at 1:39 PM
@Ben, You got it (at least it was talked about for Railo 4), the ability to run CFML from the command line would be pretty darn awesome.... read more »
-
Building Executable Scripts For The Mac OSX Command Line With Node.js
Posted on Feb 14, 2012 at 11:43 AM
Just talking about this today and looking forward to having this for CFers in Railo 4 and future ACF versions... dom$ ./pdfIzeMyWordDocsAndEmailThemToMe.cfm /path/to/my/docs me@me.com Etc.... read more »
-
Ask Ben: Removing Duplicate List Items While Maintaining Original List Order
Posted on Dec 1, 2011 at 8:12 AM
Can be done in one readable line using Java (discounting the list setup below): someList = "blah,blah,fubar,blah,fubar,hello,world"; uniqueArray = createObject("java", "java.util.LinkedHashSet").init(ListToArray(someList )).toArray(); The uniqueArray variable is now ... read more »
-
Learning ColdFusion 9: IsNull() And Working With NULL Values
Posted on Aug 9, 2010 at 7:58 AM
I've scimmed through the comments here and couldn't find the use that I found for it: var someEntity = EntityLoadByPk('myEntity', myPk); if( IsNull(someEntity) ){ // do something } When EntityLoad and EntityLoadByPk are expected to return a single entity bean and don't find one, they return NULL... read more »
-
From Windows To Mac - A Roller-Coaster Of Emotions
Posted on Aug 6, 2010 at 4:25 AM
I agree with the spaces thing. I'm running Ubuntu on my laptop and turned it off pretty sharpish after I got a nice looking dock and mouse gestures setup to trigger expose (sure, I can keyboard while I'm at it, but a quick flick of the mouse is easier while I'm using the mouse already). Once you can... read more »
-
Using ColdFusion Query's Underlying Java Methods For Query Manipulation And Logic
Posted on Jan 6, 2010 at 5:45 PM
Quite possibly, easy to find out ;) If not, the looping backwards trick seems to be the slimmest way to do it.... read more »