I haven't looked at the new features of CF9 (including the Hibernate
integration) but I'd like to make a few points.
It seems to me that Adobe is complicating the language further when it
ought to be improving what currently exists. I'd argue that Adobe
should be considering Coldfusion in the same way as a developer should
a project. i.e. you focus on getting the core functionality to work as
well as possible and then you introduce new functionality only when
you have a very good business reason for doing so. Less is sometimes
better. Coldfusion's greatest asset is its' ease of use and simplicity
but it biggest weekness its' inflexibility. Hibernate integration
would seem to be something that would *need* to be flexible. Also
hibernate integration is something that is probably only needed on
larger projects. The developers on these projects should be capable of
using Transfer or Reactor or writing a similar ORM themselves, or for
that matter integrating with Hibernate through Java.
What this will inevitably lead to is some (many) developers not using
the right tool for the right job. Do you want a simple/light read-only
query? Do you want an iterator for object entities? Do you want a full-
on array of entity objects in memory? Let's see the performance
implications!
So then what about writing the sql, isn't this a waste of time? Well
sometimes writing the sql code yourself is *good*. If not, in many
cases using a code generator will suffice.
Adobe should ensure that any cfdump clearly defines the data in
contains, as Philip says. And Brian, although properties should be
encapsulated as you say, it is incorrect to say that Coldfusion
*needs* to use person.setForename() instead of "person.Forename". This
is Coldfusion syntax only not implementation. Adobe could invoke the
set/get methods automatically as is done in .NET today with
properties.
Also I think it is important to explain the importance of
encapsulation rather than just stating it. So to clarify Philip, the
reason to encapsulate the properties of the object is to ensure the
integrity of the data inside the object.
Hi Brian,
Thanks for that reply :) I'm only playing devils advocate. Coldfusion
9 is still only beta and I haven't had time to look at it yet. When I
do I'll let you know. However I do believe Coldfusion should try to
complement other languages and not always try to compete.
I have just a few questions I hope you can answer:
a) Is Abode suggesting people use Hibernate without knowing about it
or that they should spend a full month reading all the documentation
(and that is assuming that they are a fast reader).
b) How much of the Hibernate functionality is Coldfusion implementing
would you say and how flexible do you think it is?
c) Is Hibernate an agreed feature of the CFML advisory board and
therefore something that will be implemented across the board (Railo,
Open Bluedragon, New Atlanta)?
d) WIll the hibernate functionality work whatever the Servlet/J2EE
server used (without configuration)?
Hibernate is definately an in-demard project. It is competing head-on
with container managed persistance (EJB3) in the J2EE arena and is now
getting recognised in .Net alongside Spring.Net, and is probably a
great project for any software developer to try to pick up. However
I'll still be interested to see how beneficial it will be to
Coldfusion hidden behind some cf tags.
I don't have any allegiance to Coldfusion, Railo, New Atlanta, or for
that matter CFML in general. I'd happily use the best tool for the
job. I like the language and will hopefully continue to use it but
that doesn't mean there aren't a hundred (well maybe ten) things that
annoy me about it every day.
The Hibernate integration is intended to be used without needing to
know anything about Hibernate. It's simple, slick and "just works".
> b) How much of the Hibernate functionality is Coldfusion implementing
> would you say and how flexible do you think it is?
All functionality is available. Nearly all core functionality is
available directly using <cfproperty> tags. If you really need
something exotic, you can drop into the .hbm files.
> c) Is Hibernate an agreed feature of the CFML advisory board and
> therefore something that will be implemented across the board (Railo,
> Open Bluedragon, New Atlanta)?
Hibernate is considered vendor-specific by the Advisory Committee
because it is an "unknown". It's not clear how well it will be
received by the community nor whether Adobe may need to change it in
response to community feedback. It was also considered a big burden to
place on vendors to require implementation as a core feature. The
Committee will review it in two years - for CFML2011 - and may elect
to move it from vendor-specific to extended-core (in which case it
will need to be documented / specified as part of CFML2011).
Yes, Railo has committed to providing integration with Hibernate (and
a number of other JBoss projects). We'll follow Adobe as closely as we
feel is appropriate and may offer additional / improved features based
on community feedback - or we may try to simplify it based on
community feedback. Again, this goes back to the Committee's position
on this feature.
> d) WIll the hibernate functionality work whatever the Servlet/J2EE
> server used (without configuration)?
Yes. That's almost certainly Adobe's intent.
> Hibernate is definately an in-demard project. It is competing head-on
> with container managed persistance (EJB3) in the J2EE arena and is now
Hibernate is the Reference Implementation for EJB3 I believe (so I'd
hardly call it "competing").
> getting recognised in .Net alongside Spring.Net, and is probably a
> great project for any software developer to try to pick up. However
> I'll still be interested to see how beneficial it will be to
> Coldfusion hidden behind some cf tags.
You clearly need to read the CF9 docs and experiment with it. As Brian
says, you're speaking from your gut right now and, on this feature,
that's not a good idea :)
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies US -- http://getrailo.com/
An Architect's View -- http://corfield.org/
"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood
Brian / Sean,
Of cause what I'm saying is a gut reaction. As CF9 is beta and no-one
will have produced any production applications with it, I'd say
everyone's opinions are in some way gut rather than factual.
Also object persistence *is* different from searching. It is more
fundamental. You're also now opening up alternative implementations to
CRUD and unlike you I do think this could lead to problems. With
Verity/Lucene there is only one choice. In some cases a high level of
abstraction is good. In other cases blindly doing things without
knowing the impact is dangerous. I'd consider object persistence to be
the latter.
I believe divergence of CFML specs between vendors could be the
biggest danger to the language, in the longer term. Object persistance
isn't like Air / Livecycle integration (specialist Adobe topics), it
is fundamental.
I really don't get the reasons for the implementation. If you're
creating a seriously complex application in Coldfusion I'd suggest you
need to utilise Java or .Net in the back-end. Then if you want
Hibernate, it can be integrated natively. If we're saying that it is
needed for simple sites and applications, then there is going to be a
large learning curve and misuse. And frankly it isn't needed in this
case. Coldfusion developers need to be able to write SQL. They need to
be able to understand it. It may be that Adobe feel that it is good PR
to say they have integrated Hibernate into CF9. I'd suggest this is
misguided. If Coldfusion tries to do everything it'll end up doing
none of it well. I'll repeat myself, "simple is good". At least in
Coldfusion's case.
Actually Adobe works pretty hard to include "average developers" in
its prerelease programs.
> Also using something in a test environment is very different from
> watching it perform in production. A stepping stone yes but not the
> same.
Hibernate is well tested in large-scale production applications and it
sounds like the CF Team have done a huge amount of work to ensure
CF/Hibernate performance is good.
> I think people are simply confused if they port a Coldfusion app
> *just* to make use of Hibernate.
Not sure what you mean by that... port a ColdFusion app from where to
where (or what to what)?
> I'm a big fan of using Coldfusion
> alongside Java or .Net as to me this offers the best of both worlds.
Which puts you in a VERY small minority.
Most CFers - the VAST majority - do not know Java or .NET so if it
isn't CFML, they can't use it. Adobe's integration of Hibernate
provides a way for those developers to avoid writing a lot of
repetitive CRUD SQL and even to have the DB updated automatically as
they evolve their schema directly in CFML (using simple CFCs).
> What I'd *like* is for the time and money to be used differently. I'd
> rather they improved current weaknesses, fixed bugs, improved
> performance, rather than add new features.
As Adam recently said, the first part of each release cycle is spent
doing precisely that. Then they move on to adding features that their
customers have asked for.
> I don't really get the whole "I'm a Coldfusion developer. I can't do
> Java or Ruby or PHP?". A good developer should have a core
> understanding and experience that spans most languages.
Ah, well, there's the rub. By your definition, the vast majority of
CFers are not "good developers" then.
> Can't the message be it's good for Coldfusion
> developers to grow beyond the CF world.
Sure, and I've been advocating CFers learn new languages for years.
But the fact is, the vast majority of the ~800k CFers out there are
monolingual.
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies US -- http://getrailo.com/
An Architect's View -- http://corfield.org/