How to deal with dynamic parameters?

There is no general answer. See e.g.