3. It depends on
the problem
you need to solve
Modular
Component
Component
Module
Plugin
complexity
4. Joomla!
application
architecture
Site Application
Components
Component name Component name 2 component name 3
Controllers Controllers Controllers
Helpers Models Helpers Models Helpers Models
Views Views Views
All components work together to build our site.
5. default
component
architecture
Component
Controllers Helpers Models Views
but for a complex component how does it work?
Lets think on a ecommerce component
6. software
ecommerce
component
functionalities
Catalog Promotions
Sales
Customers
Reports
…
How to start?
7. ecommerce software
component
functionalities
1. Separate your functionalities
2. List functionalities by “group”
Catalog Customers Promotions …
Manage
Products
Customers
Customers
Categories
Groups
Attributes
Attributes
Sets
Tags
13. understand
Jcontroller(Legacy)
getInstance
JController::getInstance(‘BASE_NAME’);
1. Will search controller.php file in a base_path
2. If not defined base_path will assume JPATH_COMPONENT
3. Your master controller name should be “BASE_NAME” + “Controller”
15. Understand
Modular component
Bootstrap.php
- Read Configuration from config/module.php
- Check if requested module are exists in folder structure
- Define JPATH_COMPONENT_MODULE with module path
- Define base_path as JPATH_COMPONENT_MODULE from JControllerLegacy
- Use as base_name “COMPONENT” + “MODULE”
18. File system
Default component
architecture
Attributes for Customers, Products ???
What relations between controllers ???
How to start to understand???
Questions?!
20. File system
Modular component
architecture
Attributes for products
Products Management
Tags for products
21. Understand
Modular component
Module file system
Repository of component modules
Component Module Name
Sub Controllers from Catalog Component Mod.
Helpers from Catalog Component Module
Models from Catalog Component Module
Tables from Catalog Component Module
Views from Catalog Component Module
Master Controller
22. Code
Modular component
Standards
Component + Module + “Controller” + Controller Name
Component + Module + “Helper”
Component + Module + “Model” + Model Name
Component + Module + “Table” + Table Name
Component + Module + “View” + View Name
Component + Module + “Controller”
24. Build your
Modular component
Example
This is a sample concept for development a complex software as a Joomla! component.
I’ve not interesting on continue development of this example.
The example its not fully implemented.
It just for show a better way “thinking out of box” How to build complex components.
If you use it, please feedback to community and share the solutions/problems that
you’ve found by using this architecture.
THANK YOU!
http://www.github.com/juliopontes/ecommerce-modular-component