472,121 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

[design patterns] a tree view

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
1 4153
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.

Similar topics

4 posts views Thread by Ian Giblin | last post: by
24 posts views Thread by John Salerno | last post: by
1 post views Thread by Griff | last post: by
1 post views Thread by Greg Curie | last post: by
5 posts views Thread by Ronald S. Cook | last post: by
10 posts views Thread by vital | last post: by
reply views Thread by leo001 | last post: by

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.