I think the problem is that DisplayView is virtual and calls virtual methods. In most cases, virtual methods invoke final methods as a means of changing behavior, for example, in a strategy template. If the last method calls a virtual method, the compiler knows that the virtual method will always be called in all classes that call the output, and therefore it is valid for the virtual method to exist.
The fact that you call virtual virtual means that your design can be questioned: if the DisplayView is virtual, another implementation may override it. The current implementation calls virtual GetHeader , but the output class cannot. Therefore, it cannot guarantee that GetHeader not dead code.
This is probably what FxCop draws your attention to. He wants to know that if you define a virtual method ( GetHeader in this case) in the base class, which will use all its generating implementations.
I would focus on making DisplayView final, or evaluate your design in this light.
source share