I think there needs to be some way of specifying the resource factory...
It is. See also Resource Services and Registering services.