Jul 13 2006

Reactor vs. Other CF ORM/Database abstractors

Posted by Joe Rinehart at 9:05 PM
5 comments
- Categories: Reactor

In an earlier post today, I stated a bit of why I like Reactor, and why it's what I'm using for the automated database functions in the upcoming "Unity" release of Model-Glue. Simon Horwith asked a bit about which others I had looked into - here's the list, starting with my own experiments, "Arf!" and "Paste."

Arf!

Arf! was my own toy in which I created a "record factory" that would basically create a mixin that "blended" persistence and relational/composition functionality into any CFC extending a base ActiveRecord CFC. It had a bit of a Rails flavor to it, and I do have a production application running with it.

However, it causes a lot of "kitchen sink" CFCs that act as a service layer, gateway, and bean all surrounding a single entity. Great during quick prototyping, but a little bit painful when applications grow.

Paste

"Paste" never went public. It was intended to be a compliment to Model-Glue. Fueled by Inversion of Control, it was intended as a generic "inline" code generator that focused on JDBC metadata. You could define "types" of CFCs to generate via XML (like a "Gateway"), tell it where to put the "base" (like a Reactor "project" CFC) and customizable shell (like a Reactor /model/data CFC) CFC, and it'd spit out code based on whatever CFM-based template you wrote (I hadn't learned XSL yet, and stuck with what I know.)

Basically, you could plug in your own types of code to generate, and use statements like paste.create("gateway", "Contact") to generate whatever you defined a Contact gateway to be.

Heavy stuff, but a bit of the underlying architecture (generic code generation configured by Coldspring) is stuff I'm talking to Doug about for Reactor 2.0.

ObjectBreeze

I just have a really strong bias against getProperty(propname:string) and setProperty(propname:string, value:any) methods. To me, it's against the concept of programming to interfaces. However, I really like how easy this one is to use. It was a little like Arf!, but sort of different in that you just ask for an object instead of dealing with a hard CFC. I'm also not sure how you'd add additional business logic to a given entity.

Transfer

Transfer is, to say the least, looking very robust. It's just not quite as easy to use (for me) as Reactor. Basically, I saw Reactor, it clicked in my brain, and I've been able to use it very well while never actually reading the documentation. Haven't quite had the same luck with Transfer, but some of its capabilities (such as caching) look very promising. If it exposes table metadata, it'd be pretty interesting to try to build another ORMAdapter and ORMController implementation to see if I could scaffold and generic ORM using it instead of Reactor.

Woodi

I played with it for a bit, trying to use its libraries to generate basic persistence CFCs etc, but it didn't provide implementations of the patterns needed for MG:U, and was Oracle specific (I was doing an Oracle project at the time - it uses Arf!).

Conclusion

Reactor simply worked. Out of the box. It was simple, and it works the way I think (in respect to bean/dao/gateway CRUD). It allows me to simply add business logic where necessary, and doesn't try to build a service tier for me, which I rather like - I can refactor to one as necessary.

Comments

Sean Corfield

Sean Corfield wrote on 07/13/06 11:28 PM

I really don't like the generic getProperty() / setProperty() methods in objectBreeze either.

Interesting that it comes from Nic Tunney who works for Simon Horwith... I wonder if this is some of Simon's generic get/set methods mentality rubbing off on Nic?

Transfer has some pretty slick functionality but I agree that it's not as easy to use as Reactor. It's different and for some (many?) applications, I expect it's a better fit than Reactor. Folks should check both out.
Sami Hoda

Sami Hoda wrote on 07/14/06 3:29 AM

Joe, thanks for the info! Helps me make a more informed decision.
Bob Everland

Bob Everland wrote on 07/14/06 8:17 AM

Don't forget you also chose Reactor because you have a geek crush on Doug.
ntunney

ntunney wrote on 07/14/06 9:50 AM

Heh, geek crush.

Get and setProperty() made the most sense to me at the time and honestly still do in some ways. Not from a hardcore OO standing, but programatically. The generic accessor methods are still there in v2 beta for backwards compatibility, but I had enough requests that specific property get/sets are also now implemented. It will be interesting to see which route people will take.
Javier Julio

Javier Julio wrote on 07/14/06 1:38 PM

One of the things I've hated most about working with OO is the repetitive inefficient code. Mainly in beans with all the getters and setters. Personally, I love working with the get and set functions that S.A.M. use. Is it the best, of course not but you got to work with what is best for you. I like it because it makes my CFCs lighter and easier to maintain. I do see the benefits to not having that approach but to me they have no value. I have yet to use ObjectBreeze but am a little disappointed that Joe or Sean didn't seem to really like it much despite its ease which if you ask me is the most important.

Write your comment



(it will not be displayed)