Why aren't ASP.Net MVC Portable Areas Thriving Like Rails Plugins? [closed]
Asked Answered
R

1

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?
Reticule answered 14/3, 2011 at 20:10 Comment(3)
Not only portable areas are new, but ASP.NET MVC is also new for many people.Doubleness
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.Tammietammuz
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.Ailing
S
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.

Stole answered 14/3, 2011 at 20:15 Comment(11)
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.Reticule
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.Motionless
@jfar Thanks for that. I'm un-accepting this answer for now then.Reticule
@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. Here's a blog post which illustrates the problem that I meant and which is really an annoying missing feature in ASP.NET.Stole
@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.Motionless
@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.Stole
@Darin Dimitrov - You made my point for me. NuGet is much different than Portable Areas. They accomplish the same goals in totally different ways.Motionless
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.Reticule
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 ->)Colb
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".Colb
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.Alidaalidade

© 2022 - 2024 — McMap. All rights reserved.