Information générale
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Network:
Windows 2003 Server
>>As to the parameter, my thought was that by using a struct you are passing in a single parameter object and that object will have fields of only the proper types. While it is true that does not otherwise validate the values, it does go a long way to remove param checking from the responsibility of the method it is passed to and can be handled elsewhere as the params are assmebled.
>>
>>The idea of passing in something like XML as a param sets my teeth on edge. ( though I suppose you could validate its creation elsewhere, you still end up parsing it out in a way that makes the receiving method clutter with stuff that would have to be duplicated anywhere that param was used.
>
>The XML string with parameters is passed from another application (written in C++) which we're not going to change. We're only re-writting one piece which is currently in VFP those job is to accept these parameters passed as XML (along with the method name in func MethodName /func) and execute it and return back either XML or a string.
>
>So, C# dll will receive the parameters the same way (as XML string) and needs to produce exactly the same output as VFP applicaton was producing.
Sure, but you can still receive the XML in your method, parse it into an object, and then pass the object to another method, thereby delegating the actual business logic to one method and the XML interface to that logic in another method.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement