Truly Modular Architecture
Trongate applications exemplify truly modular architecture, sharply differentiating them from many traditional PHP frameworks burdened by pseudo-modularity and intricate dependencies. Unlike typical frameworks that rely on a 'vendor' directory managed by Composer for library loading, Trongate directly and independently loads modules. This efficient design minimizes overhead and streamlines the initialization process, leading to a significant performance increase as validated by independent benchmarks.
Modularity in software design refers to the practice of breaking down a software system into independent, interchangeable modules. Each module encapsulates a specific portion of the system's functionality. This design approach helps manage complexity, improve reusability, and enhance maintainability.
Understanding The Modules Directory
Within the operational parameters of the Trongate framework, the predominant quantity of code authored by a developer is strategically allocated within a repository known as the "modules" directory. This directory implements Trongate's HAVC (Hierarchical Assets View Controller) architectural pattern, which significantly enhances modularity.
What Is HAVC?
For developers with an understanding of the traditional MVC pattern, HAVC will seem familiar. It retains core components of MVC, such as controller files for application logic and 'views' for presentation layers.
With Trongate, each module within the modules directory, functions as an independent MVC cluster. Trongate modules are self-contained, yet they retain the capability to interact with other modules, as well as other parts of the broader application.
In addition, HAVC also allows the inclusion of modules within modules. This architecture gives developers the benefit of enhanced modularity and the flexibility to design applications that are both highly scalable and easy to maintain.
The graphic below demonstrates the typical structure within the modules directory. The two-way arrows in the graphic indicates the potential for bidirectional communication between modules. Significantly, Trongate modules have the ability to send and receive information from controller files as well as from view files.

HAVC vs. HMVC
Trongate's modular architecture shares some conceptual similarities with HMVC by introducing a nuanced form of hierarchy through the inclusion of submodules within modules. However, Trongate's structure remains significantly more flexible and less rigid compared to the strict hierarchical design typical of HMVC. This flexibility allows Trongate to blend the best of modularity and hierarchical organization, offering developers the advantage of structured code organization alongside the freedom to create more loosely coupled systems. Consequently, Trongate stands out as exceptionally adaptable and efficient, making it ideal for projects that require robust, straightforward solutions without the complex dependencies often associated with traditional HMVC frameworks.