[design patterns] a tree view

  • Thread starter Takayasu Kenduma
  • Start date
T

Takayasu Kenduma

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 :)
 
N

Nick Malik

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/designpatterns/pubs/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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top