Dimitri Maziuk said:
Yeah, but do you really want to do O/R mapping on the client?
No, of course not.
The two options being compared were: (a) database access from PHP, and
(b) database access from Java. This assumes an architecture in which
data mapping layer is embedded into the web application, running on a
single server. It's assumed that there are no middleware servers
involved, just because PHP is rarely or never used in those contexts.
When there's a middleware server, PHP has other disadvantages since it
isn't designed for that environment.
HTML does not display objects. You're sending code (e.g.applet)
to the client to do that -- if you're giving them code, keeping
O/R mapping in the server-side tier will make client code simpler,
smaller, hide business logic from prying eyes, etc.
Applets have nothing to do with this. Yes, information about objects is
presented using HTML or an equivalent. A miniscule number of web
applications use applets for presentation, because they are overkill for
most data-oriented applications.
I don't know where you got your scenario from, but so far it isn't at
all relevant to this subthread.
Oh puhlease. It's java web applications that use ready-made O/R
mapping products require metadata, not the other way around.
Sure you can't do a generic one-size-fits-all O/R mapper without
requiring metadata, the $15 question is if your particular task
actually needs a generic O/R mapper.
I'll tell you that I'd rather use Hibernate than reinvent it. The
problem with O/R mapping is that it's easy to get it MOSTLY working, but
it's very difficult to do well. Reinventing O/R mapping when options
like Hibernate already exist is a waste of time for most applications.
In fact, for every project I've ever worked on, either an established
O/R mapper is a better choice, or the task isn't well suited to O/R
mapping at all. I've never seen good come from trying to reinvent the
technology in a project-private code base. I have, though, seen a lot
of pain come from doing so.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation