Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Serialize/Deserialize functions never used in StandardCalculatorViewModel, UnitConverter and UnitConverterViewModel #370

Closed
rudyhuyn opened this issue Mar 24, 2019 · 1 comment · Fixed by #392
Labels
codebase quality Issues that are not bugs, but still might be worth improving (eg, code hygiene or maintainability) fixed Pri: 3

Comments

@rudyhuyn
Copy link
Contributor

rudyhuyn commented Mar 24, 2019

Describe the change requested

StandardCalculatorViewModel as well as UnitConverterViewModel and UnitConverter contain custom binary serializers and deserializers never used by the application. I suspect they were used a long time ago when the app lifecycle model was more restricted (Windows Phone 8/8.1?).

These unused functions make it harder to add features or refactor these 3 classes, especially due to the format used (custom binary serialization).

A big part of the information saved by UnitConverter for example is not relevant or is redundant:

  • CurrentCategory is already saved in LocalSettings by MainPage
  • FromType and ToType are already saved by the function UnitConverter::SaveUserPreferences (in file) as well as by UnitConverterViewModel::SaveUserPreferences() (in LocalSettings)
  • ratioMapTokens is based on static data (for unit conversion) or data already backed up by CurrencyDataLoader

Prerequisite
Be sure Microsoft doesn't use these functions in tools or code not in the git repository (integration tests, tools used by QA, etc..)

Functions no longer used we can remove

  • CalculatorManager::SerializeCommands
  • CalculatorManager::DeSerializeCommands
  • UnitConverter::StringToCategory
  • UnitConverter::StringToConversionData
  • UnitConverter::ConversionDataToString
  • UnitConverter::Serialize
  • UnitConverter::DeSerialize
  • StandardCalculatorViewModel::Serialize
  • StandardCalculatorViewModel::Deserialize
  • UnitConverterViewModel::Serialize
  • UnitConverterViewModel::Deserialize
@grochocki grochocki added the codebase quality Issues that are not bugs, but still might be worth improving (eg, code hygiene or maintainability) label Mar 25, 2019
@MicrosoftIssueBot
Copy link
Collaborator

This is your friendly Microsoft Issue Bot. I've seen this issue come in and have gone to tell a human about it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
codebase quality Issues that are not bugs, but still might be worth improving (eg, code hygiene or maintainability) fixed Pri: 3
Projects
None yet
4 participants