[elephant-devel] Re: Re: Re: sqite3 - always increase database size
Robert L. Read
read at robertlread.net
Thu Apr 10 00:13:48 UTC 2008
On Wed, 2008-04-09 at 13:36 -0400, Aaron Feng wrote:
> I have learned a good deal about elephant so far, but I'm still unsure
> on how to design my schema with elephant, so I'll post what I have
> later on today. All suggestions are welcome!
This may seem silly and you may be beyond it, but the first thing you
should do is just design a good object-oriented system without worrying
about persistence at all.
That is, model your domain in a natural way with CLOS classes, in a way
that you think will support your purpose.
In "Enterprise" applications this is usually expressed in language of
"define your business objects" and "keep your business rules clearly
defined. That language makes sense for commercial websites; it isn't
natural for every application.
Then make a clear distinction between objects that you want to persist,
and those that don't need to be persisted. For example, a "session" is
often a transient object that doesn't need to be persisted.
Then take the persistent classes and switch from "defclass" to
"defpclass".
Then use "mapclass" as your workhorse function for doing things to those
classes.
When you notice something being too slow, think about adding an index to
a slot to make it's retrieval rapid by looking up the persistent object
based on that slot value.
More information about the elephant-devel
mailing list