Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django apps equivalent in ASP.NET MVC?

I currently develop with Django, but want to be ready when a future client inevitably requests a site done in ASP.NET MVC. While most of the structure and flow of ASP.NET MVC is more or less identical to Django and RoR, the one part I'm not sure about is the Apps methodology Django employs to make code reuse easier.

Is there an equivalent to Django apps in ASP.NET MVC? That is, can I create a feature, like tagging, comments, calendar of events, simple blog, etc. and bundle it up, making it portable to other projects with a minimum of glue code required to integrate it? Perhaps some kind of plugin or module system?

like image 584
Soviut Avatar asked Jan 03 '09 04:01

Soviut


3 Answers

Django doesn't follow the traditional MVC pattern, since they advocate that in the Web world, their MTV is more suitable. In the overall, I prefer Django over Rails because of the django apps. You can do almost the same in RoR with the Rails vendor plugins, but it's not the same.

ASP.NET follows RoR structure, and therefor you don't have the reusable apps. If you check the folder structure in a MVC project, you don't even find the RoR's Plugin folder, so I bet you should do it VisualStudio-Like.

Create a reusable app, as a separated project, include references for that project in your main one, and in your Route file, just redirect to the other project's controllers.

like image 125
Alcides Avatar answered Nov 05 '22 06:11

Alcides


This might be of interest as well: App Areas

like image 29
rodbv Avatar answered Nov 05 '22 06:11

rodbv


we've tried to do something similar, albeit from a different angle. we use compositional controllers for increased reusability in bistro, and an ndjango as the templating language. what we start to see is controllers become more granular, and as a result less dependent on where they reside - more componentizable.

like image 1
kolosy Avatar answered Nov 05 '22 05:11

kolosy