Suppose I have different classes to deal with different versions of the same protocol (with possibly different interfaces). For example, a fictitious protocol named My Protocol (MYP):
My Protocol (MYP) versions 1.0, 1.1, 2.0, 2.2, etc...
Some naming examples I could think of are:
MYP10Handler
, MYP11Handler
, MYP20Handler
, MYP22Handler
, ...
MYP1_0Handler
, MYP1_1Handler
, MYP2_0Handler
, MYP2_2Handler
, ...
If using the first option, for example, there would be ambiguities if the protocol reaches higher versions. For example, version 11.0 (eleven):
MYP11Handler
: Version 1.1 or 11.0?
MYP110Handler
: Version 11.0 or 1.10?
The second option, however, seems to escape the Camel Case rule.
How naming is usually done to these types of class? Is there a better practice for this?
com.company.protocol.11_0.MyHandler
. and of cause there should by an interface without versioncom.company.protocol.MyHandler
– Hiltan