I came across the Me encontré con la post puesto from desde Jesus Rodriguez Jesús Rodríguez where he tries to find good reasons to convince management to use Hibernate. donde trata de encontrar buenas razones para convencer a la gestión de uso de Hibernate.

[[I tried posting but it required me to create an account, also I felt that the topic might be of general interest. [[He intentado publicar, pero me requiere para crear una cuenta, también me pareció que el tema podría ser de interés general. So I made this a separate post and included him in trackback & pingback.]] Así que hice este otro post y le incluyó en trackback y pingback.]]

In his case the company followed two models: En su caso, la empresa siguió dos modelos:
1. Contains all SQL in a single class Contiene todas las SQL en una sola clase
2. “One involves creating a helper object which exists between the domain object and a DatabaseCommand (our persistence class). "Uno de ellos implica la creación de un ayudante objeto que existe entre el objeto y el dominio de un DatabaseCommand (persistencia nuestra clase). The domain objects do not know how to generate SQL. El dominio de los objetos no saben cómo generar SQL. They simply know that there exists a class that accepts helpers. Ellos simplemente saber que existe una clase que acepta ayudantes. The helper has methods like getStoreColumns() and getStoreValues() which return the columns used for inserts and their corresponding values, respectively. El ayudante tiene como métodos getStoreColumns () y getStoreValues () que devuelven las columnas utilizadas para las inserciones y sus correspondientes valores, respectivamente. The helpers have direct knowledge of the domain object. Los ayudantes tienen un conocimiento directo del objeto de dominio. The DatabaseCommand knows how to build SQL statements filling in the missing information by asking the helpers.” El DatabaseCommand sabe cómo construir sentencias SQL llenado en la información que falta pidiendo a los asistentes. "

He has described the pros and cons of the system in his post. Ha descrito los pros y los contras del sistema en su puesto.

Couple of thoughts & suggestions: Par de reflexiones y sugerencias:
In general, approach one has the benefit that creating SQL code can be delegated to database specialists. En general, un enfoque tiene la ventaja de que la creación de código SQL puede ser delegada a la base de datos de especialistas. Also they can optimize the code in there later on (as it is all in a single big file) to eliminate bottlenecks or simply to speed things up. También se puede optimizar el código de ahí (como es todo en un solo archivo grande) para eliminar los cuellos de botella o simplemente para acelerar las cosas.
Logically though the key value is in isolating the db code. Aunque lógicamente el valor de clave es aislar el código db. Which can also be achieved by having the classes in a single package. Que también se puede lograr al tener las clases en un solo paquete.

The second approach as you can see is cumbersome and is rather maintenance heavy. El segundo enfoque, como se puede ver es engorroso y mantenimiento es bastante pesado.

The key issue is that in both cases a Object relational mapping is required. La cuestión clave es que en ambos casos, un objeto relacional cartografía es obligatorio. In a company I worked in the past they have created and maintained ( yeah I came in after the deed was done) a home-grown ORM layer. En una empresa trabajé en el pasado que han creado y mantenido (yeah vine después en la escritura se hizo) un hogar-ORM crecido capa. It was a nightmare because of the following key reasons: Se trata de una pesadilla, debido a las siguientes razones fundamentales:
1. It was hard to learn and complex to use Es difícil de aprender y de utilizar complejos
2. Complex queries were near impossible Complejo consultas fueron casi imposible
3. Easy queries were very time consuming to do, thereby affecting productivity Fácil preguntas fueron mucho tiempo a hacer, lo que afecta la productividad
4. Because of a general Object structure (we called them BoB - business object, I jokingly named the process bobification) type checking was non-existent thereby leading to hard to find bugs Debido a la estructura general del objeto (que llamó BoB - objeto de negocio, yo en broma el llamado proceso de bobification) Tipo de control era inexistente lo que conduce a difíciles de encontrar bugs
5. Debugging was royal pain Depuración Real fue el dolor

What I learned from this was that maintaining an ORM is a full-time job, specially to make it usable in a wide range of occassions and still make it easy to learn. Lo que aprendí de ello fue que el mantenimiento de un ORM es un trabajo de tiempo completo, especialmente para que sea utilizable en una amplia gama de ocasiones y todavía lo hacen fácil de aprender. We are not in the business of ORM. Nosotros no estamos en el negocio de ORM. We however need the functionaility. Nosotros sin embargo la necesidad functionaility. Why bother creating and maintaining a home-grown one? ¿Por qué molestarse creación y el mantenimiento de un hogar-un crecido? The focus should be on the core competency and surely ORM is not ours. La atención debería centrarse en el núcleo de competencias y seguramente ORM no es la nuestra. Hibernate and other ORM layers relieves you of the pains. Hibernate y otras capas ORM le alivia de los dolores. Most of them are easy to learn. La mayoría de ellos son fáciles de aprender. I presonally try to avoid ones which tries to create its own sql syntax as it means I have to learn yet another SQL clone. I presonally tratar de evitar los que intenta crear su propia sintaxis sql ya que significa que tengo que aprender otro clon SQL. Normally they also provide a QBE type interface, saw it in hibernate too. Normalmente aportan también una interfaz de tipo QBE, lo vio en hibernate. They are the easiest to use and really help in RAD. Ellos son los más fáciles de usar y realmente ayudar a RAD.

Everyone you hire will have to learn about a home grown ORM, whereas you may get lots of people who have used Hibernate or OJB. Todo el mundo usted contrata tendrá que aprender acerca de un hogar ORM crecido, mientras que puede recibir gran cantidad de personas que han usado Hibernate o OJB. Also for the developers it is a reusable skill. También para los desarrolladores es una habilidad reutilizables.

I rest my case. Yo descanso mi caso.