Version 4 (modified by fmguler, 14 years ago) (diff) |
---|
Project Overview
fmgVen is an alternative to heavyweight ORM tools, where mapping is problematic, and having problems because of lazy loading, etc. It maps database to java domain objects without mapping. Data access must be simple and lightweight. The points of fmgVen are;
- You should know SQL, ORM tool should not aim to abstract out SQL knowledge
- You need performance out of the box, without having to tweak anything
- You should not have to tweak anything at all
- You need simplicity
- You need lightweightness
- You need convention over configuration
- Mapping to domain object is hard in custom queries
- ORM is good for CRUD but not for complex reports
- Criteria API should not belong to DAO layer, instead it should be first class citizen (like LINQ)
- Criteria API should be type safe, even in Java 1.4 (without annotation support)
- There are still people using Java 1.4
Motivation
I strongly dislike Hibernate (since Hibernate hates Spring). Instead, I mostly prefer to use Spring JDBC Template. However, with JDBC template, if you need to map resulting list to nested objects, you have a problem. I ended up writing similar private mapping methods which maps resultset to nested objects. The queries were similar, too. If there is a way to do these mappings automatically and generate queries automatically, why should I do them by hand? There was fmgVen, the initial version at 2006. It was very nice, still used in some projects. But I moved on to other projects, and abandoned it. It had some limitations such that it required Java 1.5 and could not do many to many mappings, and do not work on Oracle. My new projects didn't had complex db acccess, so I sticked with Spring JDBC Template.
Until now! I realize that fmgVen is good enough not to be abandoned, and I decided to give it another shot. Current motivation is to make it a production ready tool which can be used in new projects.
Literature Review
In the second pass (2010) I did a thorough literature review, in order not to reinvent the wheel, and to gain vision. I searched for similar tools, similar attempts and where would fmgVen stand within those. Here are the similar attempts;
- Ebean: The closest one to fmgVen. They even have auto-fetch feature which I thought to implement in 2006! Ebean userguide is here. Why fmgVen;
- fmgVen is aimed to be simpler, having more powerful and type-safe criteria API. Support java 1.4 and convention-over-configuration mapping.
- JPA: The mostly used ORM solution, hibernate and the like. And their typesafe alternatives;
- Liquidform: LINQ inspired, typesafe alternative to JPA. Performs some tricks to make it.
- Querydsl: Typesafe queries for JPA.
- Quaere: SQL to Java apps. (Linq like)
- Empiredb: Similar motivations but different approach. Not CoC.
- LINQ: A very good attempt by MS. Linq to sql would be what we need, but still not CoC.
- Spring BeanPropertyRowMapper: Similar mapping approach, but that's it, no criteria to joins.