473,374 Members | 1,679 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,374 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 4236
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ian Giblin | last post by:
I am an experienced C programmer, learning C++ by writinging a mathematical toolkit in the framework of a script interpreter. I am posting here to ask for advice (or references) on the object...
24
by: John Salerno | last post by:
Since Python does so many things different, especially compared to compiled and statically typed languages, do most of the basic design patterns still apply when writing Python code? If I were to...
1
by: Griff | last post by:
Hi I'm not sure of the best way to go about achieving my goal and would appreciate any advice. What I would like to do is to generate a control that can be dropped onto a web page. For...
6
by: Orgun | last post by:
Hi, I sent this message to the moderated c++ group too but it is waiting for moderator approval and I wanted to send here too. I am new to Design Patterns. I want to write a simple...
1
by: Greg Curie | last post by:
Hi I have been a lurker in comp.lang.c for a while and have benefited from reading many discussions. There are some neat solutions to problems i have previously struggled with and some neat...
19
by: adriancico | last post by:
Hi I am working on a python app, an outliner(a window with a TreeCtrl on the left to select a document, and a RichTextBox at the right to edit the current doc). I am familiarized with OOP...
5
by: Ronald S. Cook | last post by:
I need ideas on how to best design a Windows form for my particular situation. On a cattle feeding yard there will be between about 300 and 600 pens. On my "Pen Feeding Sequence" form, I want...
10
by: vital | last post by:
Hi, I am designing the middle tier of a project. It has 6 classes and microsoft application data access block. The six classes are DBServices, Logger, ProjectServices ... etc. and all these...
1
by: DS | last post by:
I'm trying to understand how these two concepts could work together architecturally (if they can.) I realize both concepts provide benefits of re-use and ease of maintenance. Which is important...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.