cancel
Showing results for 
Search instead for 
Did you mean: 

Deep nesting in context

Former Member
0 Kudos

Hi,

How many deeply nested nodes can we use in the context without effecting the performance?

We have node structure like this


node1
 |_ node11
       |_ node111
 

Is this structure ok to use?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

thank you it answered my question experts.....

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I don't think there is any set rule. I've used context nodes with 5 or 6 levels of nesting and not seen any performance degredation. It probably has more to do with how you access the context and how many element you will have at each level. I'm sure there is some point where just the nested levels become a problem but that is probably some rediculous high number of levels.

ChrisPaine
Active Contributor
0 Kudos

Given that the way a nodes are stored as a list of references to the node implementation class is flat (well sort of) with the actual node itself holding the pointers to parent and children (it's not like it is stored in a huge hierarchical table where all the structure is stored) - I cannot see any reason that a deep hierarchy would cause any issues. Once the reference to the node/element is made there is no upward or downward work that needs to happen - that node element behaves exactly the same deep in the structure as if it were a first level context node.

I often use dynamic hierarchical nodes for tree display which have 10-15 levels - with no noticeable performance changes.

What I have done in these cases, however, is build index tables which have data that I might want to search and a reference to the element in the structure - this means I don't have to do costly recursive search logic. Instead I just search the flat table, and immediatly I have the reference to the element wherever it might be in the structure.

True, the layout needs to follow the path from the main context node down to the selected element - but the work to map from view to controller or component to component is pretty much the same regardless of structure (I would think) as it is at each node that the referenced node is set - so the work required is similar whether a nested structure was used or a flat structure.

I'd more be concerned about any individual component that had a context that was that complex! it might make sense to redesign so that the application could be built from multiple simpler components. Thinking just from a future maintenance point of view - if you have to expand the context 4 or 5 levels to get to the information you need, it could be hard for someone without knowledge of the app to come in an do some fixes/enhancements on it.

Good luck with your design,

Chris

Former Member
0 Kudos

Hi Archana,

As per my knowledge, the structure you mentioned is correct. Please refer to the Standard WD component WDR_TEST_TREE and go to the View ONE_LEVEL_2_NODES.

Former Member
0 Kudos

Thanks for the response ....

The number of nodes that can be nested is not mentioned in the link.

I have already checked that...

I dont want how to build that node Sanket...

My question is how many nodes can be nested in the context without deteriorating the component performance?

Former Member
0 Kudos

Hi,

There is hard and fast rule for performance due to nesting level.

G through this link

http://help.sap.com/saphelp_nw70ehp2/helpdata/en/8c/a0fa495f9a480bae29bf43474ccb79/content.htm

Regards

Arvind