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]

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