Magento Modules
Modules are the core of Magento. Every action on the site, frontend or backend,
goes through a module. Modules act as containers for one or more of the following:
settings, database schemas, rendering objects, utility helpers, data models, or
action controllers. A module can be made of all six of these things, or just one.
Modules are defined as being on or off in an XML configuration system located in
app/etc/modules/. Each module can specify its own settings in an XML file as well,
located under themodule’s etc/ directory.
Since everything in Magento is a module, and modules have self-contained configuration
and database settings, this allows you, as a developer, to extend Magento
exactly as the core system is built.
Module Structure
Belowyou can see the directory structure of the Catalog module. The catalog module
contains all of the aspects of a module.
- Mage/
|- Catalog/
| |- Block/
| |- Helper/
| |- Model/
| |- controllers/

| |- etc/
| – sql/
Code Pools
Modules are located in one of three code pools. The code pools are: core, local, and
community. All of the modules distributed with the base Magento are in the core
code pool. All of the custom modules that you develop can be installed in the local
code pool. The community pool was originally designed for installed third-party
modules, but this idea might be phased out, as you can simply install any module in
local as well as community.
- app/
- code/
|- local/
|- community/
- core/
Module Packages
All models exist under a package directory. The package serves no purpose other
than to allow for consistent naming of classes. All Magento modules are part of the
Mage package. Thus, all Magento class names begin with Mage_. It is an acceptable
practice to create a new package for your custom modules that has the name of your
company or organization instead of Mage. There is no functional detriment when not
using Mage as your package.
Models
Models are the muscle ofMagento. They help move data from the database into the
program itself. The output, or rendering, of the data is done by the Blocks, but the
models are mainly responsible for manipulating the data. Models, in any programming
environment, help to identify and shape data domains. What this means is that
models draw boundaries between definitions of data groups and relate data groups
to other data groups.



Author:
admin
Tags:
Tags:, , ,
Category:
Magento
Comments:
You can leave a response, or trackback from your own site.
RSS:
You can follow any responses to this entry through the RSS 2.0 feed.
Navigation:

Comments are closed.