-
Notifications
You must be signed in to change notification settings - Fork 110
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
🐛 Not a Bug Report: There are two different Account classes #93
Comments
Perhaps it is between bug (usability) and enhancement. |
@vrescobar this is the downside of language that doesn't support namespace. We don't want to switch to |
I can totally understand your point, and yes, I also import it as models. However still a week after, having a class instance that returns an object of a class with the same name lead me to many subtle messes during this last week, even being aware of it.
Another option could be renaming the user account to User or Profile, perhaps that could also make sense in the other frameworks as it is often recommended in semantic maps to have different names for different concepts.
Sure that you may want to just close here now this not-a-bug report as many more options aren’t there, but here lays my feedback.
Atentamente/ Kind regards/ mit freundlichen Grüßen
Víctor R. Escobar
vrescobar.com
… On 21. Sep 2022, at 04:38, Damodar Lohani ***@***.***> wrote:
@vrescobar this is the downside of language that doesn't support namespace. We don't want to switch to AccountService for the sake of consistency across our SDKs and platforms. And we don't yet have a better solution than this where you can import import package:appwrite/models.dart as models to avoid name clash. Let us know if you have other better suggestions, which can help us be consistent and provide better usability as well.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
I feel consistency must come second if it causes way worse side effects like code that does not compile and needs extra code in many places. |
I totally agree with this, code generation and consistency is great, but this inconvenience is really not very pleasant |
we can access the Service class by defining a custom Type for the Account.
Using the above approach would solve this issue and also it won't affect existing written programs that use this class. i want to contribute. |
The SDK now uses
|
👟 Reproduction steps
There are two accounts: models.Account and appwrite.Account
👍 Expected behavior
While this is not an actual bug, it is annoying to say the least, and usually a bad practice. I would like to propose to refactor appwrite.Account (services/Account.dart) to AccountService and avoid name clash in the files that both definitions are needed.
👎 Actual Behavior
Unambiguous naming is hard, and I ended up with quite long refactoring due autoimports and large misunderstanding.
🎲 Appwrite version
Version 1.0.x
💻 Operating system
MacOS
🧱 Your Environment
Flutter
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: