concepts that every magento developers should know

4
Concepts That Every Magento Developers Should Know Throughout the years as a magento programmer I have found some superb code, you recognize the sort of code that influences you to be better, to do better and rather truthfully boast of being a designer. However I have actually additionally seen a bunch of code that in reality, well it makes me vomit. It makes me so unfortunate. I could just think about one reason ... some developers just do not RTFM ... Magento's core code as well as xdebug will reveal anything you need to understand about Magento and its best practices. So for such reason We are creating a listing of 10 easy principles every magento programmer should recognize to comprehend exactly what Magento growth is all about. These were selected based on exactly how weak the executions I have seen are. So you won't see EAV, API or mobile here since for far better or for worse these are usually left untouched. Magento Viewers ... the light at the end of the passage Magento is an event driven application, which implies that it makes use of the onlooker pattern a great deal, Magento's execution of the design pattern could use some friendly refactoring but they still preserve a checklist of all the onlookers and also Magento informs all them automatically of any sort of state changes. In other words, the hack and also reduce idea of overriding as well as revising core's functionality is not the only method to obtain anything carried out in Magento, if anything I really feel urged to claim that it should be prevented unless you need to rewrite just how an item of code actually functions, like say deal with a bug. Now we require a lot more occasions being dispatched before Magento could remove several of the flexibility to alter how some code function.

Upload: karen-e-williams

Post on 13-Apr-2016

217 views

Category:

Documents


0 download

DESCRIPTION

So for such reason We are creating a listing of 10 easy principles every magento programmer should recognize to comprehend exactly what Magento growth is all about. These were selected based on exactly how weak the executions I have seen are. So you won't see EAV, API or mobile here since for far better or for worse these are usually left untouched.

TRANSCRIPT

Page 1: Concepts That Every Magento Developers Should Know

Concepts That Every Magento Developers ShouldKnow

Throughout the years as a magento programmer I have found some superb code, you recognize thesort of code that influences you to be better, to do better and rather truthfully boast of being adesigner.

However I have actually additionally seen a bunch of code that in reality, well it makes me vomit. Itmakes me so unfortunate. I could just think about one reason ... some developers just do notRTFM ... Magento's core code as well as xdebug will reveal anything you need to understand aboutMagento and its best practices.

So for such reason We are creating a listing of 10 easy principles every magento programmershould recognize to comprehend exactly what Magento growth is all about. These were selectedbased on exactly how weak the executions I have seen are. So you won't see EAV, API or mobilehere since for far better or for worse these are usually left untouched.

Magento Viewers ... the light at the end of the passage

Magento is an event driven application, which implies that it makes use of the onlooker pattern agreat deal, Magento's execution of the design pattern could use some friendly refactoring but theystill preserve a checklist of all the onlookers and also Magento informs all them automatically ofany sort of state changes. In other words, the hack and also reduce idea of overriding as well asrevising core's functionality is not the only method to obtain anything carried out in Magento, ifanything I really feel urged to claim that it should be prevented unless you need to rewrite just howan item of code actually functions, like say deal with a bug. Now we require a lot more occasionsbeing dispatched before Magento could remove several of the flexibility to alter how some codefunction.

Page 2: Concepts That Every Magento Developers Should Know

That suggests prior to an item is included in the cart I can confirm all its info without also knowingthe equipment kind or how magento takes care of items. Fantastic.

Yet this is simply the idea of the iceberg as well as perhaps one of one of the most ordinaryinstances, consider it the hello globe of the Magento occasions.

Why is this the initial principle I assume magento designers should comprehend?

The more code evaluations or Magento implementations I consider, be it area or venture from onepoint alike: core adjustments that are just unneeded. So perhaps, merely perhaps by adding somefirepower to the magento designers data base we could eradicate core modifications finally.

Magento formats ...

The most effective principle ever before visualize by any kind of framework programmer. To meMagento's designs are the most remarkable item of engineering inside of Magento land as well as itmust be well understood.

Exactly what's the big offer? Well Magento constructed that theme to fit the from the box productkinds and also other that you could possibly develop. Most individuals do not also recognize thatthe magento layouts could deal with various equipment kinds, open up the catalog.xml and besurprised. You could customize each product by understanding its type as well as you could designthe pages differently without having to touch a single line of code in the design template ... anothergreat idea.

Magento admin html ... revealing the reality

Magento's front end OOP is weak when compared to the admin html. Your Admin FU need to behigh(6-8) before you could call yourself a Magento developer. All the beauty of Magento growthtakes place in the admin. The front end is awesome as well as all yet the majority of the work youdo is simple as well as recurring.

Magento designers have problem comprehending Grids and types production which is extremelyodd since creating skeletons in the admin is very mechanical. Exactly what you do with it after thatis truly powerful.

By now you Magento is based on the Zend Framework, this is very considerable due to the fact thatit indicates besides Magento's very own framework you have Zend's. Exactly what this means toyou is that you could currently begin utilizing pretty much every little thing from Zend's arsenal toget this done.

From Zend_Date to Zend_Log ... do you like firebug as well as firephp, well presume just what?You could use Zend Log to do some logging for you.

Page 3: Concepts That Every Magento Developers Should Know

Magento's controllers

However Magento developers must understand that Magento has 2 major locations: frontend andalso admin as well as each one has a default controller for it The CMS web pages and also nocourses obtain their own as well.

Here is a friendly explanation for it.

OK currently below's something you should constantly bear in mind, every controller hasaccessibility to the Demand and Reaction items ... do not use the $_ GET, $_ POST or $_REQUEST selections to obtain data rather utilize the $demand-> getServer('param') to get theinformation you require, specifically with $_ GET params.

Magento's cron

PHP is stateless, possibly that is not the right term, however basically you can not count on it to doscheduled operations on the background. Some people use daemons but the most typical way to setup activities is via cron works.

Now Magento supports them out of the box, right? Yes. Not only magento has a cron.php data itlikewise allows you to add a crontab node to your modules setup so you can arrange tasks too.

This does not imply that Magento out of the box runs them, it only suggests it assists them so youhave to ensure that your tract has a cronjob access for it.

Magento's complete page caching

An overly complicated implementation of full page caching however it gets the job done as well asjust what's even more compelling about it is that the majority of developers aren't sure it hascrawling out of the box ... wait just what? Yea you could have Magento's FPC regenerate itselfregularly and that it is worth a whole lot because cache invalidation is just one of the greatest painin the behind. Right here is a basic means to obtain comparable results, be warned it is not asdurable. Obviously you understand that it relies upon the cron jobs being established to in fact get itdone, right?

Page 4: Concepts That Every Magento Developers Should Know

If you ever utilized a reverse proxy like varnish you know that hole punching is minor yet yieldssome unforeseen outcomes ... Magento's full web page caching hole punching is even easier andwell the results are a lot more unanticipated? Why is that? I think is since 1-) exactly how headersand caching interact as well as 2-) since some pests in Magento's application (could a person fix thebreadcrumbs currently).

There is a description right here if you want to comprehend exactly how Magento's full page cachefunctions.

Magento's translation.

I recognize, I know ... Magento's translation is not truly translation yet string replacements howeveryou recognize what? It works and also it is a lot far better than you believe yet the major reason Ilike it is because you could have theme level translation which knowledge there can be thedistinction in between hrs of frustration or 4-5 draft beers with your pals. Why? Well if you makeuse of translation you could start transforming messages and also tags everywhere without having togo into design templates or code ... just by having a csv documents.