问题
I don't know if this is the right title for this question. Anyway, recently I have heard about that you could make life easier when creating database. By in which you use object based database. It will make migration to other type of database also easier e.g. from MySQL to SQLlite or something else.
Anyway the main way I do a webpage with database access now is that I manually write down the Query to fetch what I need from a database. However it can be done in some other way also which does not involve I have to write query. I want to know how this other method work. How to search it in Google.
回答1:
Object DB
- High performance
- Faster as no joins required
- Inherent versioning mechanism
- Navigational interface for operations (like graph traversal)
- Object Query Language retrieve objects declaratively
- complex data types
- object identity ie. equals() in which object identity is independent of value and updates
- facilitates object sharing
- classes and hierarchies (inheritance and encapsulation)
- support for relationships
- integrated with a persistence language like ODL
- support for atomicity
- support for nested relationships
- semantic modelling
Cons
- No mathematical foundation as RDB (refer Codd)
- cons of object orientation
- persistence difficult for complex structures, some data must be transient
Object-Relational databases (You might have seen UDTs!)
- support for complex data types like collection, multisets etc
- object oriented data modelling
- extended SQL and rich types
- support for UDT inhertance
- powerful query language
Different approaches (OO, Relational DB or OODB) may be necessary for different applications
References
OODMS manifesto
ODMG
The Object-Oriented Database System Manifesto
Object Oriented Database Systems
Object Relational Databases in DBMS
Completeness Criteria for Object-Relational Database Systems
Comparisons
http://en.wikipedia.org/wiki/Comparison_of_object_database_management_systems
http://en.wikipedia.org/wiki/Comparison_of_object-relational_database_management_systems
回答2:
It sounds like you are talking about JPA. You simply annotate your objects, and the database is setup according to the objects for you. The most used JPA implementation is Hibernate, and is very quick way of writing database enabled Java applications.
If you want more control over the database structure, you can do that via the annotations.
For more information on hibernate, check out http://www.hibernate.org/.
回答3:
If you are using an object oriented database, you are not using a relational database like MySQL or SQLite.
Instead, the database directly stores your application objects, and you usually can query these with some query language or API.
I have only experience with db4o, there you simply do
database.store(object);
and your object is stored.
来源:https://stackoverflow.com/questions/5368318/object-oriented-database