Yep, I really am working on it! Things have been crazy busy at work - combining that with some renovations and home and my summer cycling habits, I'm a little swamped.
However, there are two new things in the bleeding-edge...one permanent, the other is in there for feedback:
1. Permanent: "append" attribute on the result tag
Ok, so the "redirect" attribute is nice. But imagine this: you commit a new record, then redirect to a read-only detail page for that record. That keeps it from being recommitted if the user hits F5, but the detail page may not know what record to show, because it probably uses a URL parameter named recordId!
Append is optional, and contains a list of viewState values to append to the url. In this case, you could do:
And your the URL redirected to would be "?event=recordDetail&recordId=12345&foobar=foobarsValue"
How's that?
2. Feedback requested: createSingleton()
There's been talk about how configBeans can do a lot more than instantiate configuration: they can be used to instantiate pieces of your model as singletons. However, it may not be convenient, or in your plan, etc. to have to create a .xml file just to a singleton instance of SomeWebServiceWrapper.cfc. Also, you may not want to have SomeWebServiceWrapper conform to the needs of the ChiliBeans workings (get/set, etc.).
To answer this need, I've added a method to the base controller called "createSingleton" (that actually wraps a ModelGlue method called getSingleton). Its signature is the same as createObject, however, it'll insure that you're only creating one instance of that object within a given Model-Glue application.
Some initial feedback has been that it'd be nice of createSingleton() used ChiliBeans to configure your singleton. However, I feel it'd be better to keep configuration out of it, and if you want to do that, you can configure your singleton with a ConfigBean, like so:
<cfset var serviceConfig = createConfigBean("myWebServiceConfig.xml") />
<cfset var service = createSingleton("component", "SomeWebServiceWrapper").init(serviceConfig) />
Thoughts, flames, objections, praise, anyone?
Minor last note: You'll note that I use createConfigBean() instead of getModelGlue().getConfigBean(). It does the same thing, and while it's currently available in the bleeding edge release, it may not stay.
6 comments - Posted by Joe Rinehart at 6:36 PM - Categories: Model-Glue