I am developing an App for iOS. In an attempt to avoid the pure MVC where everything is packed in the “Controller”, I have added a Presenter layer and an Application Layer. In doing so I have come up with some questions that I need to clarify to do the things right. The questions are kind of conceptual, so it doesn’t matter whether I’m developing for iOS or not. The are about user interface updates.
1
I have a Data Manager which stores/provides data. I have a table that populates data retrieved from the data manager. Let say the user clicks “Delete row X”
Should I first ask the data manager to delete the data, and afterwards update the user interface table? Would it be a “bad practice” delete the row directly from the UI?
2
Let’s say, that in my table Row1 is a recipe name, and Row2 and Row3 are ingredients. If the user deletes all ingredients, I want to delete the recipe as well. Where this logic should be (In Presenter or in the Application Layer)? I want the recipe to be deleted from UI and from the Data Manger. Should the UI knows about that rule? Would that be a “Business Application” rule which should only be handled in the Application Layer?.