I need to create DTO objects which holds simple properties and needs to implement the following functionality:
- Load From XML node
- Save to XML node
- Clone
Programming these function is each DTO over and over again would be very tedious and error prone I think so I though about alternatives.
- Use Reflection, would be very slow I guess
- C# Code generation as pre- or postbuild step (both would require building the solution twice, since I need a compiled class to get info which code to generate)
- Use CodeDom? I think this is the most complicated solution
What is the best/simplest common way to accomplish such a task? How Can I determine which one to chose or are there alternatives?
Aucun commentaire:
Enregistrer un commentaire