473,785 Members | 2,767 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[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 4263
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.goo gle.com...
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
1989
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 design and implimentation. Currently I have a portable "ScriptSession" class which contains the mechanics of looping with a user prompt, parsing a sentence and handling syntax errors, etc., and I wan this to be a class I can use for any script...
24
2112
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 read a design pattern book (such as Head First Design Patterns), could I apply their Java examples to Python easily enough, or does Python require a different perspective when applying patterns?
1
1707
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 example, a control that provided catalogue information. As I envisage this, the control would be given a single argument (the end user identifier) and it would return the required catalogue information as an HTML page "fragment".
6
2080
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 DeviceManager which is only interested in CD/DVD devices. I want to get the list of CD/DVD devices and "be informed when a disc inserted into a device". I am developing this on Linux. So, I used HAL API and read some system (actually /proc) files to gather...
1
1298
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 solutions to problems i have yet to bump into. Thanks for that. Some recent postings, on what might be quite a long ongoing discussion, got me to look into
19
1752
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 concepts and terms but I lack practical experience
5
1526
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 the user to be able to setup and maintain the order in which the pens should be fed (ultimately in the Pen table is a column named Sequence that gets an interger value). So on the form...
10
3679
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 classes talk to front-end directly. Do I need to use any design pattern in this? or what kind of design pattern is this?
1
2038
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 when you are setting up multiple sites that are similar. But it seems like using both Design Patterns and Layered Architecture together would create conflicts -- especially in the area of keeping layers loosely coupled (and even physically on...
0
10329
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10152
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10092
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7500
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2880
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.