Linear Object Design

Hi ,

I need to design a linear kinda structure of objects. Typically a common object which has child/chidren which further drill down to child/children.

Currently, i 'm looking at a Base Object having a list of child objects and each of this object in the list would have a list of children as well. Basically it is a heirarchical structure, linear in nature. So is any better way of doing this.

Is this somekinda composite pattern ?

Base

List subObjects

List subSubObjects

thanx

[552 byte] By [arifkhan2] at [2007-9-30 12:26:48]
# 1

This is called a tree. I'm sure there are bajillions of references for designing trees generally, and lots for Java in particular. The SDK comes with a tree implementation in the javax.swing.tree package. Don't let the package fool you - the data storage part has nothing to do with GUIs.

nasch_ at 2007-7-4 15:54:13 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
Thanx a lot, i'd really appreciate if u could help me with an example.This is my scenario: Detail <has a collection of> Condition <has a collection of> Services <has a collection of> CareType <has a collection of> ProcedureTypethanx
arifkhan2 at 2007-7-4 15:54:13 > top of Java-index,Other Topics,Patterns & OO Design...
# 3
> Thanx a lot, i'd really appreciate if u could help me> with an example.No, thanks. I'm sure you can find lots of examples on the web. Perhaps someone else will write code for you, though.
nasch_ at 2007-7-4 15:54:13 > top of Java-index,Other Topics,Patterns & OO Design...