开发者

What Patterns Should I Apply to ASP.NET MVC Areas?

开发者 https://www.devze.com 2022-12-28 01:25 出处:网络
What is the best way to model MVC Areas for my Application? Can开发者_JAVA技巧 I manage these Areas dynamically? What is the best usage of them?

What is the best way to model MVC Areas for my Application? Can开发者_JAVA技巧 I manage these Areas dynamically? What is the best usage of them?

Thanks


What is the best way to model MVC Areas for my Application?

Areas have been "out" for less than one month (?) now. I don't think best practices have been developed yet. ;)

Can I manage these Areas dynamically?

You can turn them on dynamically with any technique you want but turning them off is a pain. Areas cannot be turned on and off without recycling the App Pool they are living in and re-registering again.

What is the best usage of them?

Areas out of the box are basically organisational tools. They help you keep a Controller and View folder from getting too huge and play a small part in keeping your routing configuration concise.

However using areas to make sharable components, like Portable Areas does,is a pretty killer technique that opens up a whole ton of compartmentalization and code reuse scenarios. Think of Portable Areas as taking an entire MVC site from soup to nuts and making it sharable with every other MVC site.

0

精彩评论

暂无评论...
验证码 换一张
取 消