For several days do we not discuss about Magento Certification Exam. Today I will continue the Topic 1: Basic with the next part- Magento Module-based architecture.
Magento is built based on module architecture. All activities of Magento are processed by modules.
In this post we will talk about:
1. Describe module architecture
2. List steps to add a new module
3. Describe module limitations
4. Sample questions & answers
I - Describe module architecture
A built module of Magento may work following the structure: MVC (model – view –control) with functions of each are below:
- Model: is the element which works with data, stores and takes out data. Model will make sure data’s performance and accuracy.
- View: is the expression of data, showing changes of system to users.
- Control: is the element which controls interaction between view and model, processing application stream.
MVC in Magento:http://www.magentocommerce.com/wiki/...quest-flow.png
Besides, module in magento may be built based on EDA architecture to send and catch events in the system (EDA architecture has been mentioned in part 1- Fundamentals).
II - List steps to add a new module
To add a new module in Magento, we need at least 2 following steps:
Step 1: Register module with the system by naming file configure
Step 2: Create code in folder /app/code/local/Magestore/Test. Files needed for module will be shown in the next parts.
III - Describe module limitations
Limitations of modules:
- All activities of the system must go through modules and an action in Magento may involve some modules, thus the loading and running of Magento system is quite slow.
- Many modules work in the same system can lead to modules’ conflict.
IV – Questions
1. Q: When the system runs, does it load all files in module? If not, why when creating a new object or extend class from a class without including class’s source file, the system does not show errors?
A: When running Magento, the system will just load files including the class which we called.
Magento uses a magic function spl_autoload_register(‘name_function_autoload’); of PHP. When you create a new object or extend class from a class that doesn’t exist, the function name_function_autoload will automatically run before adding new or extending from a class.
The function name_function_autoload has parameter named class, so it’s the type function name_function_autoload(class). In Magento, from the name of a class, the system can immediately find the path and files including that class (due to rules of naming in Magento).
That’s all about dicussion today. Hope this tutorial able to help you in your exam.View more threads in the same category:
- Prevent an array filter warning while adding products
- Best Development Practices in Magento 2
- How to Secure Magento Against SQL Injections
- How To Backup And Rollback In Magento 2
- Implement Your Custom API In Magento Backend
- How to Create Simple Twitter Feed Module in Magento 2
- How To Secure cron.php In Magento 2
- How To Create & Configure Multi Store In Magento 2
- Create Your Own Widget In Magento
- Third Part of Magento Theme Development
Bookmarks