For people who have experience with Portable Areas,
I would like to know if there are disadvantages to using them and why you wouldn't use them to break a large MVC application down into component parts.
For people who have experience with Portable Areas,
I would like to know if there are disadvantages to using them and why you wouldn't use them to break a large MVC application down into component parts.
Let's start with the
Definition:
A Portable Area
is a dll that contains items
that would normally be part of your solution. Portable Areas contain Views, Controllers, Models, even JS Scripts, CSS files and images.
Ideally, the items
in your Portable Area work together to create cohesive functionality. If not, you are probably not benefiting from having a Portable Area.
Benefit
I compare Portable Areas to Web-Forms Web Parts
because they are both an attempt to answer the question:
How do I create re-usable functionality?
You will benefit from Portable Areas if you want to create functionality to be used in multiple projects, or distributed as functionality to be consumed by 3rd parties.
Disadvantage
Every time you make a change to any View, JS File, CSS File, or image within your Portable Area, you will need to rebuild it. I emphasize these components because they do not normally need to be rebuilt when being tested or developed.
This can become a problem. If you find yourself re-building every time you tweak CSS, 30 second changes become 2 minute changes. Make 30 of those and you've stretched 15 minutes worth of work into 2 hours.
Portable Areas are meant for mature functionality to be re-used in multiple projects or solutions as-is.
Portable Areas are not ideal for functionality that is in early development stage.
Portable Areas are not ideal for functionality that exists in only 1 solution or project.
Many things have already said. I have some experience in working with Portable Areas, and here is my personnal point of view.
MvcContrib has not been updated since one year (see nuget). If you take a look at codeplex, you will see that there were not so many updates in source code since the last release. It may be mature, but no support can be problematic.
A portable Area is self contained in a single assembly. It's easier to reuse and to upgrade for sure, but the challenge is how do you allow enough control over the User Interface by the client application. Even if it's a reusable feature, you sometimes still want to use master layout or partials.
All web ressources (CSS, Js, Views) have to be Embedded Resources (included in dll) . This means that it's really really a pain to dev/debug because each code modification requires a rebuild. In addition, you need to client web site to host the portable area.
Portable Areas use a Custom Virtual Path Provider. The Custom Virtual Path Provider code is untested and completely untestable. The use of Virtual Path Providers are discouraged by the ASP.Net team as they can cause performance problems.
Portable Areas Vs Nuget Packages. Portable Areas were designed four years ago (before Nuget).Portable Areas solved the ability to easy transport, view and assets(Css, javacript) files into a separate application. Nuget has also solved this problem.
However even with all of these disadvantages, my team is still using it. Why ? because it was the right solution at the right time for us.
© 2022 - 2024 — McMap. All rights reserved.