Re: Persistence
- From: "Alvin Ryder" <alvin321@xxxxxxxxxxx>
- Date: 13 Jul 2006 02:39:50 -0700
frebe73@xxxxxxxxx wrote:
I use "persistence" to signify saving and loading of otherwise memory
bound objects to permanent storage thereby allowing them to live longer
than the OO program.
A SQL database is obviously not the right tool for doing that.
I agree /sometimes/ a RDBMS is not a good choice for object storage but
often it /can/ be used. It costs some mucking around in the OO/RM
mapping department but it buys you the ability to draw on the strengths
of two highly useful technologies instead of just one. I don't see OOP
and the RM as exclusive.
If I get you right, when you talk about persistence, you don't talk
about transactions, consistency or queries. If you have such features
in your application, you use other tools or implements it by yourself?
Persistence is strictly about object IO. That doesn't mean I'd
implement the other stuff myself though.
It is object storage from an OOP perspective. There is also
serialization, which isn't just another buzzword for the sake of it, it
refers to a different kind of object IO.
A tool using object serialization would be better suited for
persistence than a SQL database, wouldn't it?
There is no universally best choice it depends on many factors. Java's
serialization is clunky when it comes to versions. Serialization to XML
has its own characteristics.
2. A SQL database provide many other features but persistence, but the
persistence feature is the only thing that should be used.
The relational model (RM) and RDBMS have strengths and features of
their own, which should not be overlooked.
Many features other than persistences features, or many persistence
features?
I meant the RM is built on solid foundations, not only predicate logic
and set theory but simplicity, data and logical independence and the
information principle just to mention a few. In addition RDBMS provide
concurrency, integrity management, security and lo and behold disk
storage ...
3. A SQL database does only provide persistence features.
I think the opposite, I think the RM has next to no support for object
persistence.
Indeed. The relational model has nothing to do with object persistence.
A SQL database is a very bad tool for persisting objects.
I don't know if its very bad but there can be issues as there are with
every approach I know of.
The relational model was designed to work with any Turing complete
language, I don't see why an OOL can't be used.
The relational model represents data in one and only one way, as a set
of tuples in relations where each tuple contains a set of attributes.
There is no direct support of object storage and subsequent
instantiation of objects from disk storage.
The relational model has nothing to do with disk storage.
I think the phrase "nothing to do with disk storage" is too strong. The
relational model was always meant to yield an alternative to the
prevailing data storage technologies of the time.
Codd's early papers like "A Relational Model of Data for Large Shared
Data Banks" make that abundantly clear. If "data banks" aren't what we
call databases stored on disk then what are they?
I agree the RM doesn't prescribe details about storage formats or
layouts but don't you agree storage is fully expected, it is not some
coincidental byproduct.
That's why some people have
trouble mapping from OOP to the RM. I suppose if they understood both
technologies better they'd have less trouble because there are
relatively easy ways to do it.
If we understood the relational model and SQL databases, we would not
use it for persistence. The persistence feature is just one of many and
in many cases, we would probably want to use a SQL database even if
persistence isn't a requirement.
I agree RDBMs are very useful not merely for storing data or objects.
Fredrik Bertilsson
http://frebe.php0h.com
Cheers.
.
- Follow-Ups:
- Re: Persistence
- From: frebe73
- Re: Persistence
- References:
- Persistence
- From: frebe73
- Re: Persistence
- From: Alvin Ryder
- Re: Persistence
- From: frebe73
- Persistence
- Prev by Date: Re: Overwhelmed by choices of Design Patterns
- Next by Date: Re: Persistence
- Previous by thread: Re: Persistence
- Next by thread: Re: Persistence
- Index(es):
Relevant Pages
|
Loading