Solved

Model / View Issue

Posted on 2004-03-24
6
139 Views
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?
0
Comment
Question by:__alex
  • 3
  • 3
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
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 ;-)
0
 
LVL 2

Author Comment

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

Expert Comment

by:kretzschmar
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 ;-)
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 2

Author Comment

by:__alex
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:

Example:
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.
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 125 total points
ID: 10666883
hmm,

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)

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20407731.html#7873367

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

meikl ;-)
0
 
LVL 2

Author Comment

by:__alex
ID: 10684911
Thanks!
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

785 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