DEV Community

Discussion on: Code Like a Conversation: Basic Levels of Abstraction

Collapse
 
courier10pt profile image
Bob van Hoove • Edited

ASP.Net MVC also has a directory structure that reflects the architecture. Like:

Controllers/
Views/
Models/

I've grown to dislike that approach since things get cluttered easily. For every 'topic' in your application you'll spread files among those folders.

Since you're storing your project on a filesystem, you get 1 hierarchy to choose.

If you go for the architectural divide. It helps you to familiarize with the architecture. And it looks neat with the folders collapsed.

If you go for the topic divide, you'll have all related files together whenever you work on them. That's pretty convenient.

Let's try and demonstrate this with a made up project folder:

README.md
BaseDAO.xyz
Project/projects.json
Project/project.html
Search/LuceneIndex.xyz
Search/SearchService.xyz
Search/Index.template.xyz
User/User.xyz
User/UserController.xy
User/UserService.xyx
User/UserDAO.xyz
User/Templates/Edit.template.xyz
User/Templates/List.template.xyz
User/Templates/Search.template.xyz

Where .xyz is your language of choice.

[disclaimer]
Maybe I'm comparing apples with pears... Bit unsure if I know enough about React to tell.
[/disclaimer]