6

I love the idea of the Portable Areas in MvcContrib. After reading up on it, and building a couple for practice, I was surprised not to find a plethora of open source projects leveraging this neat way to distribute features across MVC applications.

Being a guy who has messed around with Rails frequently, I love that I can find a plugin for just about anything. (Comments, Authentication, Search, CMS, Logging, etc.)

However, when searching for Portable Areas, the only ones I see are the samples and an OpenId implementation.

Where is the love for Portable Areas?

  • Is it too new?
  • Is there something wrong with the architecture?
  • Is there just not as thriving an open source community as there is in Ruby world?
Brandon Joyce
  • 3,100
  • 24
  • 25
  • Not only portable areas are new, but ASP.NET MVC is also new for many people. – Max Toro Mar 15 '11 at 14:39
  • How can Nuget be used as a pluggable architecture? Could I design a CMS like DNN and use Nuget to drop modules into my app and into my menu system? I did not think that Nuget did this type of thing. – Nate Oct 18 '12 at 20:13
  • The FAQ says *'If your motivation for asking the question is “I would like to participate in a discussion about ______”, then you should not be asking here'*. As I see it, that is what we have here. – dmckee --- ex-moderator kitten Oct 19 '12 at 04:06

1 Answers1

8

While I cannot answer your question about why there isn't a plethora of plugins using portable areas because this is a subjective question I can tell you why I don't use them: because they rely on custom VirtualPathProvider which don't work if your site is precompiled and I precompile my web applications before shipping.

I use NuGet instead of portable areas and there begin to be a plethora of packages distributed using this technology.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • 1
    I also use NuGet and love it. However, I'm still surprised that a plugin architecture that specifically caters towards an MVC project wouldn't gain more traction. Maybe there just isn't a demand for it like I would expect. – Brandon Joyce Mar 14 '11 at 20:31
  • This is not true at all. Portable areas work with pre-compiled solutions just fine. I have a system in production right now with all of the views, controllers and models precompiled into an assembly. This is the entire point of portable areas. – John Farrell Mar 14 '11 at 20:32
  • @jfar Thanks for that. I'm un-accepting this answer for now then. – Brandon Joyce Mar 14 '11 at 20:35
  • @jfar, I think you misunderstood me. By precompiled I didn't mean embedding files into a separate assembly. That's perfectly possible with portable areas and it is what they are meant for. I meant precompiling your web site, for example with [Web Deployment Projects](http://johnnycoder.com/blog/2010/01/07/deploy-aspnet-web-applications-with-web-deployment-projects/). Here's a [blog post](http://sunali.com/2008/01/09/virtualpathprovider-in-precompiled-web-sites/) which illustrates the problem that I meant and which is really an annoying missing feature in ASP.NET. – Darin Dimitrov Mar 14 '11 at 20:42
  • @Darin Dimitrov - I see now. I still have another issue with your answer. ;) Comparing NuGet to Portable Areas is a bit of a oddball. Thats like raisins to grape vines. – John Farrell Mar 14 '11 at 21:50
  • @jfar, not at all. Personally I have written custom NuGet packages containing all the necessary templates and then all I need to do is to import this custom NuGet package to my project and it will setup everything automatically. It will bring all the editor/display templates to the project and it will setup stuff in web.config, do T4 transformations, add references, ... Same steps as `Add Reference...` to some assembly which you do with portable areas that contains the embedded views (2 clicks :-)) but with NuGet you get much more than a simple assembly reference. – Darin Dimitrov Mar 14 '11 at 21:51
  • 1
    @Darin Dimitrov - You made my point for me. NuGet is much different than Portable Areas. They accomplish the same goals in totally different ways. – John Farrell Mar 14 '11 at 22:16
  • I've re-accepted this answer as it does appear that there is a limitation with the VirtualPathProvider. I think using NuGet as the delivery mechanism for an MVC plugin would be great, but you're sort of starting from scratch to build that package. In Rails, you have a command 'generate plugin yourplugin' and you get a template that includes rake files, init, etc. All rails app specific stuff. @Darin Dimitrov, sounds like you've done some of that on top of NuGet. I'd like to see your code! I'm going to play around with this idea and see if I can come up with a NuGet MVC package template. – Brandon Joyce Mar 15 '11 at 00:21
  • I'd agree with jfar about difference between NuGet and Portable Areas. Confusion arises because of Portable Areas somewhat mixed responsibility. (to be continued with next comment ->) – Vasiliy R Mar 25 '11 at 05:11
  • Portable area concept plays a role of kinda MVC-specific plugin system foundation but as well, it tries to be a packaging mechanism. But NuGet is already a packaging tool that also provides a convenient way to deploy/resolve dependencies - it is somewhat plugin delivery system, not a plugin architecture foundation (which Portable Areas concept is - more or less). Which means we can definitely use both - Portable Area as a way to modularize/organize MVC app and NuGet as a way to avoid delivery/publishing/references resolution "by-hand". – Vasiliy R Mar 25 '11 at 05:12
  • 5
    A year later: we have NuGet to help get around that problem. Views can be packaged up and added to solutions easily, removing the need to embed them. Embedded views were partly an attempt to ease the deployment story with Portable Areas. – John Nelson Mar 09 '12 at 17:33