With the changes in the programming landscape I am at a loss on methodology and which is best for the problem I am working on. Principally, I work in C# and WPF but I can go pretty much anywhere. I am converting something from a legacy library I have where I have 2 versions - one in C (which itself was an upgrade from Assembly) and another in Delphi. Enough for context.
Question: I need a pattern given VS2019 (default config) that is all Microsoft that will allow me to start with a base object (complex), make conditional changes to that object and be able to, in code, compare the results of those changes. Paring down the original it did something like this:
Original Object: Scheduled work completes in 12 days
**Mod step 1**
Using Pete's changes: complete in 14 days - 10 if you double resource Y
Using Lora's changes: Complete in 11 days - 9 with 20% addition to resource X and Y
Using John's changes: complete in 16 days - resources balanced, 15% cost reduction
This worked by copying the original object and passing it through various functions and making comparisons along the path. The base object here is rather complex.
I have wasted a lot of time doing guess-and-check on my own and I am looking for an article, method, rock to look under that will get me thinking in the right way about the problem. Please help if you have worked on this kind of algorithm/model before.
I have something that works but it is a memory pig, overly complicated and horribly slow. As I am fond of saying - "there is too much code for it to be right"
Additional note Thought of something else I should add. The base class definition here is Serializable and one thought I had was to simply serialize each version within a structure that held markers of what changes were applied and then Deserialize each instance and compare. This would allow me to surface the resulting set to users who could then compare (using something like LINQ as an inquisition method) and propose additional changes or take some other action.
Aucun commentaire:
Enregistrer un commentaire