Friday , July 20 2018
Home >> All tutorial >> Magento Certification Exam Tutorials (Part 2)

Magento Certification Exam Tutorials (Part 2)

Topic 1 – Part 2 : Magento module-based architecture

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.

Magento tutorial

MVC in Magento:http://www.magentocommerce.com/wiki/_media/general/doc/page-request-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 (e.g. file Magestore_Test.xml into the folder /app/etc/modules/. File Magestore_Test.xml with the content like this:

<?xml version="1.0"?> 
<config> 
<modules>
<Magestore_Test>
<active>true</active>
<codePool>local</codePool> 
</Magestore_Test>
</modules> 
</config>

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.

Related post:

Magento tutorial for beginners (Part 1)

Here is the library of Magento Download for FREE (all versions)

Your Magento website needs a powerful Magento ERP for stock control.

DON'T MISS THE CHANCE!

magento erp

About Champ

One comment

  1. Magento certification exams are quite difficult. I will refer your tutorials to my friends who do not have the certificate yet to save myself from the hassle of creating a new tutorial for them. Hope to come back for more. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

Heap | Mobile and Web Analytics