Basically, I need to know if I should continue trying to develop my mvc forum application or just move on. I will try to explain the issues I am having with it, compared to what I used to do. Look at them and tell me if i am wasting my time.
I joined this forum a long time ago, but really only started posting about two years ago. The circumstances surrounding that was the loss of my personal bsd machine. I used to host vbulletin forums for myself and friends. Since I could no longer do that, and am too much of a purist to install php and mysql on a windows machine, I needed an alternative. At first, I tried webforms. Yeah. Next, I moved to mvc, and have had a love-hate relationship with it since that time.
The first issue that I have problems with is organizational. Let’s assume, in a php app, there’s a folder called “AdminCP” with about 30 scripts, each one doing a specific task. For example, such script might include AddForum.php or EditUser.php and so on. All the admin level scripts would be in that directory.
With mvc, my first task was in creating repositories for all the tables (CategoryRepository, ForumRepository, etc). I then moved to the services, and this is one point where things start going goofy. I ended up with one Controller, one Service, and one Repository per table. That may not exactly be right.
The thought had occurred to me that I might need to create a more monolithic controller, such as AdminCPController, and all the affore mentioned scripts as actions, but that left me with one hideous controller.
The second issue is somewhat related to the first. The Category to Forum relationship more specifically. I wanted a left hand menu that reflected logical groups of options such as “Category Manager” and “Forum Manager”. Coding up the CategoryController.Manager action was easy enough, as was the Add, Edit and Delete actions. Where it get’s off though is when I go to the ForumController.Manager action.
It needs to list all the forums, grouped by category. But if you recall from above, the ForumController uses the ForumSerivce, which uses the ForumRepository. Without also passing in the CategoryRepository, I am not sure how to actually get the data I want, or in the format I want.
The two controllers seems to be colliding. If I am adding a forum directly to a category, do I use ForumController.Add(int categoryId) or CategoryController.AddForum(id)? These kinds of blurred lines are enough to make me see red after even a few short minutes.
The fourth issue is that I really don’t like the way the view system works. Actually, I do, I just dont’ think they went far enough. Only being able to pass a single model in to the view via the View() method just doesn’t cut it for me.
I would like to be able to pass in a variable number of things. For example:
public ActionResult Something()
return View(new ThisThing(), new ThatThing(), new OtherThing());
And have the view directive read:
System.Web.ViewPage<ThisThing, ThatThing, OtherThing>
where they are auto-exposed as:
Anyway, I’ve taken up way too much of your time, and my own, in writing this. I’m just tired, there are too many trees, and I get lost in the forest very easily.
As smart as I am, I am quickly coming to the realistic realization that I am not cut out for this.