Discussions

News: Fast, easy and friendly ORM

  1. Fast, easy and friendly ORM (28 messages)

    Dreamsource ORM has been used in three major applications for over three years. It solves the following problems:
    1. Whatever you codes happens in database.
    2. No detached enhanced object. So it can be used with any frameworks like Spring, GWT.
    3. No lazy loading. Just eager loading because you can expect whatever you want during coding. Eager loading removes n + 1 queries.
    4. Queries can be defined through Select or Query with support of built-in Converters. Select can be constructed based on objects Table, Column, And. Column can be obtained from Table and it has a lot of methods such as greaterThan(), betweenAnd(), which can be used to define predicates. Select supports pagination control. Query can be constructed from a string SQL statement. It supports parameter binding.
    5. It provides more flexible query features than JPA 2.0. It eliminates the regeneration of a metamodel class from a annotated entity.
    6. built-in converter that can be used to convert a Java Object into a frontend String or a frontend String into a backend Java Object. The converter prevents data conversion from scattering different pages and layers.
    7. built-in validator that can be used to validate an input POJO object before it is saved or updated. The validation prevents invalid data from being persisted.
    8. Each database table needs the following objects:
      • an entity object which extends POJO.
      • a primary key object which extends TablePK if there is a composite primary key.
      • a table object which extends Table.
      • a converter which extends Converter (optional).
      • a validator which extends Validatable (optional).
      The above code can be generated using Dreamsource ORM Code Generator which is an Eclipse plugin.
    9. It provides most demanding features in a small library (522,217 bytes).
    10. Easy to learn and use because it just mirrors SQL statements.
    11. High performance compared to Hibernate.
    12. High productivity compared to Hibernate.
    You can find Spring and GWT examples from http://www.leeonsoft.com/examples.jsp. Whoever makes a serious comparison of Dreamsource ORM with Hibernate or JPA will be rewarded one license. Any feedback is appreciated. Jim Xie http://www.leeonsoft.com http://code.google.com/p/dreamsource-orm/

    Threaded Messages (28)

  2. Can it handle this?[ Go to top ]

    How well does it handle large complex models with thousands of classes and deep inheritance? I know with sql server 2000 and 2005, running a polymorphic query with more than 256 subclasses would fail. This is due to a limit in sql server. Even in the situation where the database engine supports unlimited number of tables in a select statement for polymorphic queries, it still might fail. peter
  3. No limitation[ Go to top ]

    There are no polymorphic queries. Any query represented by Object Select will be parsed into a native SQL statement that is sent to a database server for execution and the returned result set is used to populate a candidate class such as Person as indicated in the following code. ----------------------------------------------------------- Select select = new Select(Person.class, true); select.from(personTable); select.where(personTable.getLastName().startsWith("M")); select.fetchRange(5, 4); select.orderBy(personTable.getLastName(), personTable.getFirstName()); List persons2 = entityManager.list(select); ----------------------------------------------------------- Here is how object Select parsed into a native SQL statement: 1. get declared methods (including methods from its inherited methods) from class Person 2. compare the above methods with columns defined in the Table passed in Select.from() method. 3. when a property name is matched and a type is compatible in method and column, that column is added into a native SQL statement Therefore, this situation never occurs. Jim
  4. Re: No limitation[ Go to top ]

    There are no polymorphic queries. Any query represented by Object Select will be parsed into a native SQL statement that is sent to a database server for execution and the returned result set is used to populate a candidate class such as Person as indicated in the following code.

    -----------------------------------------------------------
    Select select = new Select(Person.class, true);
    select.from(personTable);
    select.where(personTable.getLastName().startsWith("M"));
    select.fetchRange(5, 4);
    select.orderBy(personTable.getLastName(), personTable.getFirstName());
    List persons2 = entityManager.list(select);

    -----------------------------------------------------------

    Here is how object Select parsed into a native SQL statement:
    1. get declared methods (including methods from its inherited methods) from class Person
    2. compare the above methods with columns defined in the Table passed in Select.from() method.
    3. when a property name is matched and a type is compatible in method and column, that column is added into a native SQL statement


    Therefore, this situation never occurs.


    Jim
    Unfortunately, that means a query for a root object with n subclasses will produce 1+n queries. How does that help or make life easier? From first-hand experience, that isn't going to scale well for large complex models and use cases. peter
  5. Re: No limitation[ Go to top ]

    There are no polymorphic queries. Any query represented by Object Select will be parsed into a native SQL statement that is sent to a database server for execution and the returned result set is used to populate a candidate class such as Person as indicated in the following code.

    -----------------------------------------------------------
    Select select = new Select(Person.class, true);
    select.from(personTable);
    select.where(personTable.getLastName().startsWith("M"));
    select.fetchRange(5, 4);
    select.orderBy(personTable.getLastName(), personTable.getFirstName());
    List persons2 = entityManager.list(select);

    -----------------------------------------------------------

    Here is how object Select parsed into a native SQL statement:
    1. get declared methods (including methods from its inherited methods) from class Person
    2. compare the above methods with columns defined in the Table passed in Select.from() method.
    3. when a property name is matched and a type is compatible in method and column, that column is added into a native SQL statement


    Therefore, this situation never occurs.


    Jim
    I'll give you an example. Say I'm building a business directory application, which defines a business ontology. I define a base class called BusinessCategory, which contains some base attributes. If I want to get all business categories using polymorphic queries, Hibernate will produce a select statement with outer joins. That will execute 1 query if I'm using table per subclass. If I'm using table per hierarchy, it's just one query and the discriminator is used to determine which subclass it maps to. An ORM that doesn't support polymorphic queries would need to execute 1+n queries to get all the Business Categories. Clearly, that won't scale well and quickly runs into issues. peter
  6. You may use the following two categories of find methods for a record as well as its related records: 1. The following four methods return the found entity instance with all of its dependencies or null if the entity does not exist. public T find(Object primaryKey, Class entityClass, List relations) public Object find(TablePK tablePK, List relations) public T find(boolean frontend, Object primaryKey, Class entityClass, List relations) public Object find(boolean frontend, TablePK tablePK, List relations) TableRelation determines what dependence is retrieved. 2. The following four methods return the found entity instance with different levels of dependencies or null if the entity does not exist. public T find(Fetch fetch, Object primaryKey, Class entityClass) public Object find(Fetch fetch, TablePK tablePK) public T find(boolean frontend, Fetch fetch, Object primaryKey, Class entityClass) public Object find(boolean frontend, Fetch fetch, TablePK tablePK) Fetch parameter determines different levels for dependencies away from the target which is retrieved. The above methods eliminate n+1 queries. Please see http://www.leeonsoft.com/query.jsp for more query examples. Jim
  7. You may use the following two categories of find methods for a record as well as its related records:

    1. The following four methods return the found entity instance with all of its dependencies or null if the entity does not exist.
    public T find(Object primaryKey, Class entityClass, List relations)
    public Object find(TablePK tablePK, List relations)
    public T find(boolean frontend, Object primaryKey, Class entityClass, List relations)
    public Object find(boolean frontend, TablePK tablePK, List relations)

    TableRelation determines what dependence is retrieved.

    2. The following four methods return the found entity instance with different levels of dependencies or null if the entity does not exist.
    public T find(Fetch fetch, Object primaryKey, Class entityClass)
    public Object find(Fetch fetch, TablePK tablePK)
    public T find(boolean frontend, Fetch fetch, Object primaryKey, Class entityClass)
    public Object find(boolean frontend, Fetch fetch, TablePK tablePK)

    Fetch parameter determines different levels for dependencies away from the target which is retrieved.

    The above methods eliminate n+1 queries.

    Please see http://www.leeonsoft.com/query.jsp for more query examples.


    Jim
    Correct me if I'm wrong, but does the ORM support polymorphic queries? If it doesn't support polymorphic queries, I have to manually write a method that queries each subclass of BusinessCategory to get a complete list of all BusinessCategory subclasses. Any ORM that does not support polymorphic queries natively results in n+1 queries. peter
  8. It doesn't support polymorphic queries. However, it supports eager loading of its dependencies using SQL left outer joins to eliminate 1+n queries. Please see http://www.leeonsoft.com/query.jsp for more examples. Jim
  9. It doesn't support polymorphic queries. However, it supports eager loading of its dependencies using SQL left outer joins to eliminate 1+n queries. Please see http://www.leeonsoft.com/query.jsp for more examples.


    Jim
    getting the references an object has (aka dependency) isn't the same thing as polymorphic queries for all subclasses in a hierarchy. I don't see how this ORM is better than other existing ORM. In fact, I would say it's deficient and lacking functionality. Also, the notion of always eager loading isn't scalable from my experience working on large complex applications. Eager loading a large object graph only works for small models with small datasets. peter
  10. Eager loading on demand[ Go to top ]

    Peter, ORM can be approached in different ways. Dreamsource ORM is different from Hibernate or JPA on some aspects. Dreamsource ORM doesn't provide polymorphic queries for all subclasses in a hierarchy. But it provides the simplest solution for ORM and boosts developer productivity and runtime performance. Let me ask this question. How many percentage of polymorphic queries is used in application? Dreamsource ORM is being used in three big applications(http://www.leeonsoft.com/case_studies.jsp). Eager loading is performed through find() method on demand. You can pass TableRelation or Fetch to find() method to specify dependencies to be loaded with retrieving entity. Jim
  11. Re: Eager loading on demand[ Go to top ]

    Peter,

    ORM can be approached in different ways. Dreamsource ORM is different from Hibernate or JPA on some aspects. Dreamsource ORM doesn't provide polymorphic queries for all subclasses in a hierarchy. But it provides the simplest solution for ORM and boosts developer productivity and runtime performance. Let me ask this question. How many percentage of polymorphic queries is used in application? Dreamsource ORM is being used in three big applications(http://www.leeonsoft.com/case_studies.jsp).

    Eager loading is performed through find() method on demand. You can pass TableRelation or Fetch to find() method to specify dependencies to be loaded with retrieving entity.

    Jim
    From my own experience, 75% of the projects I've worked on over the last 8 years. Other people's experience will vary. the reason I ask is that it forces the developer to write a ton of inefficient queries to get data. Most of what I do day-to-day is enterprise software with large models, so I rarely deal with small object models. Small to me is over 200 entities and large is over 1000. Really large is over 5000 entities. In the health insurance industry, it's not uncommon to have models with thousands of entities in the object model. I agree there's all sorts of ORM. I've used iBatis, Hibernate, NHibernate, IBM Metadata server and written my own over the years, so it's not like one single solution fits all use cases. There's plenty of weaknesses in hibernate. For example, a complex model with bi-directional references often causes NHibernate and Hibernate to join the entire object graph with left outer joins. iBatis also has weaknesses, so it's really dependent on the use case a developer needs to support. peter
  12. Dreamsource ORM uses object Table to wrap a database table metadata and Column a database table column. So they can programatically and concisely be used to construct a dynamic query SQL. That is the first different approach from Hibernate, JPA, Ibatis because they uses annotation or XML. Annotation or XML can not be used in coding (IDE). In JPA 2.0, the following process happens if I am right: annotation -> metamodel classes(CGLIB is used to generate these classes and they are cached) -> QueryBuilder when developers want to construct Strongly-typed Queries. In order to get this feature, you have to remember many API methods and many classes are generated in runtime. In Dreamsource ORM, you can get Columns from Table to build simple and dynamic queries using object Select. If you need a very complex query, you are free to use a native SQL string with the help of object Query which is similar to IBatis. Select and Query can use converters that are included in Dreamsource ORM. Dreamsource ORM has built-in converter and validator. With the converter, the data conversion between front end (web) and backend (database) is performed automatically. You just code a converter in one place in Java and don't worry format across many tiers, which is the second different approach. The built-in validator is simple and easy to use compared to JSR 303. Entity extends POJO and can have different states from web to database or vice versa. The states can tell EntityManager what can be done next, which is the third different approach. Dreamsource ORM just provides a limit set of APIs compared to Hibernate or JPA. It can boost your productivity and improve the runtime performance of application dramatically. Hibernate or JPA leans towards object. Dreamsource ORM tries to find a balance between object and relational database. Jim
  13. Dreamsource ORM uses object Table to wrap a database table metadata and Column a database table column. So they can programatically and concisely be used to construct a dynamic query SQL.
    Doesn't this also mean that the system is doing very little, if any, actual mapping?
    Annotation or XML can not be used in coding (IDE).
    Annotations are coded metadata, and hence rather well supported by any Java 1.5+ IDE, because they can be programmatically accessed, validated and used.
    You just code a converter in one place in Java and don't worry format across many tiers, which is the second
    But one of major REASONS for ORM is to NOT HAVE TO write such boilerplate monkey code as converters! If I want to write code to convert things, I can do without this library altogether. Constructing SQL strings from trivial columns, tables etc definition is, well, trivial.
    The built-in validator is simple and easy to use compared to JSR 303.
    Have you actually tried using JSR-303? It is rather simple. And unlike built-in validator of any kind, it does not cause vendor lock-in: those validators are good at any tier, with different ORMs and so on. Your validator is only good with your library, for the specific use case, at data access layer. In fact, this all really sounds quite a bit like iBatis, but with little bit of NIH syndrome. It's ok to DIY, but at least it would be good to understand what and how others have tackled the same problem. Also, it is hard to really see main positive differentiating factor: "but I wrote it" isn't one, nor "no, ours doesn't do X, since that's not needed and is a bad thing to do anyway". Apologies for rant but from descriptions it is very hard to see what the actual value is; or that authors fully understood what competition is doing.
  14. ORM is CRUD[ Go to top ]

    From ORM, developer can use objects to build CRUD. each ORM must provide these functions. You can find an example from http://www.leeonsoft.com/downloads/jpetstore.jar which was modified from IBATIS. Please compare the source code with original IBATIS code before you make conclusion. Also you can find documentation from http://www.leeonsoft.com/documentation.jsp. There are fundamental difference between Dreamsource ORM and IBATIS in the following fields:
    1. Architecture
    2. mapping (Table/Column approach or XML approach)
    3. persistent class(POJO)
    4. converter
    5. validator
    6. Select or Query
    7. How to handle streaming data
    8. state of POJO
    Dreamsource ORM tackle CRUD in different way from IBATIS. How developers code in application is also different in Dreasmource ORM and IBATIS. I think the difference between them is bigger than one between Java and .Net. The only similarity between them is of great runtime performance. In Eclipse, I type . after a variable whose class has many annotations and wait them appearing. I am going back to check if annotations appears after . after I reply this message. Using annotation or XML to do mapping is not a good approach. In JPA 2, you have to reconstruct QueryBuilder from metadata classes which reside in memory and are not accessible to developer directly. Dreamsource ORM supports automatic data conversion from web to database or vice versa with help of converter which is optional. Dreamsource Eclipse generates one validator for each database table. You can use JSR-303 in the validator. You can delete it if you don't want to use it because it is optional. Please go to http://code.google.com/p/dreamsource-orm/downloads/list to download the Eclipse plugin and generate ORM code for small application in 10 minutes. You may understand the value of this ORM. I know you are experts of IBATIS, Hibernate and JPA and love to use them. But this ORM is different. Jim
  15. Re: ORM is CRUD[ Go to top ]

    From ORM, developer can use objects to build CRUD. each ORM must provide these functions. You can find an example from http://www.leeonsoft.com/downloads/jpetstore.jar which was modified from IBATIS. Please compare the source code with original IBATIS code before you make conclusion. Also you can find documentation from http://www.leeonsoft.com/documentation.jsp.

    There are fundamental difference between Dreamsource ORM and IBATIS in the following fields:
    1. Architecture
    2. mapping (Table/Column approach or XML approach)
    3. persistent class(POJO)
    4. converter
    5. validator
    6. Select or Query
    7. How to handle streaming data
    8. state of POJO


    Dreamsource ORM tackle CRUD in different way from IBATIS. How developers code in application is also different in Dreasmource ORM and IBATIS. I think the difference between them is bigger than one between Java and .Net. The only similarity between them is of great runtime performance.

    In Eclipse, I type . after a variable whose class has many annotations and wait them appearing. I am going back to check if annotations appears after . after I reply this message. Using annotation or XML to do mapping is not a good approach. In JPA 2, you have to reconstruct QueryBuilder from metadata classes which reside in memory and are not accessible to developer directly.

    Dreamsource ORM supports automatic data conversion from web to database or vice versa with help of converter which is optional.

    Dreamsource Eclipse generates one validator for each database table. You can use JSR-303 in the validator. You can delete it if you don't want to use it because it is optional.

    Please go to http://code.google.com/p/dreamsource-orm/downloads/list to download the Eclipse plugin and generate ORM code for small application in 10 minutes. You may understand the value of this ORM. I know you are experts of IBATIS, Hibernate and JPA and love to use them. But this ORM is different.

    Jim
    Honestly, the approach is old. I know that I've used similar approach going back to 1999 and it was old back then. It's good that you wrote an ORM and open sourced it, but the idea is old. I've also seen recent commercial products store metadata in the database and use that to generate queries. As far as I know, this type of approach dates back to mid/late 90's. It probably dates back even further, but I don't know of any first hand. In my mind, there's no point comparing Dreamsource ORM to Hibernate, since they use two completely different styles of development. Comparing Hibernate to Toplink or JPA makes sense to me. Comparing Dreamsource to Hibernate makes no sense at all. peter
  16. Cat can catch mice[ Go to top ]

    It doesn't matter whether the cat is black or white, as long as it can catch mice. Jim
  17. ORM != CRUD[ Go to top ]

    Jim, there is more to object orientation than simply mapping data intefaces. The idea of OO is to encapsulate rich business behaviour, not just CRUD. This is where Hibernate (and JPA) clearly wins out - not only are you mapping your data to the database, but your objects can (and ideally should) have rich business behaviour associated with them. Although I appreciate this work, it is not ORM in any sense - this is simply a mapping from one data semantic (JDBC) to another (anemic POJO's - Do a search on Martin Fowler's article on "Anemic Domain" if you don't understand why its called anemic). A proper ORM can perhaps be built on top of this - maybe that is an area you want to look to for future work?
  18. Anemic Domain[ Go to top ]

    I am pondering this question for a couple of days. I got to answer it.
    The idea of OO is to encapsulate rich business behaviour, not just CRUD. This is where Hibernate (and JPA) clearly wins out - not only are you mapping your data to the database, but your objects can (and ideally should) have rich business behaviour associated with them.
    I exampled two outsourced Hibernate projects in my client. I also checked "Hibernate in Action" (first edition). I also run MyEclipse to generate mapping code for Hibernate and JPA. I don't see any business behaviour code that is generated with POJO. Dreamsource ORM provides a parent class(POJO) for a mapping Plain Old Java Object for each database table. The POJO describes the behaviour from web tier to backend tier or vice versa(http://www.leeonsoft.com/persistentClass.jsp). Therefore, Hibernate mapping domain objects are "Anemic" based on that logic. Business behaviour must be coded by developers and embeded into code. If business behaviour of each POJO is supported by Hibernate and JPA, I am pretty sure, Hibernate and JPA don't work because business behaviour of each POJO differs. In the above Hibernate projects, Hibernate is used for save, update, delete and complex query is still coded in regular JDBC. If you check Hiberanate for Scalar results(http://docs.jboss.org/hibernate/stable/core/reference/en/html/objectstate-querying.html#objectstate-querying-executing-scalar), what do you think? You have to pass a correct string so Eclipse can not help you. That is why JPA 2.0 comes in. Please download JPA 2.0 specification from http://jcp.org/en/jsr/detail?id=317. How big is it? How many API methods do you know before you can construct a dynamic query. In JPA 2.0, save, update, delete and query used the metamodel classes generated from Annotation, Constructing a dynamic query uses other classes that are rebuilt from previous metamodel classes that are located in memory. Dreamsource ORM just use the pregenerated Table and Column for save, update, delete and query. Dreamsource ORM allows you to use the simplest API for save, update, delete and query. Hibernate is very complex with a rich set of features. How many hours do you need to become Hibernate and JPA experts. Dreamsource ORM allow most of tasks simple. In Apache Wicket, you are recommended to use OSIV pattern if you want to use Hibernate. What is a result? You need more database license because a database connection is not closed during a rendering phase. Dreamsource ORM provides you with high productivity and high runtime performance. It can reduce your cost at least by using less database license fees. Use Dreamsource ORM in your product and let your rivals use Hibernate. You can embed Dreamsource ORM into your product. I think Hibernate or JPA is good. But Dreamsource ORM is simple. Jim
  19. Re: Anemic Domain[ Go to top ]

    I am pondering this question for a couple of days. I got to answer it.


    The idea of OO is to encapsulate rich business behaviour, not just CRUD. This is where Hibernate (and JPA) clearly wins out - not only are you mapping your data to the database, but your objects can (and ideally should) have rich business behaviour associated with them.


    I exampled two outsourced Hibernate projects in my client. I also checked "Hibernate in Action" (first edition). I also run MyEclipse to generate mapping code for Hibernate and JPA. I don't see any business behaviour code that is generated with POJO. Dreamsource ORM provides a parent class(POJO) for a mapping Plain Old Java Object for each database table. The POJO describes the behaviour from web tier to backend tier or vice versa(http://www.leeonsoft.com/persistentClass.jsp). Therefore, Hibernate mapping domain objects are "Anemic" based on that logic. Business behaviour must be coded by developers and embeded into code. If business behaviour of each POJO is supported by Hibernate and JPA, I am pretty sure, Hibernate and JPA don't work because business behaviour of each POJO differs. In the above Hibernate projects, Hibernate is used for save, update, delete and complex query is still coded in regular JDBC. If you check Hiberanate for Scalar results(http://docs.jboss.org/hibernate/stable/core/reference/en/html/objectstate-querying.html#objectstate-querying-executing-scalar), what do you think? You have to pass a correct string so Eclipse can not help you. That is why JPA 2.0 comes in. Please download JPA 2.0 specification from http://jcp.org/en/jsr/detail?id=317. How big is it? How many API methods do you know before you can construct a dynamic query. In JPA 2.0, save, update, delete and query used the metamodel classes generated from Annotation, Constructing a dynamic query uses other classes that are rebuilt from previous metamodel classes that are located in memory. Dreamsource ORM just use the pregenerated Table and Column for save, update, delete and query. Dreamsource ORM allows you to use the simplest API for save, update, delete and query.

    Hibernate is very complex with a rich set of features. How many hours do you need to become Hibernate and JPA experts. Dreamsource ORM allow most of tasks simple.

    In Apache Wicket, you are recommended to use OSIV pattern if you want to use Hibernate. What is a result? You need more database license because a database connection is not closed during a rendering phase.

    Dreamsource ORM provides you with high productivity and high runtime performance. It can reduce your cost at least by using less database license fees. Use Dreamsource ORM in your product and let your rivals use Hibernate. You can embed Dreamsource ORM into your product.

    I think Hibernate or JPA is good. But Dreamsource ORM is simple.

    Jim
    Doesn't that depend on the use case and model? If I'm working in health insurance and the object model has 1000+ entities, Dreamsource isn't going to be a good fit. On the other hand, if I have a dozen or so classes just about any ORM will work. Becoming an expert in ORM technology does take a lot of time. Honestly, most people out there using ORM aren't experts. I would argue you don't need to be an expert at ORM technology and theory to be productive. That includes JPA, Hibernate, NHibernate, Toplink, etc. I used to work at IBM Ascential, which took ORM to an extreme with model driven development. Even with 8 years of experience using and working on ORM, there's still a lot to learn. Being an expert shouldn't be the issue. Very few people are really experts in ORM. peter
  20. Re: Anemic Domain[ Go to top ]

    I have to admit that Dreamsource ORM is being used in the applications of less than 1000 entities of domain models. One application was developed first using Hibernate. Performance issue was founded shortly after it was promoted to a user accept test, which is descriped in http://www.leeonsoft.com/performance.jsp. Users requested switch to Dreamsource ORM for the application database tier and gave it a try. Users always supect new come and didn't try it first. Users was happy with the performance of Dreamsource ORM. You can see the documentation at http://www.dcf.state.fl.us/mentalhealth/publications/samharch.doc. If you want to try Dreamsource ORM in your new application, I can offer you whatever I can. Jim
  21. Re: Anemic Domain[ Go to top ]

    I have to admit that Dreamsource ORM is being used in the applications of less than 1000 entities of domain models. One application was developed first using Hibernate. Performance issue was founded shortly after it was promoted to a user accept test, which is descriped in http://www.leeonsoft.com/performance.jsp. Users requested switch to Dreamsource ORM for the application database tier and gave it a try. Users always supect new come and didn't try it first. Users was happy with the performance of Dreamsource ORM. You can see the documentation at http://www.dcf.state.fl.us/mentalhealth/publications/samharch.doc.

    If you want to try Dreamsource ORM in your new application, I can offer you whatever I can.

    Jim
    The performance numbers you cite are misleading and don't tell the whole picture. I'm currently using NHibernate to do large scale ETL with hundreds of thousands of rows of data with very complex ETL. On top of that we have heavy multi-dimensional versioning requirements. We had to build a lot of functionality on top of NHibernate. Even if we were to use Hibernate + Envers, it wouldn't be sufficient to handle the multi-dimensional temporal versioning. You don't cite the exact cases where Hibernate or NHibernate fall short, so the argument is not compelling. When I worked at IBM Ascential, the ORM we built provided API for online transactions and batch processes. The system was architected to support large models with thousands of entities. The reason I asked about polymorphic queries is this. If you try to run a polymorphic query with hundreds of left outer joins, many RDBMS will choke and not compile the query. Many ORM products do not address this issue today. NHibernate and Hibernate have a nasty habit of generating huge multi-page left outer joins when a user tries to navigate a bi-directional reference. I could go on and on, but I'll stop there. If you want others to take your product seriously, it's your responsibility to do a thorough comparison. You said in the announcement "Whoever makes a serious comparison of Dreamsource ORM with Hibernate or JPA will be rewarded one license." Offering a free license could be considered an insult to many developers. It takes years to gain the necessary experience and expertise to do a thorough and complete evaluation. peter
  22. Anemic Domain[ Go to top ]

    Of course Hibernate does not "generate" your business behaviour - that is what a coder does! The only place where you can specify your behaviour is in your code - the behaviour does not exist in your database (in relational world, at least), so how can a tool generate that for you? But the question is - where do you put that code? With Hibernate, I can put that code in my domain (where it should be in order to call it object oriented). With the anemic domain, you have to put that code in another layer (typically called a "service layer" or a "controller" as per MVC). Although I may be wrong, it seems as if DreamSource forces you to put this code in a service layer (please correct me if I'm wrong!). Please see http://martinfowler.com/bliki/AnemicDomainModel.html I am looking at your pet clinic example - unfortunately, this example does not expose any behaviour beyond simple CRUD that I can find. Let's say I want to add a business rule to this pet clinic - for example, I want to check that the visit date of a pet is not before the birthdate of the pet? Where would I put that business logic? Can I put it in the Visit's constructor method (it only has a public no-arg constructor, so I presume not)? Or do I have to write a separate "service" class to do this? What if, whenever there is a new visit, I also want to create an audit record of this visit? Would this have to be done via a seperate "object" called VisitAudit and implemented using some "VisitController"? In object oriented world, this could all be done in the Visit's constructor.
  23. Re: Anemic Domain[ Go to top ]

    First I sincerely apologize for some sentence I used in this thread. I realized it is time-consuming to make comparison of products. I appreciate your feedbacks. Peter inspires me to test Dreamsource ORM in the environment of more than 1000 entities of domain models although Dreamsource ORM doesn't have polymorphic queries. Dreamsource ORM does have the feature of object graph query. I am creating a dummy database with more than 2000 tables to test Dreamource ORM. I am going to create a Eclipse project to let you download it and test Dreamsource ORM features so you can save your time to evaluate it. For Francois, After you posted your first message about Anemic Domain, I took look at this issue. Domain model of Dreamsource ORM is not different from Hibernate one. It is not anemic domain. You can do the same as Hibernate domain models. As for PetClinic example. I cite the original statement from http://www.leeonsoft.com/petclinic.jsp: The PetClinic sample application is modified from the distributed sample by Spring Framework. The following changes have been made:
    1. applicationContext-jdbc.xml. The com.leeonsoft.jdbc.EntityManager is used for database access and org.springframework.jdbc.datasource.DataSourceTransactionManager is used for transaction. petclinic-servlet.xml.
    2. org.springframework.samples.petclinic.web.ClinicBindingInitializer is not used because Dreamsource ORM provides one Converter for each database table and the com.leeonsoft.jdbc.EntityManager retrieves a front end object that is bound to a presentation layer.
    3. Dreamsource ORM replaces the original JDBC code.
    4. Each database table has its own Validation that replaces the original validation code that is located in utility class.
    If you want, you can put domain business behaviors such as check that the visit date of a pet is not before the birthdate of the pet in its validator class so domain model can be used as domain model and DTO so it can be used in any service layers. Once domain model is going througn persistence, its business behavior is enforced by its validator class automatically by Dreamsource EntityManager. This kind of design allows Dreamsource to be used in typical n-tier applications and GWT applications. Jim
  24. Not a ORM[ Go to top ]

    Well, I guess this is not really a ORM. There is no real mapping involved here. It looks like you give each table a simple presentation as a class and each object maps to one row in this specific table. Still useful for some stuff, though.
  25. Re: Fast, easy and friendly ORM[ Go to top ]

    No lazy loading. Just eager loading
    No lazy loading ... at all ? So you do a find on an object and you get ... the object graph ? Really ?
  26. Re: Fast, easy and friendly ORM[ Go to top ]

    Guys, appreciate your hard work... but did you look around hard enough before you started this project? For example there is a great project iBatis (http://ibatis.apache.org) that has SQL like statements and pojo mapping. Also EJB3.JPA is a standard persistence framework... do you plan to support it (like Hibernate for example)? (btw, it also has SQL like intuitive queries)
  27. Not another ORM...[ Go to top ]

    I agree, it looks like iBATIS to me. And iBATIS is in production for years at my company for concurrent loads of transactions.
  28. w/ Hibernate. Have you compared it w/ Cayenne? From a productivity standpoint I've found nothing better (in open source). W/ so many well established ORM's you'll need to provide a compelling reason to switch w/ such a late entry into the market ... and I don't see it ... at this point.
  29. Java ORM[ Go to top ]

    In Java world, we have many choices so it is a challenge to make Dreamsource ORM to stand out. If you can take 10 minutes to download http://dreamsource-orm.googlecode.com/files/com.leeonsoft.dreamsource_1.0.0.jar(Eclipse plugin) and generate mapping codes, use these codes in your sample, you can see the difference. The jpetstore example based on IBATIS is replaced with Dreamsource ORM for a database tier. You can download its source code from http://www.leeonsoft.com/downloads/jpetstore.jar. Also you can find some examples in http://www.leeonsoft.com/documentation.jsp. Jim