   set shader param
  which is better to set shader param? device->setShaderConstant or shader->setparamValue？ and why?   
  Pure shader objects do not have external callable methods, so the second option is that of a helper class (which ultimately calls SetShaderConstant). It is convenient to use helper classes such as ones provided by the Effect framework in order to manage several device states and shaders together as effect instances. An effect instance can encapsulate all the states needed to render a given type of objects in your application.In contrast, if you use direct methods of the device, you have to write a lot of duplicate code for each object type, since you have to set the necessary device states separately.In practical development, helper classes are almost always used. These helpers then call the direct methods of the device.   