By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,474 Members | 3,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,474 IT Pros & Developers. It's quick & easy.

[design patterns] a tree view

P: n/a
hi everybody.
i am quite new about design patterns and i would like improve my
experience in c# applications design. so i choose a common problem as
a draft to talk about in the group to find the right approach and the
different point of views of different programmers.
one common problem is a tree structure where a node is a son of
another one and nodes can be of different types.
i can think about some tables in a database (like access or sql server
or mySql ....) containing information about relatioships and details
of nodes (let me be simple, not talking about a more general graph
with paths, lenghts and so on)
there should be some code to manage those nodes, to add, delete, move,
search ... and some code for the interface.
what can be a "design pattern" approach to draw the object and
classes?
for me it's hard to abandon a vb approach because in the last years i
had to work in bad designed projects :-)
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You are referring to the classic pattern that the Gang of Four termed a
"Composite" pattern.

For a short online description, you could refer to
http://home.earthlink.net/~huston2/dp/composite.html
or look here
http://c2.com/cgi/wiki?CompositePattern

Note that a pattern is not an algorithm. If you are referring to a binary
tree, that tends to be more specific than you find in the pattern
literature, which is more concerned with structural and behavioral
representations of data using object oriented methods.

By the way, the term "composite design pattern" is an overloaded term. It
was overloaded by John Vlissides himself in 1998 in this whitepaper:
http://www.research.ibm.com/designpa...s/ph-jun98.pdf
To get better at using Patterns, I'd suggest a slim book written by
Shalloway and Trott called Design Patterns Explained. I heartily recommend
this book for folks who are realizing that their understanding of Object
Oriented Design is merely mechanical (e.g. you understand inheritance, but
can't find a good reason to bother with it).

Hope this helps,
--- Nick

"Takayasu Kenduma" <ga***********@icqmail.com> wrote in message
news:af**************************@posting.google.c om...
hi everybody.
i am quite new about design patterns and i would like improve my
experience in c# applications design. so i choose a common problem as
a draft to talk about in the group to find the right approach and the
different point of views of different programmers.
one common problem is a tree structure where a node is a son of
another one and nodes can be of different types.
i can think about some tables in a database (like access or sql server
or mySql ....) containing information about relatioships and details
of nodes (let me be simple, not talking about a more general graph
with paths, lenghts and so on)
there should be some code to manage those nodes, to add, delete, move,
search ... and some code for the interface.
what can be a "design pattern" approach to draw the object and
classes?
for me it's hard to abandon a vb approach because in the last years i
had to work in bad designed projects :-)

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.