I have many methods (in this case, from web services, but maybe this does not affect?) On the call. They are already fixed versions of the release and will not be changed , it is up to me to adapt to them. I already have proxies in my project, and in fact I already name them, and the project is fine.
This main class method receives some input parameters (transaction type and XML string containing transaction data). Based on TransactionType, I know which class and method I should name. I also need to provide him with the type variable that he expects, already built from the provided XML. This is how it happens today (I don’t have the code here, so I apologize for any syntax errors), approximately:
public class MyClass ()
{
public void MyMethod( string TransactionType, string XML )
{
switch( TransactionType ) {
case "1":
type1VO type1Object = ( new Deserializer<Type1>() ).XML2Object( XML );
ws = new WSProxy1();
string response = ws.Method1( type1VO );
break;
case "2":
type2VO type2Object = ( new Deserializer<Type2>() ).XML2Object( XML );
ws = new WSProxy2();
string response = ws.Method2( type2VO );
break;
}
...
}
}
. , 15 , , . ( , ), , . , : , , .
, , "". , - , , . , , , "" , .
# .NET v2.0, , , . . , , .