Martin Walch | 15 Apr 2006 16:08
Picon

something like an Index?

Hello,

I'm new to ozone and also rather new to databases in general.
For my current project some kind of OODBMS seems to be a good choice.
However, beside some rather complex structures, I've got also long lists
of Objects of the same class.
Concretely: I have got a list of persons with names, addresses, ids and so on.
I need to find somebody in this list either by name or by id. Both options must work fast.
So in a RDBMS like e. g. MySQL I would probably create an index for names and one for ids.
Well, this is no RDBMS.

How can I implement this in Ozone?
_______________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
Jimmy Stiefel | 25 Apr 2006 12:13
Favicon

Re: something like an Index?

You build your own indexes in Ozone any way you want.  

In your example, I'd recommend something along the lines of a TreeMap
inside an Ozone object so it is persistent.  Make Person extend
OzoneRemote so it is a first class persistent object.  Define Index that
extends OzoneObject, and wraps a TreeMap in its impl.  Create two Index
in the database & name them,  one to map id -> Person "id_index", one to
map name -> Person "name_index".  Write a little code to keep them
consistent and that's it.  Use TreeMap methods like submap for qeuries,
throw in some regular expressions for more powerful searching.  

Whatever query methods you need,  make sure to write them as methods on
your Index so the collection traversals and contained object method
invocations all happen inside the server context so they are local calls
and therefore fast. 

~Jimmy

On Sat, 2006-04-15 at 16:08 +0200, Martin Walch wrote:
> Hello,
> 
> I'm new to ozone and also rather new to databases in general.
> For my current project some kind of OODBMS seems to be a good choice.
> However, beside some rather complex structures, I've got also long lists
> of Objects of the same class.
> Concretely: I have got a list of persons with names, addresses, ids and so on.
> I need to find somebody in this list either by name or by id. Both options must work fast.
> So in a RDBMS like e. g. MySQL I would probably create an index for names and one for ids.
> Well, this is no RDBMS.
> 
(Continue reading)

walch.martin | 18 May 2006 21:41
Picon

Re: something like an Index?

Thank you both for your answers. Indeed I have started planing my application 
with Trees given by the Java API. However, I did not take TreeMap, but 
TreeSet, because there must not be any duplicates.
I am starting to understand how to use Ozone and I like it. It is what I was 
looking for. :)

On Tue, 2006-04-25 at 12:13, Jimmy Stiefel wrote:
> You build your own indexes in Ozone any way you want.
>
> In your example, I'd recommend something along the lines of a TreeMap
> inside an Ozone object so it is persistent.  Make Person extend
> OzoneRemote so it is a first class persistent object.  Define Index that
> extends OzoneObject, and wraps a TreeMap in its impl.  Create two Index
> in the database & name them,  one to map id -> Person "id_index", one to
> map name -> Person "name_index".  Write a little code to keep them
> consistent and that's it.  Use TreeMap methods like submap for qeuries,
> throw in some regular expressions for more powerful searching.
>
> Whatever query methods you need,  make sure to write them as methods on
> your Index so the collection traversals and contained object method
> invocations all happen inside the server context so they are local calls
> and therefore fast.
>
> ~Jimmy

On Mon, 2006-04-17 at 14:28, Nicolas Barrera wrote:
> As far as i 'm concerned..,
> 
> ozone developers 're opposed to the idea of having some kind of query
> language that would for example aid you to ask for 'all persons whose
(Continue reading)

Nicolas Barrera | 17 Apr 2006 14:28
Picon
Gravatar

Re: something like an Index?

As far as i 'm concerned..,

ozone developers 're opposed to the idea of having some kind of query
language that would for example aid you to ask for 'all persons whose
name starts with "Q" and whose id is lower than 5 (etc, etc,)....' in
just one sentence

If you re working with ozone you 'll ask the db for an object which
contain references to your persons collection and then you 'd iterate
and filter that collection in a really Object-Oriented-Programming
way.

Off-topic: i totally agree with these guys in that the OOP way is the
nicer and better-looking (and even the correct one), but i 'm not sure
if performance is a drawback for this focus or not.

greetings, hope i ve give you some hint..,

lastly, if you 're looking for indexes in ozone.... well i belive that
ozone users don't care about indexes, they care about OBJECTS, so as i
said earlier, you pick up your collection and iterate it.

c ya!

On 4/15/06, Martin Walch <walch.martin <at> web.de> wrote:
> Hello,
>
> I'm new to ozone and also rather new to databases in general.
> For my current project some kind of OODBMS seems to be a good choice.
> However, beside some rather complex structures, I've got also long lists
(Continue reading)


Gmane