Model-Glue:Unity Updates

I've had a few people ask me a few questions about when Model-Glue:Unity will be released, what enhancements are coming, etc. So, here's an update.

[Read more on Joe Rinehart's blog]

Timeline

Beta 2 should be out within a month or so. It took about seven months to go from the first public release of Model-Glue to Model-Glue 1.0. I'd rather get it right than do it fast.

GenericList Enhancements

The GenericList message is getting more powerful, without (much) additional complication.

As it shipped in Beta 1, you were able to use the "criteria" argument to send a list of viewstate values to the underlying GetByFields() function in Reactor.

For example, if you had a list of content items, and you wanted to show only content records where Published=1, you'd make sure a viewstate value (like URL.Published) was equal to 1, and do this:

<message name="modelglue.genericList">
<argument name="object" value="content" />
<argument name="criteria" value="published" />
</message>

Then, by using url.published (or, better, a controller to force this), you'd only retrieved records from the content table where published = 1.

That's kind of gnarly, so now you can force values into criteria:

<message name="modelglue.genericList">
<argument name="object" value="content" />
<argument name="criteria" value="published=1" />
</message>

Additionally, you can specify a method on your gateway other than getByFields(). You could write a method called something like "getPublished" on ContentGateway.cfc that performed the retrieval, along with necessary joins, etc., and then instruct the generic list to use this method instead of getByFields():

<message name="modelglue.genericList">
<argument name="object" value="content" />
<argument name="gatewayMethod" value="getPublished" />
</message>

Lastly, the struct created through the Criteria argument will still be passed to your gateway method as its argument collection. If you wanted to get only content written by URL.authorId, and you created an authorId argument on getPublished(), you could do this:

<message name="modelglue.genericList">
<argument name="object" value="content" />
<argument name="gatewayMethod" value="getPublished" />
<argument name="criteria" value="authorId" />
</message>

ReactorAdapter / ReactorORMController Rewrite

Both the ReactorAdapter and the ReactorORMController have been rewritten, tossing a bunch of ancient gnarly code that was written to emulate things (like editing an Iterator) that Reactor now does automatically.

Scaffold Enhancements

Scaffolds have had a little bit of "polishing" applied. Form controls that are currently in an error state now show their label in red, and the labels themselves apply some automatic capitalization rules to get better-looking text straight from the database. It relies on camel-cased column names, but you can always override the results via the Dictionary file. For example, "text" becomes "Text" and "firstName" becomes "First Name".

TweetBacks
Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
© 2018 Joe Rinehart
BlogCFC was created by Raymond Camden. This blog is running version 5.9.3.006.