Viewing by month: April 2006

Apr 21 2006

Model-Glue "eXit Events" (like XFA's)

One thing Sean Corfield clued me into a while back was emulating Fusebox eXit FuseActions (XFA's) in Model-Glue using the <value> tag under <include>. I've never really blogged about it, but it's become a standard way I do things. He's explained it, quite nicely, on his site. Read more at http://www.corfield.org/blog/index.cfm/do/blog.entry/entry/ModelGlue_and_URL_consistency.

7 comments - Posted by Joe Rinehart at 1:35 PM - Categories: Model-Glue

Apr 21 2006

Friday's Foaming Rant: Oracle 10 XE and HTML DB

Hey, it's Friday! Time to write my op-ed entry for the week. And this week I've been dealing everyone's favorite way to incite a headache: Oracle.

To be fair, I don't know much about Oracle. I mainly deal with SQL server, but I've also used MySQL, PostgreSQL, and Filemaker in the past. However, I'm doing a project at work that's backed by the new Oracle 10XE, and it's just no fun.

For those that haven't used Oracle 10XE, it's their "personal" edition aimed at the MySQL market. You can only have one database (but many users...which sort of are like what others think of as databases...oh, my simple head starts to spin). It also comes with a super-duper able-to-build-entire-applications-with-zero-code Web-enabled management UI / uber-console that's called, in an amazing move of the Oracle branding department, HTML DB.

It's a piece of crap:

1. It's slow. Molasses-on-a-sunday-morning-in-Vermont-in-February slow.

2. I'm not sure what the Javascript it so heavily relies on doing, but often it'll freeze Firefox entirely while it does something simple, like run a 1-record select statement.

3. Hey, look, a recycle bin. It lets me see dropped objects. Hrm, no "Restore" button on the list. (Click an object). Hey...no restore here either. Not much of a recycle bin, more like a "nyah nyah, you dropped it, you're not getting it back bin."

This is pretty representative of the whole experience.

4. Wow, they spent a lot of time on writing Javascript to dynamically resize the ui's iframes on every page load. It's not like the end user can resize them, so....why not just statically size them with something like width="300"?

5. Object Browser. Tables. Choose a table. Add column named "SomeCharColumn". Next. Finish. Create. Finish already. Create. Confirm. Oh - sorry, the default length we filled out for you a few steps back isn't valid for CHAR. And we won't tell you what is. Enjoy!

6. This one's minor, but representative. When you add a foreign key constaint, and choose the column in one table, you'd think it'd just guess that you want to select a column with the same name in the referenced table. MySQL Administrator does it, and it's quite nice. You'd that that Oracle, with Mr. Ellison flying his MiG, could afford those ten lines of Javascript. But, no, the open source guys actually produced a better UI than the billion-upon-billion dollar company.

7. CSV exports. They must've missed some minor QA, because I love DL'ing files named foo.csv.txt - c'mon, guys, this is a second-week-doing-web-apps thing.

8. Basic "Does this make sense?" QA was never done. I love having two links, on the same page, labelled "Home" and "Homepage" that go to entirely different places.

Overall, Oracle put a lot of time into trying to make things "slick" with Javascript - I've been using it for a few months, and just noticed the start-button style flyout menus on a lot of the "let's draw our own .GIFs instead of using <input type="button"< controls. - but it's like they spent very little time questioning whether or not the thing does what it says it's going to do, or works in the way a dba/developer expects it to.

Man, I love TOAD.

2 comments - Posted by Joe Rinehart at 1:20 PM - Categories: Causing Trouble

Apr 17 2006

Model-Glue: Not optimal under load

I'm working with Mike Brunt over at Webapper to add Model-Glue to the list of CFPetmarket apps that have been tested. When I got preliminary results back, I was a little suprised: it was much slower than I thought it'd be.

I've never had an opportunity to compare it side-by-side with a Mach-II (or Fusebox) application, and because my Petmarket implementation used the same model code as the Mach-II implementation, I was able to use the Mach-II version as a reference for performance tuning.

It turns out I made two low-level mistakes in the framework: the CFC that most people know as "arguments.event" was re-instantiated for each <event-handler>, and, when it was instantiated, it re-instantiated the CFC that handles Event Bean population. I've tuned those two flaws out of the core, and JMeter (the Apache foundation's F/OSS load test tool) is showing that M2 and MG behave comparably under heavy (100-thread) load.

I'm testing this as a 1.1.01 release of Model-Glue right now, and if anyone else wants to give it a whirl, it's comitted to the Subversion BER URL.

8 comments - Posted by Joe Rinehart at 10:08 AM - Categories: Model-Glue

Apr 14 2006

Friday's Foaming Rant: CFScript is silly

I'm looking at an app right now and every line of code that can be in <cfscript> is, in fact, in <cfscript>. I'm aware that some people love it, and I expect some commentors will disagree, but I've just got to say something I've felt for a while (bear in mind that this is just my opinion): CFScript is silly.

Here's why I think this:

1. It's confusing as hell.

If you're a web developer doing ColdFusion apps, it's likely that you jump between ColdFusion and Javascript regularly. ColdFusion is tag-based, and uses its own set of FORTRANish operators. Javascript uses ECMAish styling for both its formatting and its operators.

That's enough for anyone to accidently screw up now and then, so why would I want to use something that's a blend of the two, making me keep three sets of syntax straight in my brian? I've got better things to do with my time.

Heck, add AS3.0 into the mix, and CFScript becomes less of a code style, and more of an obfuscation tool!

2. It's got about one-tenth of what you need for ColdFusion.

"Let's put all of our code into <cfscript> tags, guys!"

"Sure, that'll make us look hardcore! But what if I need a query?"

"It's still top down, so just stop script, run your query, then script again!"

<cfscript>
dsn = getDsn();
</cfscript>

<cfquery datasource="#dsn#" name="stuff">
SELECT * FROM leftHandedSwabHandles
</cfquery>

<cfscript>
if (stuff.recordcount) {
statusMessage = "We found stuff!";
} else {
statusMessage = "We didn't find squat!";
}
</cfscript>

Oh boy, that's fun to read. Leads me to...

3. It won't make you hardcore

I don't think using a half-breed of ColdFusion and ECMA is going to make you look like a hardcore programmer. Just having you code look more like C isn't enough to make you a C programmer.

4. Finally, why bother, in the first place?

You can be a perfectly good ColdFusion programmer and never in your life touch CFScript. There's no reason to learn it.

Learning and using CFScript is a lot like reinventing the wheel because you had nothing better to do, but felt like building a wheel that was missing all round parts...

44 comments - Posted by Joe Rinehart at 12:32 PM - Categories: ColdFusion MX | Causing Trouble

Apr 13 2006

I'm Older, Again!

Wow - it seems like this just happened. Is it April 13th, already, again? The first person (who doesn't know me personally) to guess how old I just turned gets a free Model-Glue prize at CFUnited.

PS - Belated happy birthday to Ray Camden, another April birthday!

17 comments - Posted by Joe Rinehart at 9:10 AM - Categories: Model-Glue | Off Topic

Apr 12 2006

Taskblaster! - Model-Glue:Unity Preview

I've roughed out the first database-driven example application for the Model-Glue:Unity release. It's a simple to-do list app where you can create an account, log in/out, create new lists, add tasks to lists, and complete tasks.

Other than editing the config files, I wrote 124 lines of code, and zero SQL. I figured it could be fun to show what developing in Unity is like by posting the code for the application (not the framework itself yet, or the Headstart functionality "Taskblaster" includes).

You can play with the app at http://www.model-glue.com/taskblaster and download all of the non-framework code for it http://clearsoftware.net/enclosures/taskblaster.zip.

I'm not quite ready to publicly post the new feature list, but there's a few unannounced things you can find by looking at the code.

6 comments - Posted by Joe Rinehart at 1:07 PM - Categories: Model-Glue

Apr 10 2006

Model-Glue: End of Life for 1.x

I released Model-Glue 1.1 this morning (should have just been announced, had the post set up to publish at 10a). This release is the end-of-life for the 1.x code base: all new releases are running on an 85% rewritten set of CFCs under the modelglue.unity.* package.

I took a break to get a snack and I wanted to write another, less official post on the subject as well. (Official release announcement is at http://clearsoftware.net/index.cfm?mode=entry&entry=8418221B-E081-2BAC-6993D521C32F4D19.)

I re-read the bottom of the readme.txt for 1.1 and the last line gave me a weird emotional reaction:

This is the end of Model-Glue 1.x development. All new releases will be based on the 2.0 "Unity" core.

After nearly 10,000 downloads (9,547 since I started counting at 0.7), I'm going to stop working on the code everyone knows as Model-Glue. It's both satisfying and intimidating. The Model-Glue 1.x core is familiar, with quirks I've gotten used to. Model-Glue 2.0 is a new set of challenges, focusing on solving the same problems more cleanly while tackling new functionality.

During one of my last edits to the Model-Glue 1.0 core, though, I found something that'll finally bring some closure to something that's bugged a few people: I now know why I had to render views in reverse order inside of ModelGlue.cfc. Apparantly, late one night, in the bowels of <event-handler> metadata CFCs, ArrayPrepend was used instead of ArrayAppend.

Sheesh. I left it in there.

3 comments - Posted by Joe Rinehart at 9:58 AM - Categories: Model-Glue | Off Topic