- Thread Author
- #1
Hey everyone. I am familiar with both Interfaces#getAt and Interfaces#newQuery methods of finding an Interface on the screen.
My question is, is it considered bad practice to retrieve either an Interface or InterfaceComponent directly by it's ID? I read in another thread that Interfaces#getAt will be deprecated soon (@Cloud). Also, what is the reason for this? The only reason I could figure is that the IDs are possibly dynamic and that hardcoding them can be unreliable.
Getting an interface by its ID should have a lower time-complexity than querying for it every time an interface is needed, if not cached. So performance wise, using direct IDs would be preferable if as accurate as querying.
Would a viable workaround be to query for an Interface by text, get it's container ID, and then choose another child component from that container via getComponent(#)?
Thank you for clarifying.
My question is, is it considered bad practice to retrieve either an Interface or InterfaceComponent directly by it's ID? I read in another thread that Interfaces#getAt will be deprecated soon (@Cloud). Also, what is the reason for this? The only reason I could figure is that the IDs are possibly dynamic and that hardcoding them can be unreliable.
Getting an interface by its ID should have a lower time-complexity than querying for it every time an interface is needed, if not cached. So performance wise, using direct IDs would be preferable if as accurate as querying.
Would a viable workaround be to query for an Interface by text, get it's container ID, and then choose another child component from that container via getComponent(#)?
Thank you for clarifying.