I have inherited a badly architected and organised ASP.NET MVC application, which is an online booking system for healthcare providers. It seems to have been designed with very few object oriented principles used at all, and little abstraction or SoC. So, I am rewriting a lot of the backend code.
I have implemented Entity Framework 6 to replace the current direct database calls that populate DataTables that get returned by static method calls. I have created a Business Logic Layer (BLL) and a Data Access Layer (DAL) (in folders/namespaces in the same project, not as class libraries). I keep the database entity classes in the Models folder.
I am rewriting my Controllers as "thin" controllers that take application data, transform it if necessary and create BLL objects which perform all of the actions needed. The controller then manipulates the returned data into views etc.
Where should helper classes/methods be that manipulate the BLL object data for views?
I have a
BookableTreatments BLL class that contains all bookable treatments. The view requires an HTML Select element with an option for each treatment that a specific provider offers. So I might create a helper class
SelectListGenerator that has a method that takes a
BookableTreatments object and a
ProviderID and returns an IList that can be used to generate the HTML select.
Where should my
SelectListGenerator class be located? It isn't a controller, it isn't business logic as it is application specific. Should I create a new namespace and folder called ALL (abbreviation for Application Layer Logic, not the word "all") that contains just classes for this sort of purpose? I don't expect to have huge numbers of classes like this.
(Please note, I do have a
BookableProviders class that contains provider information, and I could have this class contain a list of treatments that the provider offers. So, I understand it may be better to do this and not have a list of treatments I need to filter for a specific provider, but that's an unrelated issue. And even if that is the case, I would still need to generate a select list for the view. So, the question still stands in its generic form)