Uncategorized
Trying to sort things out
I have been feeling kinda scattered. I am in a position at
work that I have not been in before. I have an existing system
that works pretty well, i have 7 sites all running well. But I
have been given the opportunity to redisgn the system and to use the
best technology available. What would that be? Well they
have left it up to me to decide.
So I have spent the last week looking at Frameworks, tools, and reading
about all the things I havnt had time for in the last year. And
now I have a new feeling. I feel totally overwhelmed.
After doing the DAO implementation of Ray’s blog code for my site, I
realized that writing all the classes and hacks that were required to
implement the model I designed, was not a good path to take in
cf. The blog code is a small app and the new app i would be
designing is huge. I cant imagine trying to manage all of that
using similar practices.
This led me to look into Hibernate. I wrote a couple demo java
apps and was supremly impressed with the simplicity of the
persistence. create a session, create a transaction, open up your
favorite pojo, call session.save(pojo), close the transaction, close
the session. Using xml files to map your pojo’s to your database
schema it does all the hard stuff. So I moved on to trying to use
cf and hibernate together. Unfortunatly it appears the log4j that
is used in cf and the log4j in the libs for hibernate dont play well
together. So until I figure out how to get around that i am kinda
stuck.
Anyway, I guess I just wanted to post about it, to sort things out in
my head. And it never hurts to see if others have any ideas or
suggsestions about my thoughts. There seems to be a trend among
the CF’ers of late. That is "quit whining about what cf cant do
OO, and utilize the strenghts that it has" and one of those
strengths being the easy use of java. So i am looking that head
that way. Problem is from where i am, I cant see the path.
21 May 2005 Simeon

Hey Simeon–welcome to the club. :-) I get this feeling pretty often when embarking on a clean slate project. We’ve discussed Hibernate a bit via IM, but one thing I haven’t checked out is some of the other popular Java ORM tools to see if they are prehaps easier to integrate with CF. There’s a decent article in the JDJ about some other alternatives:
http://www.theserverside.com/blogs/showblog.tss?id=CayenneAndHibernate
Basically they discuss these:
1. Hibernate (http://www.hibernate.org)
2. Cayenne (http://objectstyle.org/cayenne/)
3. Apache Torque (http://db.apache.org/torque/)
4. Castor (http://castor.codehaus.org/)
Once I have some time I’d like to check out these others and see if the integration with CF is a bit less painful than Hibernate and doesn’t sacrifice too much funcitonality.
Yeah, I am also looking at iBatis which I found when looking into the Spring framework. That is the next step, evaluate other tools. i just really liked hibernate and already put a week of evaluation into it :(
>> Using xml files to map your pojo’s to your database schema it does all the hard stuff.
my quetion isn’t about using XML as such but hibernate and handeling subtle changes in logic depending on "context".
we’ve got little gotcha’s and little bits of conditional logic all over our app and it’s driving us nuts (it doesn’t help that these subtle changes are added after modules are built)
(eg: data validation can be painfully different if the save is an insert or an update).
do you have similar worries with your apps?
thanx
barry.b
Amen! I used your DAOized Blog cfcs as a basis for doing DAOs in a project at work and it was a lot of work. In my case I had to abstract the data persistence with MySQL and XML. While it definitly made my life easier, I can’t help but wonder if doing my OO in Java is the way to go. I think we will see this come up more and more with large CF applications.