Ruiwant
Ruiwant

Reputation: 417

How to read Magento(or OOP like software) core code?

I am a Magento developer, half year experience on Magento develop. While the theme is easy to make, but it's hard to me to make a real mature module.

I read lots of tutorial about Magento develop, such as Alan's Magento tutorial. I learned lots about Magento core from those tutorials, but I have no idea while a new project in front of me.

I am confused by everything about it. This is my first job about PHP, I had no much experience in OOP system development. Do not let me out of there. I just want to know, how can I do better to read the Magento core!

Thanks very much in advance!

Upvotes: 0

Views: 1124

Answers (3)

Vinai
Vinai

Reputation: 14182

Take your time

Make sure never to give estimates at the beginning. Even simple things will take long. My first extension took 2 weeks for a task that now, with years of experience, would take 5 minutes.

Other then that, hang in there. It will get better. Just like practicing a sport discipline. Always try to understand what you are doing, don't revert to copy&paste code.

Hang out on IRC in #magento on irc.freenode.net ans help answer other peoples questions. Nothing teaches Magento as well as helping others.

And finally, if you have the funds, go to the Magento U Fundamentals of Magento Development training. If you don't have the funds, register for the (currently free) on-demand video of the training and look at all of it, working along in your own IDE.

I also second what Jevgeni said. As an IDE I recommend Netbeans or PHPStorm, if you don't use one already.

Upvotes: 3

Alexandre
Alexandre

Reputation: 3170

I would just answer, to don't start with Magento. Magento is extremly oriented object. May be even too much. It's oriented java style programming and PHP it's not really made for this. That's why of the reason of the slowness of this framework. I would suggest you to start with more basic stuff like Zend Framework or Yii Framework (Yii is very basic and perfect to start OOP).

Upvotes: 0

Jevgeni Smirnov
Jevgeni Smirnov

Reputation: 3797

I won't write big manual for you, as you read articles about magento code. But I think several tips and tricks will help you to improve your skills:

  1. Always have full installation of Magento in accessable place - your favourite IDE for example. Sometimes during module writing I have to extend standard functionality, so I should know how it behaves and how I may change it best of all. Moreover you could use something like Magento's phpDoc
  2. Try to undesrstand how magento's modules, helper, blocks and controllers are loaded. In XML this is block's type attribute, in code this is Mage::helper or Mage::getModel, for instance.
  3. If you can't find some function - go up! Magento has a very interesting arhitecture and multiple inheritance classes - so when I can't find some function in particular class I go UP.
  4. Try to spent some time to understand how XML config influence magento behaviour.
  5. Don't start with complex things. Step by step, you could get good results.
  6. Always learn magento, there are a lot of interesting features and architecture-decisions.
  7. If you have plenty of time I'll advice you to download several free modules and refactor them ;)

Upvotes: 3

Related Questions