473,405 Members | 2,354 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,405 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
Nov 20 '05 #1
1 1022

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.languages.vb
|
| 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
|
|
|

Nov 20 '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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.