Magento Expert Forum - Improve your Magento experience

Results 1 to 2 of 2

Magento module-based architecture

  1. #1
    Junior Member rocker's Avatar
    Join Date
    Mar 2013
    Posts
    105
    Thanks
    3
    Thanked 11 Times in 9 Posts

    Cool 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.


    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:


  2. #2
    Administrator david's Avatar
    Join Date
    Nov 2012
    Posts
    261
    Thanks
    22
    Thanked 42 Times in 34 Posts

    Default

    Thanks rocker, we got a good share

Similar Threads

  1. Magento Module Development - Part 6 - System.xml Advance and Module
    By rocker in forum Programming & Development
    Replies: 1
    Last Post: 29-05-2013, 12:10 PM
  2. Magento Module Development - Part 5 - System.xml and Module
    By rocker in forum Programming & Development
    Replies: 0
    Last Post: 29-04-2013, 02:25 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •