I dont see any problems with the approach you are provided. It should work assuming that the generate statement is in the right scope.
However one disadvantage is that you will need to recompile the entire design everytime you want to change the parameter value as the generates are resolved during compile time.