473,385 Members | 2,013 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,385 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 1135

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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.