Click here to Skip to main content
15,888,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi ,

Have some doubts regarding how to implement the Composite Design Pattern to implement a tree structure using Asp.net MVC3 architecture. My concerns are mainly due to the requirement that the tree structure has nodes which have different attributes or properties for each level .

May be I ll explain a bit more into this with an example.

Tree has a root node - T which has attributes/properties X, Y ,Z ( X can be reffered to as Name for our convenience )
Corresponding child nodes A , B have properties - X, L ,M
Corresponding next level nodes have properties - X, P , Q
Corresponding next nevel nodes have properties - X, R, T and so on.

The current design is not developed with any pattern and just each levels are different class type .

So if we want to add any levels or change it effects the whole classes because of the dependency classes it has .

Please let me know if I can apply composite design pattern so that these type of dependencies and the code maintenance can be easier. how should our POCO or Models should be defined to follow the composite pattern in such a scenario. I'm using Asp.net MVC3, C#, DB first approach with NICedit.js( for the tree structure display ) .

Appreciating the help in advance .
Posted
Updated 16-Aug-13 22:54pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900