Just want to share with you guys what I learned about Magento 2.0 during Meet Magento Belarus that was in Minsk on June 21st. I really liked Dmitriy’s presentation, he revealed a lot of new interesting insights about the Magento 2.0 future and confirmed that Magento Inc. is oriented on improving their product not only from UI but also from development side as well. So what are the major highlights?
Magento 2.0 is not the same as Magento 1.x
As we all expected before it is not writing a new Magento version from scratch, but that doesn’t mean system will be the same in structure. They are going to perform a very deep re-factoring on it, and they already did a lot improvements in the system architecture.
Component Oriented Modules
This is one of my favorite changes that will be in new version. So what the component is for Magento 2.0? It is a set of modules that has high code coupling between each other. So you will be able to disable some components and/or replace it with your own implementation. For organizing relations between components there will be interfaces created that should be implemented in your component.
So you will be able to disable sales, checkout, customer components and can use only catalog. Or even disable catalog and use Magento as CMS… You will be able to write your own catalog implementation if you don’t need all the complexity of core one, but it will not affect other components functionality.
I really like this improvement, cant wait for seeing it in action…
Good Bye Class Alias
There will be no class alias in 2.0, all the objects will be created via createObject() factory by passing full class name. No more definitions of class aliases in configuration.
Someone likes it, someone not, but it is great improvement in organization of the module structure. Now your default layouts/templates/images/css/js will be in your module. There will be no base design package directory any more, all in one place app/code/[pool]/Namespace/Module/view. I suppose there will be no need to define your layout file in configuration anymore. Just create it and it works!
As for custom themes there also were added additional restrictions. All the custom themes that are created will have directories with views per module. So if you want to replace some template, layout you need to create directory with the same name as module name (Namespace_Module not Namespace/Module) and place overridden file there.
For me it seems more consistent from backend developer’s point of view, but for theme developers it will be a bit tough to change the way of customization. Anyway there will be a documentation for it, so it is not a big deal.
Infinite Themes Inheritance
One more cool feature for Magento, you will be able to create custom fallbacks for themes depending on any holiday, browser, store, etc… So you may create more clear theme structure for your customers, finally you will get rid of copy-pasted data.
Can not wait for it? It is possible in current Magento version as well, you just need to perform a small customization to core/design_package model, override _fallback method and call parent with additional $fallbackScheme rules.
They are planning to support more than one database engine so all the resource model level logic will be re-factored. It will be a separate service level, so maybe in future they will just switch to Doctrine ORM… Maybe in Magento 3.0 :)
Good Bye EAV?
It is not their final decision, but they have plans to replace EAV with more simple key/value implementation for RDBMS and you will have an option to select NoSQL adapter instead of RDBMS. I really appreciate this change, if they finally decide to make it in such a way, because EAV is just adding complexity and performance issues.
They are writing integration test (non-isolated) that covers legacy functionality in core. Currently they have about 47% code coverage for Mage_Catalog and 53% for Mage_Core.
That’s great news, because it is important to have some proof that the core code will work after re-factoring. Of course it would be better to use TDD practices in core, but I suppose they can implement them only after covering existing functionality.
Different Directory Structure
Now there will be only 5 directories in Magento root instead of current 9. All the publicity available files will be placed in “pub” directory, instead of current “media”, “js”, “skin”, “error”. So you will be able easily place your Magento application files outside of webserver document root. In “pub” will be placed “jslib” (instead of “js” in root), “error” (error reporting), “media” (uploaded media files), “skins” (theme related public files).
Now there will be more clear process of involving community into developing Magento 2.0. We will be able to see all the process in their public Jira and develop for core if we want.
For instance I signed MCA agreement quite a long time ago and would like to take a part in developing 2.0 features. Hope their Jira and SVN repo will be available soon.
You can also refer to Dmitriy’s slides for something that I haven’t mentioned here (some text in Russian, but mostly English):