none
Best way to organize back-end for .NET project I'm doing(C#) RRS feed

  • Question

  • I am currently working on a large project. This project has about 20 relevant tables that are all related. I have a back-end set up where Admins can add new items, edit them, view them etc....

    I took this project over from someone else, so in the interest of getting things done in a timely fashion, I'm currently handling everything in 2 pages.

    The basic layout of both pages is a sidebar including 17 different categories(Products, Brands, Users etc...), with the content of the page displaying the relevant info for the selected category.

    I am using the first page to display the info. When I click on say Products, the products load in a table from new to old, paginated in the content portion with options to edit/delete for each, as well as an option to add a new item.

    I'm handling the delete on this page, but the edit and add are on the second page.

    The second page is the same layout, but the content portion will either be a blank form with the relevant fields, or those fields pre-populated for the item from the edit command on the previous page

    Now, I am doing this for all different categories in the code-behind of each page. Even though everything works well, and is not even slow really, I don't like the lack of organization, even though the different categories are clearly separated and organized properly in the code-behind.

    I'm wondering the best way to divide this up. 

    Should I just make a page for each category and have each of those pages handle both displaying as well as editing/adding? Then I can share the common functions through a central base page?

    Or should I make use of the ASP user controls, and create a control for each category to handle this stuff, again sharing a base control?

    I'm just not sure which is the most efficient, or even the more standard way to approach this. I'd like to get some feedback before I decide how to break this down, and would appreciate any other suggestions as well.

    Thanks

    Wednesday, November 23, 2011 3:39 PM

All replies

  • Hi

     

    What i can see here is, Functionality is same , edit/addnew/delete, but only entity changes.

    probably on new/edit/delete you may have rules bound based on category right?

    I would suggest have base class that can have common functionality across category, and for each category seperate page that injects category specific functionality, so that SOC is satisified. and you will have a cleaner code.

    hope this helps you...


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".
    Thursday, December 1, 2011 12:57 PM
  • Yeah that's pretty much what I was thinking, and am ultimately going to do I think. Thanks for the response
    Friday, December 2, 2011 2:18 PM