Help
Customer Support | Forums

Architecture

LiveCart code is structured into a Model-View-Controller (MVC) architecture, which means that the application is basically structured into three distinct layers that provide separation of presentation logic, business logic and data:

  • Model - represents business entities: products, categories, orders, users, etc. - and provides means to access and manipulate object data. LiveCart model classes implement Active Record pattern, which allows to completely abstract the database operations.
  • View - generates application output. In LiveCart views are simply Smarty templates.
  • Controller - works as a glue between a model and a view and defines application behavior. In essence, main controller responsibilities are to read/change model state and pass model data to view for displaying.

Such architecture allows to achieve a great code separation by responsibility, which provides several additional benefits:

  • Enforces clean and organized code structure.
  • Easy to make changes - one doesn't even need to touch business or model logic code when it's only necessary to modify the presentation template.
  • Different methods of presentation for the same data are possible (just change the view to return data in XML, for example).
  • Possible to extend application behavior without a need to change Controller code. The Controller passes the data to View through an intermediary Response object, which can be altered before it reaches the View.

User Contributed Notes

1 comment received. Add your comment.
  • Well sniff, sniff Thank you so much for the very beautiful words Meg. We feel eqllauy as fortunate to have your family in our lives. Over the years as Keith and I have watched you and Steph grow into the beautiful women that you are we have hoped that Ry and Ty would take note and learn from your motivation, determination and easy going personality!We are very excited for the success you are having with your photography. We love your shots, your blog, your website everything is so YOU! We LOVE our Maui shots Secret Beach is the perfect place for a family shoot. And you got Ty to smile! I can't get him to smile for the camera ever!We are also so happy that you and Scott found each other. We have had so many good times with you guys. Cheers to many more!!