Solved

Model / View Issue

Posted on 2004-03-24
6
141 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
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…

730 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