Current API for retrieval of registered XmppModule is problematic. Retrieval is done by ID (String) and result object is being casted on the type of variable to which property is assigned.
It would be far better to be able to provide a class/struct (or ID of a type which has class assigned) as a parameter and retrieve a module of that type. It would be good to have 2 methods:
returning module of correct type or crashing (for usage in clients or in libraries where there is no point to work with missing modules
returning optional module of correct type (for places when we can properly work without particular mode - its availability is optional)
Current API for retrieval of registered
XmppModule
is problematic. Retrieval is done by ID (String
) and result object is being casted on the type of variable to which property is assigned.It would be far better to be able to provide a class/struct (or ID of a type which has class assigned) as a parameter and retrieve a module of that type. It would be good to have 2 methods: