09-03-2018 06:40 AM
Is it a correct way to iterate cluster of LV objects?
All objects inherite from Parent class. DD method is invoked inside iteration loop.
Any problems concerning this way?
And what about performance?
09-03-2018 07:25 AM
You "iterate" (perform repeated, implicitly doing the same thing to the same, or similar item) over Arrays, which contain identical items. Clusters are designed for grouping different items -- you unbundle a Cluster and explicitly treat each of their elements. The idea is that you know the elements are different (but related to each other), so you write different routines to deal with each element. For an Array, you would have the same routine to deal with each Array element (since they are all the same type).
By unbundling and having code (which can run in parallel!) for each Cluster Element, you are working at maximum efficiency.
Bob Schor
09-03-2018 07:46 AM
@petrnowak wrote:
Any problems concerning this way?
And what about performance?
Value property nodes are SLOW. So that is a major downfall.
What I see here is a clearly bad data management. If you need to iterate over objects, you should be using an array. Arrays are also expandable, meaning you can easily expand your application simply by adding more elements to the array.
09-03-2018 08:37 AM - edited 09-03-2018 08:40 AM
I do know difference cluster/array of course. However, I have a cluster of LV objects all of them inheriting from the same parent. This way we can consider cluster of objects like array and call the "same" DD method in a loop. Its possible to convert cluster to array and iterate but I want to keep unbundle/bundle cluster feature to access individual item in cluster and call some other (e.g. static methods, that are not the same for all children).
I want to iterate all objects in cluster to avoid to construct unbundle-call method-bundle network because with hundreds of objects its a cumbersome programmer work...
I ask another way: dont talk about cluster/array difference. Do my method have any problems other than efficiency (slow property node call) ???