T
Tim Bates
Hi all,
I am writing an application whose main purpose is data storage (it's a
computerised log book). It stores its data as yaml. I need some way of
keeping a collection of objects that are "sanctioned" (in the log book)
so I can search them, calculate statistics on them, write them to disk
and so on. I've done some hunting around for a pattern which fits this,
and I can't see one that fits my problem (which would seem to be a
fairly common one). I don't want to just search ObjectSpace, because
that would turn up half-formed not-yet-"sanctioned" objects. Can anyone
suggest one or more possible ways I might approach such a problem? The
obvious way seems to be to create an XyzStore class (probably inheriting
from a builtin data structure) which carries extra methods to do
whatever aggregate calculations I want, but I do wonder if there's a
better solution that I am missing, not being terribly versed in
programming patterns.
Tim.
I am writing an application whose main purpose is data storage (it's a
computerised log book). It stores its data as yaml. I need some way of
keeping a collection of objects that are "sanctioned" (in the log book)
so I can search them, calculate statistics on them, write them to disk
and so on. I've done some hunting around for a pattern which fits this,
and I can't see one that fits my problem (which would seem to be a
fairly common one). I don't want to just search ObjectSpace, because
that would turn up half-formed not-yet-"sanctioned" objects. Can anyone
suggest one or more possible ways I might approach such a problem? The
obvious way seems to be to create an XyzStore class (probably inheriting
from a builtin data structure) which carries extra methods to do
whatever aggregate calculations I want, but I do wonder if there's a
better solution that I am missing, not being terribly versed in
programming patterns.
Tim.