Hi Kiran,
in the case of dynamic component usages you could, for example, us the component controllers GET_COMPONENT_USAGE method to get the component usages. The use the method GET_CONTEXT_NODE to get a specific context node for each component. Next you could check if the context node implements a certain custom interface that you use to get the data.
If you want to build this fully dynamic you could use GET_RUNTIME_REPOSITORY of the component controller and get the runtime repository and read the used components via GET_CMP_USAGE_LIST.
Christian