-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Refactor product preferences and matching into openfoodfacts-dart #140
Comments
Maybe we can embed them in the lib folder of the openfoodfacts-dart package: https://medium.com/flutter-community/including-assets-in-a-flutter-package-dd4a82a38ca9 |
@stephanegigandet Fair enough, that's a possibility. Assuming that at least the English version is loaded. |
Hi @monsieurtanuki , I'd like to work on refactoring the product ranking into openfoodfacts-dart, is that ok with you? |
Hi @stephanegigandet! That's fine by me, but if needed I can devote time to this. What is very important now I think, is to agree that the current class naming stinks (same name as another preexisting classes for
If we agree on new names, I can refactor smoothie. And then let you insert the new classes into openfoodfacts-dart. Then someone will remove the classes from smoothie and use off-dart's classes instead. |
It would be great to find good names indeed. If we can find names that also match the JS implementation (or we can also change the JS implementation), it will make documentation etc. much easier as well. That's also the reason why I try to have openfoodfacts-dart use the same names as the API, otherwise it makes things difficult to track across implementations in all the different languages. Match => ProductMatch sounds good to me. RankedProduct : I'd prefer MatchedProduct (as it's not ranked yet, just scored). But in fact I wonder if we need an extra RankedProduct structure that just contains a Product and a Match. Could we just use the ProductMatch class? We keep the same arguments for the ProductMatch constructor, and it returns a ProductMatch with a product getter. In fact a ProductMatch could be a child class of Product maybe. UserPreferencesModels : in the JS library I named I simply named it ProductPreferences. Would that be ok? PreferencesValue : PreferenceImportance (without a s for Preference) What do you think?
That would be perfect! |
feature/#140 - refactoring PreferencesValue into PreferenceImportance
@monsieurtanuki : if you are done with your changes, I can try to move things to openfoodfacts-dart this week-end |
@stephanegigandet That's OK with me. If I find something to be changed, I'll say so in the OFF-dart code review ;) |
…-to-openfoodfacts-dart Move personal search preferences and match to openfoodfacts-dart #140 (uses new openfoodfacts-dart module, ready for review)
@stephanegigandet I think we're done with this one, aren't we? |
I think we're done here. |
Concerns:
match.dart
(should probably be renamed, asMatch
is already in use by flutter) (ProductMatch
?AttributeMatch
?)ranked_product.dart
toouser_preferences_model.dart
, which includes classesUserPreferencesModel
(to be split - e.g. we cannot embed'assets/metadata/init_preferences_$languageCode.json'
anymore) (could be renamedAttributeImportanceManager
?) andPreferencesValue
(probably to be renamed to something less vague) (AttributeImportance
?)The text was updated successfully, but these errors were encountered: