Model / View Issue

Posted on 2004-03-24
Last Modified: 2010-04-05
Well, this is not a real question but maybe I can benefit from the experience of others. Here it goes: I use a TTreeView to represent my data. If the data changes I've got two options (beside others). A) Rebuild the whole tree. B) Just care about the changes.

Ad A: My representation is always consistent but performance is worse and I loose the focus of the selected node.
Ad B: Performance is high but I hold a copy of my data that may (due a bug) differ from the original data.

What do you prefer?
Question by:__alex
  • 3
  • 3
LVL 27

Expert Comment

ID: 10665960
i would prefer C:

modify your tree(node),
actualize the data

who changes the data?
you within the tree, or someother in the data (file?)?

above is for
-you within the tree

meikl ;-)

Author Comment

ID: 10666254
It is me but from somewhere else.
LVL 27

Expert Comment

ID: 10666493
>It is me but from somewhere else.
??? rephrasing the question
does your instance changes the data, or any other instance

if first, then C
if second, then B

A depends on the amount of data

meikl ;-)
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.


Author Comment

ID: 10666724
The data can be changed from outside my form and from the form containing my tree view. Changing one node can lead to multiple changes in other nodes:

node: Main_1
     node: Child_1   ***
     node: Child_2
node: Main_2
     node: Child_3
     node: Child_1   ***

Renaming Child_1 must appear in the node in Main_1 and in the node in Main_2.
LVL 27

Accepted Solution

kretzschmar earned 125 total points
ID: 10666883

there is a possibility,
to store relevant data in the data-property.

doing so, it is possible that nodes can share
relevant data
(multiple nodes pointing to one data-reference).

then i fyou do drawing the caption byelf in the tree,
you can lookup to the shared data

you may take a look into
(using mike lischkes virtualtree)

well, could be i'm on a wrong track,
and misunderstand this q

meikl ;-)

Author Comment

ID: 10684911

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question