If you could add something to Kentico, what would it be and why?

Official support for "Feature Folders" pattern in Kentico 12 Mvc

When ASP.NET Mvc was first launched it was a significant change in project and framework design compared to Web Forms. Microsoft needed to place the Framework changes front and center for help developers understand the new pattern.

Now Mvc has been around for 10 years in the ASP.NET world and other patterns, especially in front-end javascript developemt but also in ASP.NET Core, have shown to be more scalable and maintainable.

Feature Folders is a pattern that supports focusing on business feature requirements in naming and file path conventions.

Developers rarely work on "Models" or "Controllers" or "Views". Instead they are tasked with working on "Features".

If I need to build out a new feature for the home page, in a traditionally structured Mvc application I need to find the right controller in the "Controllers" folder, the right view model in the "Models" folder and then dig through the "Views" folder to find the right view file.

Once I have all these open, if I'm adding a new route then I go and create files in each of these locations. There is no 'locality' connecting them - it isn't obvious visually what makes up a feature.

Feature Folders would argue that the HomeController.cs, HomeViewModel.cs and Index.cshtml for the HomeController.Index() action should all be in a folder together named after the feature (ex /Features/Home). It would also make sense to keep related services in this folder to if they weren't kept in a separate project (ex IHomeRepository/HomeRepository, IHomeArticlesQuery/HomeArticlesQuery).

ASP.NET Core fully supports a Feature Folders approach as an option for Mvc and uses it exclusively for Razor Pages with its /Pages folder.

The use of Feature Folders the ASP.NET community has been strong since MVC5.

http://timgthomas.com/2013/10/feature-folders-in-asp-net-mvc/
https://msdn.microsoft.com/en-us/magazine/mt763233.aspx
http://marisks.net/2016/02/16/feature-folders-vs-tech-folders/
https://codingsight.com/asp-net-core-mvc-feature-folders/
https://bojanv91.github.io/posts/2016/05/feature-folders-structure-in-asp-net
https://aspnetmonsters.com/2016/01/feature-directories/
http://kurtdowswell.com/software-development/asp-net-core-mvc-feature-folders/
https://scottsauber.com/2016/04/25/feature-folder-structure-in-asp-net-core/
https://haselt.com/blog/feature-folders-structure-in-asp-net-mvc

The benefits of this approach quickly become apparent with large applications trying to keep feature implementations isolated or with many developers working on separate features in a code base.

K. Scott Allen even developed a Nuget package for ASP.NET Core for easy Feature Folder configuration
https://github.com/OdeToCode/AddFeatureFolders

It would be very helpful to Kentico Mvc developers to be able to use this approach in their projects through customizing the Razor View Engine and have it be an officially supported solution by Kentico.

27 votes
Vote
Sign in
(thinking…)
Password icon
Signed in as (Sign out)
You have left! (?) (thinking…)
Sean Wright shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Password icon
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base