-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
On Delete item cascading #146
Comments
The logic is straightforward: As long as a Contact is required by a Client, then it cannot be deleted. I think it's clear that the user does not want "cascading" deletion. So, test for The implementation in the current MVI architecture is not straightforward though. e.g.: Where should this test happen? In the intent or the data source? I chose the intent layer and implemented it for the deletion of contacts. @vlad-ed-git Please review my implementation. |
The View
The Intent
The Model (a.k.a data layer)
|
If you are wondering how the intent would know if a delete did not happen because of some other error or because the object being deleted is depended on by another, this is where error_codes typically come in. The IntentResult can define an error code (Error codes might be wrapped in enums for readability). |
Thanks for clarifying.
Somewhat missing from the picture is the role of an ORM (Object Relational Mapper). SQLModel already abstracts the concrete database implementation, something that would otherwise be handled by the DataSource. And it seems to me that with SQLModel the data format required by the UI and the data source is often exactly the same. So not much transformation going on in practice. |
@clstaudt To clarify this, "Somewhat missing from the picture is the role of an ORM (Object Relational Mapper)." The abstraction that the ORM is doing is not specific to the models of project Tuttle. In the same way that flet (which abstracts the implementation of a button) is not a replacement for the View layer of Tuttle. On the other hand, flet defines how a generic button looks and what events that button can listen to, and the ORM defines how a generic model can be stored in a table and how updating such a model is done. |
The text was updated successfully, but these errors were encountered: