Switch Statements vs Visitors

Switch statements should only be used at process bounds, where data is still un typed.

As soon as you are outside of your http ( or other externalization protocol ) binding layer, you should have instances that are ready to be used with visitors. 

NOTE : it's valid to create an Unknown visible type which you map anything in your switch statement fall through default case to, so that visitor handlers can address cases of added types that they don't yet support, gracefully. 

Comments

Popular posts from this blog

Define "Scalar Value"

AI Self Awareness in Video Games

The World of Conceptual Data Modeling