2

I'm currently working on a relatively large MVC project I would like to organize vertically.

Why break convention? And, in more detail here

As far as implementation goes, the plan is a VirtualPathProvider. My question is, what would the best way be to give this VirtualPathProvider knowledge of the feature folder names?

e.g. ~/Features/{Feature}/View1.cshtml

Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
Daniel Harvey
  • 381
  • 5
  • 16

1 Answers1

2

If you plan to do this, I would definately NOT use a VirtualPathProvider. The reason is that path searches are expensive. The more paths you have, the longer it takes to find them.

I would instead specify paths directly. You lose the convention aspect, but you gain performance.

Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
  • So, just to clarify, you mean specify each of the View paths individually? If this is the case, areas are probably a more elegant solution. I was thinking it might be as simple as the controllers inheriting from a feature-specific base controller or something along those lines. – Daniel Harvey Mar 06 '12 at 02:59
  • 1
    A VirutalPathProvider provdes the paths that are searched when you specify a view without a path. If you have a lot of paths, it takes time to search them. The more paths, the longer it takes. It all depends on how many paths you intend to have. – Erik Funkenbusch Mar 06 '12 at 03:11