Background
I have an Asp.net MVC 3.5 application that imports Products using a CSV file. CSV files can come from a specific group of configurable sources. To configure a new CSV source the user would initially specify which CSV columns map to which Product properties. This configuration will be stored as an import template and made available for selection thereafter when each import is performed.
I've run into a wall in attempting to plan the folder/object structure for this feature. I understand (and love) the flexibility of Asp.net MVC for routing so I know we could do just about anything here. However, I'd like any advice that would help us keep the object structure more sound and maintainable.
Initially I setup a Product folder containing an Import.aspx View. This seems to fit the controller/action model well enough. However, when I consider the features for managing the templates mentioned above, things get confusing.
EDIT: An Import Template can be applied to different objects. So Product is just one object that could have one or more ImportTemplates created for it. For example, another object that may have an ImportTemplate could be Customer.
Question
Should I create under the Product folder a subfolder called ImportTemplate and place the CRUD Views there? I would then add a custom route for Import Template functions. My concern here is the folder depth as well as the confusion with the sibling action Import. Or should the ImportTemplate be up a level and then use routing to place it under the Product folder? Sounds messy.
Maybe the folder structure should be Product/Import/Template. The problem I see in this case is that the Import is not really an object. I can see it being a controller but it is really meant to be the action. If I use this structure, should I place an Upload.aspx View in the Import folder (to replace the Product/Import.aspx mentioned above)? This seems to get a little clunky.
EDIT: With the added requirement above that an ImportTemplate can be associated with objects other than Product (i.e. Customer) would it be better to have the ImportTemplate folder directly under the Views folder?
Any alternative ideas for structuring this object/folder hierarchy?
Research
In an attempt to research this issue I reviewed questions about folder structure and depth. Here are several questions that had answers but really did not provide an answer to my question.
-ASP.NET MVC How many levels deep should a view or URL be?
-ASP.NET MVC 3 folder structures
-Strategy for Hierarchical MVC Routing
An Example
EDIT: A user regularly imports a list of products from a 3rd party. They are importing data from a CSV file that will be uploaded to the web site. They create/add an instance of a Product Import Template to their account. This template instance stores the following settings:
- The column named "title" in the CSV file should be imported to the Product Name field.
- Unrecognized categories under the "category" column in the CSV should be imported as "Unknown" category.
A different user may have different rules based on a different 3rd party CSV format or based on their own system configuration (i.e. they don't have an Unknown category setup as the user above).
- The column named "part number" in the CSV should be imported to the Product Name field and the Product Number field.
- Unrecognized categories should import by default into the "Generic" category.