Category: Model-Glue

Aug 6 2008

Charlie Griefer, Model-Glue, and CFWindow

I'm not much of an Ajax'r, so if someone asked me how to use CFWindow in a manner that allowed posting a form submission back to its parent page, I'd have to idea what to say.

Charlie's put together a blog entry on how to do just that, allowing an autonomous form backed by a Model-Glue event to live in a <CFWindow>.  It turns out that ColdFusion adds a few parameters to the request and that by using the "append" attribute on Model-Glue's <result /> tag you're able to seamlessly integrate.

1 comments - Posted by Joe Rinehart at 7:58 AM - Categories: Model-Glue

May 21 2008

Model-Glue 3 Roadshow: Online, Live, 7:30pm Eastern, Tonight

I'll be presenting the Model-Glue 3 Roadshow tonight at 7:30pm for the Hartford, Connecticut CFUG (http://www.ctcfug.com). Sorry for the late notice, but we weren't sure it was going to happen until about five minutes ago!

For anyone who'd like to attend, the Connect URL is http://adobechats.adobe.acrobat.com/ctcfug200805/. If you can't make it but would like to see the presentation, I'll be doing more online sessions this Spring and Summer. It's also the same presentation that I'll be giving at Scotch on the Rocks and CFUnited and have given at cf.Objective() and WebManiacs.

5 comments - Posted by Joe Rinehart at 3:24 PM - Categories: Model-Glue

Apr 18 2008

MG3 and CF Framework Performance Benchmarks

Whenever I work on the core of a Model-Glue version, I use a suite of sample applications and JMeter tests to make sure I'm not wrecking anything in a performance or resource context. I measure against both prior versions of MG and other frameworks, making sure nothing anomalous is sneaking into MG by watching for spikes in the numbers. I'm not trying to "compete" as much as I'm just looking for comparable benchmarks for Model-Glue, and performance profiles of the other frameworks are my best bet.

For running these tests, I maintain a set of applications (Model-Glue, Fusebox, Mach-ii, and now ColdBox) that are the simplest possible request - they don't even show any output. For Mach-II and Model-Glue, no listener functions are run. For ColdBox, it's just the minimum required handlers and a simple "main" handler that adds one view.

Basically, it's a test of how well each can spin up its equivalent of a request context, execute it, render one empty view, and shut down.

This morning, I slaved my PC to running these tests, which ramp up from 25 to 100 simultaneous users, each making 100 back-to-back requests. The following chart shows the results:

Coming back soon...getting an optimized application shell for ColdBox from its team.

Note: don't use these numbers for choosing a framework. Application code is much more likely to be a bottleneck than the framework!

If anyone else would like to try these out (or if any framework authors would like to make sure I've made the sample apps as simple as possible!), I've attached the Eclipse project I use for all of this to this entry. Maybe it'd be a good RIAForge project?

9 comments - Posted by Joe Rinehart at 10:27 AM - Categories: Model-Glue | Frameworks

Apr 15 2008

Sharing MG ColdSpring Beans With Other Applications

When you write a Model-Glue application, it both manages ColdSpring for you and gives you a place to define beans.

Eventually, though, you may want to use some of these beans outside of your Model-Glue application but still inside the same application scope. You may be writing a Flex application or simply creating a common pool of beans / services all of your apps can share.

To do this well, you'll need to use what are known as "parent bean factories." Simply put, you'll first create your own instance of ColdSpring's bean factory then instruct your Model-Glue application to look for beans first in its internal and then in this "overaching" ColdSpring factory.

Step 1: Managing ColdSpring yourself

You'll first need to manage creation of your own instance of a ColdSpring bean factory. In your Application.cfm (easy to port to Application.cfc), you'll want to add code to create it or reload it as necessary (Note: this can be improved, and should be, with a double-checked lock).

<!--- Reload beans if not present or url.init is defined --->
<cfif not structKeyExists(application, "sharedBeanFactory") or structKeyExists(url, "init")>
<cfset application.sharedBeanFactory = createObject("component", "coldspring.beans.DefaultXmlBeanFactory").init() />
<!--- Load your common beans XML file --->
<cfset application.sharedBeanFactory.loadBeans(expandPath("/my/shared/beans.xml")) />
</cfif>

Ok. Your application now contains a DefaultXMLBeanFactory instance. You can test it out by writing a quick index.cfm with an application.sharedBeanFactory.getBean("myBean") call that'll return a bean from the XML file.

Step 2: Configuring Model-Glue

With that taken care of, we need to tell our Model-Glue application to look first in its local config/ColdSpring.xml file first, then to look in the sharedBeanFactory second.

Open up your Model-Glue application's index.cfm, and you'll see this line of code commented out (assuming it's from an MG2 application template):

<cfset ModelGlue_PARENT_BEAN_FACTORY = ??? />

Uncomment it, and change it to:

<cfset ModelGlue_PARENT_BEAN_FACTORY = application.sharedBeanFactory />

Ok, you're good to go! Beans defined in the sharedBeanFactory's XML file are now available to your Model-Glue application as well as any other applications in the same application scope.

3 comments - Posted by Joe Rinehart at 3:09 PM - Categories: Model-Glue

Apr 9 2008

MG3 Video Sneak Peak: Event Generation

One of my favorite features coming in MG3 is purely for developer ease of use: hit an event that doesn't exist while in development mode, and it'll generate intelligently named controllers, listener functions, and views, wiring them all together with convention-based XML.

Here's a video of Event Generations (and a bit of SES features) in action:

13 comments - Posted by Joe Rinehart at 5:01 PM - Categories: Model-Glue

Apr 1 2008

MG3: "More Gooder" at cf.Objective()

A few years back, Scott Stroz made a name for himself yelling out "Model-Glue's More Gooder" during the first preso / BOF I ever did on Model-Glue.

At cf.Objective() 2008, I'll be doing the first public preso of Model-Glue 3, as well as (hopefully!) announcing a public alpha release. Model-Glue 3 is about taking Model-Glue "back to its roots," making it easier than ever to develop MVC+II applications without losing any architectural advantages.

Besides a rearchitected and more thoroughly tested core, Model-Glue three has seven features that are all aimed at productivity. While some are public, there are a few big ones that won't be shown / disclosed until cf.Objective().

If I have any luck, Scott'll have reason to yell again.

6 comments - Posted by Joe Rinehart at 7:30 AM - Categories: Model-Glue | Conferences and Speaking Engagements

Jan 15 2008

MG3 Feature Peak: "Beans" Scope (Autowiring on steroids!)

Over on the Model-Glue blog, I've posted details of the first new feature that's been implemented (others are spec'd, just not written yet) in Model-Glue 3.

This means the core is running, and I'm now working on features, both old (scaffolding) and new.

In short, this feature adds a new attribute on the <controller /> tag called "beans" that replaces autowiring. "Beans" is a list of beanIds that should be retrieved from ColdSpring (or whatever container is configured) and set into the "beans" scope inside of a controller. Head on over to the Model-Glue blog to read full details.

0 comments - Posted by Joe Rinehart at 7:45 AM - Categories: Model-Glue