Viewing by month: November 2005

Nov 4 2005

Arf! Video: Automagic Validation

Today on Arf! TV, we'll look at how Arf! makes validation a breeze. Arf will automatically validate all properties for null, length, and type (making sure a date is a date, an int is an int, and so forth). What's really cool is that you can 1) override the validate() method to add your own validation rules, and 2) use XML-based "ui dictionaries" to control the text messages returned by validation, as well as localize other parts of your application.

Here's the video:

http://clearsoftware.net/demos/arfvideothree/

20 comments - Posted by Joe Rinehart at 8:21 AM - Categories: Arf!

Nov 3 2005

Arf: Beware the Iterator

Some methods in Arf, like List() and Get[property]() where the [property] is set by a hasMany() or belongsToMany() declaration, return a QueryIterator object. This is a simple iterator that lets you loop over the query using QueryIterator.next(), getting each record in the iterator.

However, that's *not* the way you want to do things if all you want to show each object. If you want to simply display each object, or something along that line, use QueryIterator.GetQuery() to get the query and display it with <cfquery output="myQuery"> like you're used to.

Reasons:

* Using next() requires the iterator to ask the factory for an empty record, and then populates it from the query row. That takes a touch of time - it's not a big hit, but be aware that it's there.

* Using a query makes things like grouping, etc., work as it always has.

So, use queries when you don't need to actually work with the records :)

Note: this entry originally had some stats. They were wrong, so I pulled them. Turning off "report execution times" in the CFAdmin made the difference unnoticeable without a full-on load test.

3 comments - Posted by Joe Rinehart at 6:53 PM - Categories: Arf!

Nov 3 2005

Arf! - New Video, New Functions

I've posted a new Arf! video that shows some new things: Optional cascading deletes across properties declared with HasMany() and HasOne(), the new, improved, don't-repeat-yourself syntax of HasMany(), HasOne(), BelongsTo(), and BelongsToMany(), intelligent HasOne()/BelongsTo() property setters (set with object, not with Id), and a quick display of how to use the QueryIterator to get and loop over related records.

Video is at http://clearsoftware.net/demos/arfvideotwo/.

1 comments - Posted by Joe Rinehart at 11:30 AM - Categories: Arf!

Nov 2 2005

Arf - What's Next

I wanted this Arf! tool yesterday, so I'm pouring in my own time to it. Tonight I'm going to be working on a few new things: HasOne(), BelongsToMany(), optional cascading deletes on HasOne/Many properties, and some other minor improvements.

After I knock these out, I'll be going back and looking at some database portability issues people have reported.

Expect to see much movement in SVN this evening.

3 comments - Posted by Joe Rinehart at 4:54 PM - Categories: Arf!

Nov 2 2005

Arf! Subversion and Trac

Simeon Bateman has donated Subversion (SVN) and Trac hosting for Arf!, so I'll be using that to host the code and keep track of issues.

Feel free to get the latest code, at any time, from http://svn.simb.net/arf/trunk/net/clearsoftware/arf/ (use your favorite SVN client to hit that URL. Yes, it starts with http://, not svn://.)

Trouble tickets and feature requests can be filed at the Trac site, at http://projects.simb.net/arf/trac.cgi/wiki

6 comments - Posted by Joe Rinehart at 6:29 AM - Categories: ColdFusion MX | Model-Glue | Arf!

Nov 1 2005

Windows Live - Ok, this just sucks.

Oh, Windows live. Excuse me if I'm cynical, but you've already succeeded it providing a lousy desktop experience (See: "Click Start to Stop"), so now you're going to take on the Web 2.0 crowd?

Let's try this out.

www.live.com.

"Firefox Users: Firefox support is coming soon. Please be patient :-)"

Oh geez. Don't make me click that blue thingie.

Sigh. *click*

www.live.com

Oh, a search bar. That's new.

Holy sh*t! Weather forecasts! I can have a homepage with weather forecasts!

And mail?!? It'll show me my e-mail.

Oh...gadgets. That could be cool. I heard OS X Tiger has this great Dashboard thingie, maybe this'll be like that, but in a browser.

Oh. It's javascript updating some text.

Feeds. I guess that's RSS. I don't see anything explaining what it really is. I can drag them from somewhere, but I don't see them. Oh, there they are, under categories.

The only good thing about my Windows Live experience was the beer I had while browsing. Seriously, this was amateur shlock. I could see this being an entry in a 48-hour coding contest written by one guy.

5 comments - Posted by Joe Rinehart at 10:51 PM - Categories: Off Topic

Nov 1 2005

Arf! 1.0e-23 (That's 0.00...001) bits

Seems like a lot of people want to test this, so, well, here's what I've got so far. It's pretty rough at this point, documentation is sparse, and there's some missing functionality, but this is an improvement on the version I Camtasia demo'd.

http://clearsoftware.net/client/enclosures/net.zip

The most notable API change is that hasMany() and belongTo() only have one required parameter: the name of the CFC you're relating to. Arf! assumes the last part of its name (that "last part" of my.app.Widget is "Widget") is the tablename it's relating to, and that the foreign/primary keys involved are named WidgetId.

In other words, instead of:

<cfset belongsTo("Widget", "my.app.Widget") />

It's just:

<cfset belongsTo("my.app.Widget") />

All of those assumptions can be overridden (as can table names, etc), but for now, you'll have to read some source to figure that out. Examples and docs will follow in time.

For now, feel free to e-mail me what breaks. Simeon Bateman is being kind enough to set up a Trac (trouble ticket) site for me, so I'll probably either fix what's broken, or e-mail you back asking you to fill out a ticket.

11 comments - Posted by Joe Rinehart at 9:50 PM - Categories: ColdFusion MX | Model-Glue | Arf!