MVC (Model-View-Controller)
The most-common, traditional approach where files are grouped by type. CodeIgniter 3 uses MVC.
Characteristics: Centralized folders for all Controllers, Models, and Views.
Best For: Small to medium-sized projects.
Pros: Very simple to set up. You literally can't mess this up.
Cons: Might become serabut as the project grows. Still usable though.
Directory Example:
HMVC (Hierarchical Model-View-Controller)
An evolution of MVC. Further organizes files into modules.
Characteristics: Each feature has its own folder containing its own MVC structure.
Best For: Medium to large-scale projects.
Pros: Much cleaner folder structure. Can easily be moved or reused in other projects.
HAVC (Hierarchical Asset-View-Controller)
A specialized variation of HMVC, popularized by the Trongate framework.
Characteristics: Replaces the "Model" folder with an "Asset" folder.
Structure: Everything specific to a module, including models, CSS, JavaScript, and images, is stored within the "assets" sub-folder.
Pros: Designed to make modules completely self-contained, including their front-end dependencies.
Cons: Literally no other framework use this.
Comments
Post a Comment