Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [ Slightly OT ] database-based editor and model representations
[ Slightly OT ] database-based editor and model representations [message #270557] Wed, 08 September 2004 08:36 Go to next message
Eclipse UserFriend
Originally posted by: v.j.b

hello,

[ if you only want to read the questions, skip to the last part ]

I'm writing a small plugin that is to be used as a CMS. I've written a few
applications based on SWT / JFace before, and am now trying to get to grips
with plugins and RCP. In this plugin, I use a database as persistent storage
(it's actually sqlite), and a treeviewer to represent it in the workbench.
The treeviewer works fine, i get all the appropriate info in the tree, and
can do what i want with it.

In the past, I either had a model based on an 'in-memory'
parent-child-tree(parsed xml-data), or the model was created on the fly
(also in-memory), with the same kind of relation. Implementing a treeviewer
was nothing more than the contentprovider traversing this tree, and
providing it to the viewer. Now i'm using a database, which doesn't have
such an explicit kind of parent-child relationship, i've written the
contentprovider to use queries on the database to get it's data. So every
time the treeviewer requests children of a certain node, i just fetch the
'parent-id' of the parent-object, run it through the database, and return an
object that contains the name (String) and the id of the child.

In the approach depicted here, this would mean translating the rows of the
resultset to objects everytime the viewer requests these. Caching can always
be used ofcourse, but that is not the issue.

---------
What i was wondering is how other people (in general) cope with this. Is it
'do-able' to translate all your rows into objects everytime they are
requested by the viewer? Another possibility would be to query the database
everytime, without any translation into objects (ofcourse there is always
translation into objects, but this would be an object having the complete
set of columns as properties).
As I see it now this comes down to two things:
- translate everything into objects, cache in-memory: for large databases
this would require a large amount of memory, and seems to forgo the use of a
database.
- just query the database for every request from the viewer, and return
only the minimal of information needed to the viewer: this would not use any
'extra' memory, but would involve a couple of queries per item in the
database.

I'm not asking for code here, I was just curious as to what would is thought
of as th
Re: [ Slightly OT ] database-based editor and model representations [message #270612 is a reply to message #270557] Wed, 08 September 2004 14:37 Go to previous message
Eclipse UserFriend
Originally posted by: v.j.b

no ideas ppl? too much offtopic perhaps?

(i posted followup to .rcp as it is about rcp aswell)
Previous Topic:launching eclipse product/app from cmd line
Next Topic:Dynamic menu items
Goto Forum:
  


Current Time: Sat Oct 19 14:34:21 GMT 2024

Powered by FUDForum. Page generated in 0.02982 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top