The principles of SOLID programming

Share
Posted on May 7th, 2011 | Posted by admin

Hello there! Today I’ll be explaining The principles of SOLID programming. When I first got serious about OOP, I jumped to design patterns, but then I realized that everyone need a good grasp of the SOLID principles before you’re ready to tackle Design Patterns – in more of an Architect role – that is. So, to conclude this short introduction, I’ll try to explain this in as low-level of knowledge as possible.

Well, yous should know that SOLID stands for:

  1. Single responsibility principle
  2. Open-closed principle
  3. Liskov substitution principle
  4. Interface segregation principle
  5. Dependency inversion principle

Misuse of helper classes in Magento?

Share
Posted on May 6th, 2011 | Posted by admin

In its MVC structure, Magento allows you to throw in additional classes that might not fit in strictly under the MVC “letters”. One example of these classes are helper classes. These are usually used to isolate a certain, possibly useful, algorithm. Algorithm whose usage would be overhead to write a model as it is more static and general in nature, meaning there is no point in applying it to given instance of an object.

Calling a helper class from almost anywhere in your PHP code is extremely easy.

Understanding PHP’s OOP – basic terms explained

Share
Posted on May 6th, 2011 | Posted by admin

Hello there! I’ll explain some basic terms of PHP’s Object Orientated Programming terms that any developer needs to know. Perhaps you already use all of those, but if you don’t know which is which, you will have a problem in team communication. If so, please read on.

First of all, to understand any PHP OOP concept, you need to know the PHP basics. Then I need you to read and understand next paragraph – Procedural vs OO Programming:

Procedural programming creates a step by step program that guides the application through a sequence of instructions. Each instruction is executed in order. Procedural programming also focuses on the idea that all algorithms are executed with functions and data that the programmer has access to and is able to change. Object-Oriented programming is much more similar to the way the real world works; it is analogous to the human brain. Each program is made up of many entities called objects. Objects become the fundamental units and have behavior, or a specific purpose, associated with them. Objects cannot directly access another object’s data. Instead, a message must be sent requesting the data, just like people must ask one another for information; we cannot see inside each other’s heads.

Works out of the box!

Share
Posted on May 6th, 2011 | Posted by admin

Every now and then someone in the social web world asks for eCommerce solution recommendation. One of the awesome trends I noticed in these answers is the answer of a “happy customer” that goes something like this:

I tried XYZ and it’s awesome! You should try it two. I don’t understand any of this HTML, php, CSSS mumbo-jumbo, but this XYZ cart works out of the box!

The sad part is, people tend to fall for that. What’s bad with it “working out of the box” you ask? Well, most of the open source carts I ever saw work “out of the box”, including Magento. Certain features, however, require additional set-up, and some even advanced custom development.

Keeping your Magento fit with built in profiler

Share
Posted on May 5th, 2011 | Posted by admin

Default Magento installation has this great feature called “Profiler” that can play important role with your custom Magento development. This feature is meant to be be used for developer only. If used properly it can help you get valuable information of certain code parts during development.

To turn the “Profiler” on you have to do two things:

  • Login to your Magento admin, go to “System > Configuration > Advanced > Developer > Debug > Profiler > Yes
  • Open your root index.php file of your Magento installation then look for commented