Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginGeneral Tech Learning Aids/Tools 3 years ago
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.
No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
Kindly log in to use this feature. We’ll take you to the login page automatically.
LoginReady to take your education and career to the next level? Register today and join our growing community of learners and professionals.
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
Your experience on this site will be improved by allowing cookies. Read Cookie Policy
manpreet
Best Answer
3 years ago
I have a dll library TaskLibrary.dll with a class
Executionperforming someOperation(s) and a classParallelizeExecutionthat takes a singleExecution, clones it and executes theRunmethod of the multipleExecutioninstances.The
Clonemethod of theExecutionclass works by converting theExecutionin xml and reverting it back to normal as a new instanceThe
Executionclass is serializable as is each of the classes implementingOperation. This is obtained by using an abstract class (AOperation) which all theIOperationimplementations extend, using theXmlIncludeannotation to makeMyXmlSerializerwork for eachIOperation.Now I have a new project referencing the TaskLibrary.dll. I need to add a new kind of Operation to a
Execution:Everything works fine with a single execution, but when I use
ParallelizeExecutionOperation3is correctly serialized asOperation2thus executing an unwantedRunmethod. How can I add a new type ofAOperationto theExecutionclass and expect it to be correctly serialized and run in theExecution?OR
How can I avoid the problem without altering the way the
Executionclass is serialized?Caveat: I know that it is possible to use Reflection to xmlserialize any tipe extending a given one, but i'd rather learn how to do this using standard OOP (if possible).
EDIT: I could modify TaskLibrary.dll but I'd rather avoid this approach, it would void my efforts in learning new things and aiding the community, moreover it would be quite painful to redistribute the library to those already using it.