Posts tagged ‘Models’

Models

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.

To help illustrate the idea of data modeling imagine creating a shopping cart system and that you want to have a Product class. This product should have an image associated with it. But, the question is, how does that image get modeled? Do you simply give the product one $image_url variable? Perhaps it is best to link the Product class to an Image_Gallery class and create linking methods between the two, e.g. getDefaultImage. The resulting model classes are the end result of your decision on how the data interrelates.

September 10, 2009 at 3:14 am Leave a comment


Recent Posts

Categories

Archives

Top Posts

    Top Rated

    Blog Stats

    • 6,373 hits

     

    June 2012
    M T W T F S S
    « Sep    
     123
    45678910
    11121314151617
    18192021222324
    252627282930  

    Follow

    Get every new post delivered to your Inbox.