RE: Concept for modeling hierarchical data

2006-01-10 Thread Fredrik Rubensson
 

Florian Lindner wrote:
> > Florian Lindner wrote:
> > >Hello,
> > >I'm searching for the best concept of how to use and save 
> > >hierarchical  data. I have a structure like PC file system with
meta 
> > >data. There a  folder objects and files objects of different types.

> > >Every object have  data like permissions, date and author. And they

> > >have type-specific data  fields like resolution (of an image type)
or 
> > >location (of an meeting
> > > type) or ingredients (of an recipe type).
> > >What is the best way to store that kind of data? What database is 
> > >recommendable? What concepts of persistance? Or not using managed  
> > >persistance and do it manually?
> >
> > If you want to do it manually, a hierarchical tree can be
represented 
> > by just one table:
> >
> > CREATE TABLE tree (
> > id   INTEGER   PRIMARY KEY,
> > parent_id   INTEGER
> > );
> >
> > With managed persistence, be carefull not to configure it to load
the 
> > entire tree at once.
> >
> > As for a DB, any decent relational DB will do.
> 
> In this concept I need a table for every type of objekt I want?

It depends on if you want the DB to handle data integrity for you. If
you are happy to have everything as key-value pairs you can come away
with two tables. Add a table with columns kay, values and a foreign key
to the suggested tree table. If you want specific data integrity per
type you will have to have one table per type. It also seems that some
data is there for all types (permissions, date and author). Maybe you
want to reuse that definition in one table. 

In the end it depends on what you will be using this tree of data for,
how will you access it and what technology will be used? Will it be
read-only or both reads and writes? Volumes? Number of users? If data is
to be updated by several users I think youl should definitely use a
relational database of some kind. If it is read-only then XML files will
be good enough. Hibernate is a good persistence framework to use if you
want to do the modeling in XML or Java.

Fredrik


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Concept for modeling hierarchical data

2006-01-10 Thread Florian Lindner
Am Dienstag, 10. Januar 2006 13:04 schrieb [EMAIL PROTECTED]:
> At the risk of pointing out the obvious, why not use what tomcat uses to
> store hierarchical data, XML?

Is this suitable for large amounts of data? How to read it? SAX?

Thanks,

Florian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Concept for modeling hierarchical data

2006-01-10 Thread Florian Lindner
Am Dienstag, 10. Januar 2006 07:51 schrieb Nikola Milutinovic:
> Florian Lindner wrote:
> >Hello,
> >I'm searching for the best concept of how to use and save hierarchical
> > data. I have a structure like PC file system with meta data. There a
> > folder objects and files objects of different types. Every object have
> > data like permissions, date and author. And they have type-specific data
> > fields like resolution (of an image type) or location (of an meeting
> > type) or ingredients (of an recipe type).
> >What is the best way to store that kind of data? What database is
> >recommendable? What concepts of persistance? Or not using managed
> > persistance and do it manually?
>
> If you want to do it manually, a hierarchical tree can be represented by
> just one table:
>
> CREATE TABLE tree (
> id   INTEGER   PRIMARY KEY,
> parent_id   INTEGER
> );
>
> With managed persistence, be carefull not to configure it to load the
> entire tree at once.
>
> As for a DB, any decent relational DB will do.

In this concept I need a table for every type of objekt I want?

Regards,

Florian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Concept for modeling hierarchical data

2006-01-10 Thread David Smith

Florian Lindner wrote:


Hello,
I'm searching for the best concept of how to use and save hierarchical data.
I have a structure like PC file system with meta data. There a folder objects 
and files objects of different types. Every object have data like 
permissions, date and author. And they have type-specific data fields like 
resolution (of an image type) or location (of an meeting type) or ingredients 
(of an recipe type).
What is the best way to store that kind of data? What database is 
recommendable? What concepts of persistance? Or not using managed persistance 
and do it manually?


Thanks for all ideas!

Florian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

 

There is also JSR-170 which defines an API for storing data 
hierarchically.  The Jackrabbit project is one implementation of it and 
currently used in the Magnolia CMS.


JSR-170 spec: http://www.jcp.org/en/jsr/detail?id=170
Jackrabbit project: http://incubator.apache.org/projects/jackrabbit.html
Magnolia CMS: http://www.magnolia.info

--David

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Concept for modeling hierarchical data

2006-01-10 Thread cknell
At the risk of pointing out the obvious, why not use what tomcat uses to store 
hierarchical data, XML?
-- 
Charles Knell
[EMAIL PROTECTED] - email



-Original Message-
From: Florian Lindner <[EMAIL PROTECTED]>
Sent: Mon, 9 Jan 2006 23:05:08 +0100
To:   users@tomcat.apache.org
Subject:  Concept for modeling hierarchical data

Hello,
I'm searching for the best concept of how to use and save hierarchical data.
I have a structure like PC file system with meta data. There a folder objects 
and files objects of different types. Every object have data like 
permissions, date and author. And they have type-specific data fields like 
resolution (of an image type) or location (of an meeting type) or ingredients 
(of an recipe type).
What is the best way to store that kind of data? What database is 
recommendable? What concepts of persistance? Or not using managed persistance 
and do it manually?

Thanks for all ideas!

Florian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Concept for modeling hierarchical data

2006-01-09 Thread Nikola Milutinovic

Florian Lindner wrote:


Hello,
I'm searching for the best concept of how to use and save hierarchical data.
I have a structure like PC file system with meta data. There a folder objects 
and files objects of different types. Every object have data like 
permissions, date and author. And they have type-specific data fields like 
resolution (of an image type) or location (of an meeting type) or ingredients 
(of an recipe type).
What is the best way to store that kind of data? What database is 
recommendable? What concepts of persistance? Or not using managed persistance 
and do it manually?
 



If you want to do it manually, a hierarchical tree can be represented by 
just one table:


CREATE TABLE tree (
   id   INTEGER   PRIMARY KEY,
   parent_id   INTEGER
);

With managed persistence, be carefull not to configure it to load the 
entire tree at once.


As for a DB, any decent relational DB will do.

Nix.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Concept for modeling hierarchical data

2006-01-09 Thread Florian Lindner
Hello,
I'm searching for the best concept of how to use and save hierarchical data.
I have a structure like PC file system with meta data. There a folder objects 
and files objects of different types. Every object have data like 
permissions, date and author. And they have type-specific data fields like 
resolution (of an image type) or location (of an meeting type) or ingredients 
(of an recipe type).
What is the best way to store that kind of data? What database is 
recommendable? What concepts of persistance? Or not using managed persistance 
and do it manually?

Thanks for all ideas!

Florian

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]