IDs versus relative paths in ExtJS 4
===

There are two major ways in getting components in ExtJS 4. By a global ID or by a relative path.

The ID approach has the benefit of finding any component independent of it actual position within the view. So when the view changes, the system still works. But as the system gets bigger and bigger I need to use IDs with namespaces and implement some mechanism to generate unique IDs for multiple instances of a component.

When I use relative navigation with component queries, I don't have to worry about IDs and just navigate, for example, from the clicked button to the grid I want to change and do it. But when the view changes it's possible that the query doesn't work anymore and the system breaks.

So both of the approaches seem suboptimal.

Is there any better method?