A
PersistenceLayer connecting objects in an object-oriented system to data stored in a relational database. Most commonly, an SQL database is used (though strictly speaking, SQL does not implement the
RelationalModel -- see
SqlFlaws and
RelationalLanguage for more details).
- Doesn't all the work required in implementing ORM violate OnceAndOnlyOnce? I never understood why OO languages fear instead of incorporate a database
Using an
ObjectRelationalMapping (ORM) allows one to cleanly apply object-oriented design, analysis, and programming techniques while hiding the specifics of dealing with the relational system.
There are commercial and
OpenSource ORMs that comply to the ODMG and JDO standard APIs for object persistence. Programming against such a mapping is not different from programming against an
ObjectOrientedDatabase.
Using such a ORM may be a good compromise between OO designers/architects insisting on pure object orientation without any data knowledge, and DBAs/managers emphasizing the shortcomings of OODBMSs.
--
ThomasMahler
A
PrevalenceLayer is another option to forget database hassle.
See also the following:
Implementations:
Would be nice to separate these by language...
Java Skyline Database page
http://www.javaskyline.com/database.html
Lists over 50 Object-SQL Mapping Tools,
- The scope of each tool
- A list of other Java database resources and
- A list of other object-SQL tool lists, including the:
ObjectRelationalMappingExperiences using these products (or your own) could also offer some insight.
ObjectRelationalToolComparison contains an extensive comparison of popular O/R tools.
- ObjectRelationalBridge (OJB):
- OpenSource project providing ODMG and JDO compliant APIs. http://db.apache.org/ojb/
- FireStorm/DAO:
- generates DataAccessObjects (DAOs) directly from database schemas.
SQL Orm:: Simple low level SQL-based ORM with easy refactoring possibilities http://sqlorm.sourceforge.net/database_refactoring_made_easy.html
- TopLink:
- ObjectRelationalMapping product for Java on web servers. (SmalltalkLanguage too?)
- EnterpriseObjectsFramework (EOF):
- The framework used in WebObjects, from AppleComputer (now pure Java in WebObjectsFive). Documentation can be found at http://developer.apple.com/techpubs/webobjects/webobjects.html
http://www.SimpleORM.org A very Simple, light weight ORM. No generation, byte code post processing or even an XML file to configure. But fast and effective.
- http://www.sce-tech.com/research/persistence.html
- Persistence technology including 'active' relationships and path expressions. Originally conceived from the EOF vision.
- CastorFramework:
- The OpenSource framework which uses CastorJDO to convert java objects to SQL or XML data.
- AtgRepositoryFramework?:
- The framework used in AtgDynamo, from Art Technology Group. Handles Java, XML, LDAP, SQL, sub classes of items (i.e. you can have a RepositoryItem? representing Person and subclass that with more information to make a Manager), instance inheritance (doing sort of the same thing, but dynamically), and property derivation (get the name from the subclass if it exists, otherwise get it from the superclass).
- CayenneFramework:
- The OpenSource framework and GUI tool that provides functionality similar to EnterpriseObjectsFramework.
- JaxorFramework:
- Generates persistence layer as well as objects based upon xml metadata.
- JdoGenie:
- Fast JDO implementation for JDBC databases.
- ProductivityEnvironmentForJava:
- JDO implementation for JDBC RelationalDatabase systems.
- ClassDbi:
- OpenSource Perl object to database mapping layer.
- HiberNate:
- OpenSource Java http://hibernate.sourceforge.net
- ActiveRecord:
- OpenSource Ruby framework http://activerecord.rubyonrails.org/show/HomePage
- SQLObject:
- OpenSource Python framework http://sqlobject.org/
- EZPDO:
- OpenSource ORM Framework for PHP5 http://www.ezpdo.net
- Picasso:
- OpenSource .NET http://picasso.codeplex.com
- Gentle.NET:
- OpenSource framework for .NET written in C# based on ScottAmbler's papers. Supports PostgreSQL, MySQL, MS SQL Server and SQLite. http://freshmeat.net/projects/gentle (see http://www.mertner.com/projects/gentle for a tutorial).
- Genome:
- O/R Mapper for .NET and SQL Server/Oracle (more information and eval download: http://www.genom-e.com); free community license
- AtomsFramework:
- OpenSource framework for VB6 and .NET at http://jcframework.sourceforge.net
ChrisDate and
HughDarwen have much to say on this in
TheThirdManifesto,
ISBN 0-201-70928-7
--
ChanningWalton
Any opinions on the
JavaLayeredFrameworks approach outlined by
ToddLauinger? Has anyone tried something like this? --
BernardFarrell
Class structures don't map properly to relations. This is due to what Date calls the
FirstGreatBlunder, that is, mapping objects or classes to SQL tables, instead of to user-defined data types.
A sequence, as might be implemented by linked list, must be represented either by precedence (as in CREATE TABLE sequence (father INTEGER, child INTEGER);) or by a specific type... unfortunately SQL doesn't support user-defined types. Also one can have a "Sequence
Order" attribute that is a real number or integer. But linked lists are not an OO concept. Often times a time-stamp or auto-generated ID's can be used if it is to capture a temporal sequence.