473,322 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Events and Tree like collections :: Would love to hear you opinion!

Hi everyone,

Here is my problem:

I have the following classes:
- DataNode - this class is designed to hold some data and will be contained
in a tree like data structure DataTree. When DataNode is changed, it raises
"Changed" event. The class has a reference to the DataNode it is being
contained in:
- DataTree - tree like data structure that contains DataNodes; When
DataNodes are inserted, deleted or reodered, DataTree raises the following
events: Inserted, Deleted, Reodered. It also listens to Changed event of the
DataNodes it contains. DataTree subscribes to the Changed events of the
DataNodes when they are added.
- DataTreeCollection - contains multiple DataTrees. It also subscribes to
DataTrees' events

So as you can see, DataTreeCollection ends up with the following events
- DataNode's Changed
- DataTree's Inserted, Removed, Reodered

This way in my application I have to listen to only one instance of
DataTreeCollection, but I still can listen to all events, because all the
players propagate their events to their owners. But a negative side to this
is that the parent of all children will have to have all possible events of
his children...

What do you think about a design like this?
I wonder, if there is better way to do this:

I would love to hear some suggestions or critique
Thank you in advance,
Sasha
Jul 21 '05 #1
1 1131

Hi Sasha,

I found that this post has been posted in serveral groups.
I will reply to you in microsoft.public.dotnet.languages.csharp, please
follow up there.
Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Sasha" <no@no.com>
| Subject: Events and Tree like collections :: Would love to hear you
opinion!
| Date: Wed, 5 Nov 2003 17:47:42 -0800
| Lines: 37
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <OV**************@TK2MSFTNGP11.phx.gbl>
| Newsgroups:
microsoft.public.dotnet.general,microsoft.public.d otnet.languages.csharp,mic
rosoft.public.dotnet.languages.vb
| NNTP-Posting-Host: filenet-gw.filenet.com 198.3.8.1
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.csharp:197052
microsoft.public.dotnet.languages.vb:154069
microsoft.public.dotnet.general:114539
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Hi everyone,
|
| Here is my problem:
|
| I have the following classes:
| - DataNode - this class is designed to hold some data and will be
contained
| in a tree like data structure DataTree. When DataNode is changed, it
raises
| "Changed" event. The class has a reference to the DataNode it is being
| contained in:
| - DataTree - tree like data structure that contains DataNodes; When
| DataNodes are inserted, deleted or reodered, DataTree raises the following
| events: Inserted, Deleted, Reodered. It also listens to Changed event of
the
| DataNodes it contains. DataTree subscribes to the Changed events of the
| DataNodes when they are added.
| - DataTreeCollection - contains multiple DataTrees. It also subscribes to
| DataTrees' events
|
| So as you can see, DataTreeCollection ends up with the following events
| - DataNode's Changed
| - DataTree's Inserted, Removed, Reodered
|
| This way in my application I have to listen to only one instance of
| DataTreeCollection, but I still can listen to all events, because all the
| players propagate their events to their owners. But a negative side to
this
| is that the parent of all children will have to have all possible events
of
| his children...
|
| What do you think about a design like this?
| I wonder, if there is better way to do this:
|
| I would love to hear some suggestions or critique
|
|
| Thank you in advance,
| Sasha
|
|
|

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Champaign | last post by:
Hi all, I'm working on an educational applet for a child with special needs. He's got a bit of a trick to make my life more difficult... To interact with the applet he needs to click on...
9
by: Marek Mand | last post by:
How to use generated keyboard events? What I am trying here to do is in onkeyup event handler http://www.hot.ee/idaliiga/braggart/createEventTest.htm generate a (shift)TAB keydown so the...
19
by: Christian Fowler | last post by:
I have a VERY LARGE pile of geographic data that I am importing into a database (db of choice is postgres, though may hop to oracle if necessary). The data is strictly hierarchical - each node has...
3
by: Sasha | last post by:
Hi everyone, Here is my problem: I have the following classes: - DataNode - this class is designed to hold some data and will be contained in a tree like data structure DataTree. When...
5
by: JezB | last post by:
I have trawled through the System.Collections namespace looking for some structure that will enable me to represent and manipulate tree structures, as yet to no avail. Of course I can represent...
3
by: Fred Nelson | last post by:
Hi Folks: I have a question about the Page_PreInit and Page_Load events in a web application. My question is: can I count on the Page_PreInit having completed before the Page_Load event...
3
by: Alex | last post by:
What does it mean to "walk the DOM tree"? How do you use it? I hear programmers using this term loosely and I'm not sure what it means. I understand that DOM means Document Object Module and that...
4
by: Sid Price | last post by:
Hello, I have a class of objects (Device) that are managed by another object (Devices) with a collection class (DeviceCollection) inherited from Collections.Hashtable. Each of the Device objects...
0
by: preetkanwal0678 | last post by:
Hello all, Am working on PYTHON +BRANWAVE(framework) Actually am Trying 2 make a tree menu using d both. Am not able 2 target the (.tmpl) files and not getting how 2 make frames in...
7
by: Scott Stark | last post by:
Hello, I've got some code working but I'm not sure that the way I implemented it is the best way. I have a custom collection class with a boolean property HasChanged that tells me if any of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.