C
C#β€’2y ago
N0mlss

❔ Should I separate the add and edit page in a web app?

Ive always combined the add and edit page since the html is the same in both page. Depending if i had a query string or not, i would call the edit or create function on the save button click of the page Someone last year told me that since create and edit are two different business logic, it should be two different page. Im now currently following this guy formation on blazor and he is separating the add and edit page. Here is the link to the udemy course: https://www.udemy.com/share/106UZ03@Tu1_uv6DDidhaejhbMirJ6450fEFQYgK2MlulExVKOZBkW1H-b5oEsXh-0kluNCs/ My question is, should the add and edit page be separated? If so, isnt it bad since if we make a change, we need to duplicate the change in both page? And the page is the same exact html and css, so we need to duplicate it as well? Please enlighten me on this πŸ˜‚πŸ˜­
Udemy
Learn Blazor while creating an Inventory Management System
Create an App with .NET 6, Blazor Server, Entity Framework Core, ASP.NET Core Identity
8 Replies
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
N0mlss
N0mlssOPβ€’2y ago
This is how i used to think before having a talk with another developer and then following that formation. Their main argument is "Single responsibility principle" which I understand, but the cost of doing that is that we have to double the code where it is not necessary :/
Unknown User
Unknown Userβ€’2y ago
Message Not Public
Sign In & Join Server To View
N0mlss
N0mlssOPβ€’2y ago
Welcome to the club, ive been thinking about it for a week straight…
djibouti
djiboutiβ€’2y ago
I'm unfamiliar with Blazor but is there a concept of building re-usable components? At least then you could pass in whatever add or edit functionality you need to a component without duplicating that UI layer Apologies - I reread and see now that you're essentially doing that already. Personally I think that approach is perfectly fine. The logical separation is in the objects you pass down.
N0mlss
N0mlssOPβ€’2y ago
I could use the same page for the add and edit but depending of what i need to do, i would pass a different component. The problem still remain the same: the UI in the edit component and the UI in the add component are the same, so its the same html, same css. The only difference is that i would pass the information in the edit component. So why are people dividing the add and edit page beside the "Single responsibility Principle"?
djibouti
djiboutiβ€’2y ago
πŸ€·β€β™‚οΈ I can't answer since this isn't a case I would worry about that.
Accord
Accordβ€’2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server