SlideShare a Scribd company logo
#mm15de
@SergiiShymko
Senior Software Engineer
Magento, an eBay Inc. company
Code Generation
in Magento 2
#mm15de
Introduction to Code Generation
• Automatic programming – generation of computer program
• Source code generation
– Generation based on template
• Allows to write code at higher abstraction level
• Enables aspect-oriented programming (AOP)
• Enables generic programming – parameterization over types
• Avoids writing boilerplate code
#mm15de#mm15de
Code Generation in Magento 1.x
#mm15de#mm15de
Code Generation in Magento 2
#mm15de
Code Generation in Magento 2
• Code is generated:
– On the fly (development)
• Autoload non-existing class that follows naming pattern
– Beforehand (production)
• Run CLI tools
php dev/tools/Magento/Tools/Di/compiler.php
• Location of generated code:
var/generation/
#mm15de
Factories
• Factory creates objects
• Single method – create()
• Used for non-injectables, i.e. entities
• Isolation from Object Manager
• Type safety
• IDE auto-completion
• Class name pattern:
NamespaceClassFactory
#mm15de
Factory Usage
namespace MagentoCatalogModelProduct;
class Copier
{
public function __construct(
MagentoCatalogModelProductFactory $productFactory
) {
$this->productFactory = $productFactory;
}
public function copy(MagentoCatalogModelProduct $product) {
$duplicate = $this->productFactory->create();
// ...
}
}
app/code/Magento/Catalog/Model/Product/Copier.php
#mm15de
Generated Factory (Simplified)
namespace MagentoCatalogModel;
class ProductFactory
{
public function __construct(
MagentoFrameworkObjectManagerInterface $objectManager
) {
$this->objectManager = $objectManager;
}
public function create(array $data = array()) {
return $this->objectManager->create(
'MagentoCatalogModelProduct',
$data
);
}
}
var/generation/Magento/Catalog/Model/ProductFactory.php
#mm15de
Proxies
• Implementation of GoF pattern
• Follows interface of subject
• Delays creation of subject
– Delays creation of dependencies
• Forwards calls to subject
• Used for optional dependencies of DI
• Class name pattern:
NamespaceClassProxy
#mm15de
Proxy Usage in DI Config
<config>
<type name="MagentoCatalogModelResourceProductCollection">
<arguments>
<argument name="customerSession" xsi:type="object">
MagentoCustomerModelSessionProxy
</argument>
</arguments>
</type>
</config>
app/code/Magento/Catalog/etc/di.xml
#mm15de
Generated Proxy (Simplified)
namespace MagentoCustomerModelSession;
class Proxy extends MagentoCustomerModelSession
{
protected function getSubject() {
if (!$this->subject) {
$this->subject = $this->objectManager->get(
'MagentoCustomerModelSession'
);
}
return $this->subject;
}
public function getCustomerId() {
return $this->getSubject()->getCustomerId();
}
// ...
}
var/generation/Magento/Customer/Model/Session/Proxy.php
#mm15de
Interception
• Primary customization approach
• AOP-like mechanism
• Used for plugins
• Attach behavior to public methods
– Before
– After
– Around
• Plugins declared in DI config
#mm15de
Plugin Implementation
namespace MagentoStoreAppActionPlugin;
class StoreCheck
{
public function aroundDispatch(
MagentoFrameworkAppActionAction $subject,
Closure $proceed,
MagentoFrameworkAppRequestInterface $request
) {
if (!$this->storeManager->getStore()->getIsActive()) {
throw new MagentoFrameworkAppInitException(
'Current store is not active.'
);
}
return $proceed($request);
}
}
app/code/Magento/Store/App/Action/Plugin/StoreCheck.php
#mm15de
Plugin Declaration in DI Config
<config>
<type name="MagentoFrameworkAppActionAction">
<plugin name="storeCheck"
type="MagentoStoreAppActionPluginStoreCheck"
sortOrder="10"/>
</type>
</config>
app/code/Magento/Store/etc/di.xml
#mm15de
Generated Interceptor (Simplified)
namespace MagentoFrameworkAppActionAction;
class Interceptor extends MagentoFrameworkAppActionAction
{
public function dispatch(
MagentoFrameworkAppRequestInterface $request
) {
$pluginInfo = $this->pluginList->getNext(
'MagentoFrameworkAppActionAction', 'dispatch'
);
if (!$pluginInfo) {
return parent::dispatch($request);
} else {
return $this->___callPlugins(
'dispatch', func_get_args(), $pluginInfo
);
}
}
}
var/generation/Magento/Framework/App/Action/Action/Interceptor.php
#mm15de
Code Generation for Service Layer
• Service layer – ultimate public API
• Services implement stateless operations
• Generated code:
– Repository*
– Persistor*
– Search Results
– Extension Attributes
* – may be removed in future releases
#mm15de
Generated Repository (Simplified)
namespace MagentoSalesApiDataOrder;
class Repository implements MagentoSalesApiOrderRepositoryInterface
{
public function __construct(
MagentoSalesApiDataOrderInterfacePersistor $orderPersistor,
MagentoSalesApiDataOrderSearchResultInterfaceFactory $searchResultFactory
) {
$this->orderPersistor = $orderPersistor;
$this->searchResultFactory = $searchResultFactory;
}
public function get($id);
public function create(MagentoSalesApiDataOrderInterface $entity);
public function getList(MagentoFrameworkApiSearchCriteria $criteria);
public function remove(MagentoSalesApiDataOrderInterface $entity);
public function flush();
}
var/generation/Magento/Sales/Api/Data/Order/Repository.php
#mm15de
Extension Attributes
• Extension to data interfaces from 3rd party modules
• Attributes declared in configuration
• Attribute getters/setters generated
• Type-safe attribute access
• IDE auto-completion
• Class name pattern:
NamespaceClassExtensionInterface
NamespaceClassExtension
#mm15de
Declaration of Extension Attributes
<config>
<custom_attributes for="MagentoCatalogApiDataProductInterface">
<attribute code="price_type" type="integer" />
</custom_attributes>
</config>
app/code/Magento/Bundle/etc/data_object.xml
#mm15de
Entity with Extension Attributes
namespace MagentoCatalogApiData;
interface ProductInterface
extends MagentoFrameworkApiCustomAttributesDataInterface
{
/**
* @return MagentoCatalogApiDataProductExtensionInterface|null
*/
public function getExtensionAttributes();
public function setExtensionAttributes(
MagentoCatalogApiDataProductExtensionInterface $attributes
);
// ...
}
app/code/Magento/Catalog/Api/Data/ProductInterface.php
#mm15de
Generated Interface of Extension Attributes
namespace MagentoCatalogApiData;
interface ProductExtensionInterface
extends MagentoFrameworkApiExtensionAttributesInterface
{
/**
* @return integer
*/
public function getPriceType();
/**
* @param integer $priceType
* @return $this
*/
public function setPriceType($priceType);
// ...
}
var/generation/Magento/Catalog/Api/Data/ProductExtensionInterface.php
#mm15de
Generated Implementation of Extension Attributes
namespace MagentoCatalogApiData;
class ProductExtension
extends MagentoFrameworkApiAbstractSimpleObject
implements MagentoCatalogApiDataProductExtensionInterface
{
/**
* @return integer
*/
public function getPriceType() {
return $this->_get('price_type');
}
/**
* @param integer $priceType
* @return $this
*/
public function setPriceType($priceType) {
return $this->setData('price_type', $priceType);
}
// ...
}
var/generation/Magento/Catalog/Api/Data/ProductExtension.php
#mm15de
Loggers
• Implementation of GoF pattern Decorator
• Activated with the profiler
– Object Manager wraps instances with loggers
• Tracks method call stack
• Forwards calls to original methods
• Class name pattern:
NamespaceClassLogger
#mm15de
Summary of Code Generation
• DI
– Factory
– Proxy
• Interception
• Service Layer
– Repository
– Persistor
– Search Results
– Extension Attributes
• Logger
#mm15de
Thank You!
Q & A
@SergiiShymko
sshymko@ebay.com
sergey@shymko.net

More Related Content

PPTX
Magento 2 Changes Overview
PPTX
Magento 2 Composer for Extensions Distribution
PPTX
Magento 1.x to Magento 2 Code Migration Tools
PPTX
Max Yekaterynenko: Magento 2 overview
PDF
Magento 2 Development for PHP Developers
PDF
Convert Magento 1 Extensions to Magento 2
PPTX
Magento 2 Code Migration Tool
PDF
Sergii Shymko - Code migration tool for upgrade to Magento 2
Magento 2 Changes Overview
Magento 2 Composer for Extensions Distribution
Magento 1.x to Magento 2 Code Migration Tools
Max Yekaterynenko: Magento 2 overview
Magento 2 Development for PHP Developers
Convert Magento 1 Extensions to Magento 2
Magento 2 Code Migration Tool
Sergii Shymko - Code migration tool for upgrade to Magento 2

What's hot (20)

PDF
Magento 2 Development Best Practices
PPTX
Magento 2 overview. Alan Kent
PPTX
Sergii Shymko: Magento 2: Composer for Extensions Distribution
PDF
Magento 2: New and Innovative? - php[world] 2015
PDF
The journey of mastering Magento 2 for Magento 1 developers
PDF
Migrating from Magento 1 to Magento 2
PDF
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
PDF
Fundamentals of Extending Magento 2 - php[world] 2015
PPTX
Magento 2: A technical overview
PPTX
How to migrate from Magento 1 to Magento 2
PDF
Federico Soich - Upgrading Magento Version
PPT
Meet Magento Belarus - Elena Leonova
PPTX
Flask
PDF
Outlook on Magento 2
PPTX
Mage Titans USA 2016 M2 deployment
PPTX
Magento 2 Theme Trainning for Beginners | Magenest
PPTX
Meet Magento Belarus - Sergey Ivashchenko
PPT
Flask - Python microframework
PDF
Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...
PDF
CodeIgniter - PHP MVC Framework by silicongulf.com
Magento 2 Development Best Practices
Magento 2 overview. Alan Kent
Sergii Shymko: Magento 2: Composer for Extensions Distribution
Magento 2: New and Innovative? - php[world] 2015
The journey of mastering Magento 2 for Magento 1 developers
Migrating from Magento 1 to Magento 2
Magento 2 - An Intro to a Modern PHP-Based System - Northeast PHP 2015
Fundamentals of Extending Magento 2 - php[world] 2015
Magento 2: A technical overview
How to migrate from Magento 1 to Magento 2
Federico Soich - Upgrading Magento Version
Meet Magento Belarus - Elena Leonova
Flask
Outlook on Magento 2
Mage Titans USA 2016 M2 deployment
Magento 2 Theme Trainning for Beginners | Magenest
Meet Magento Belarus - Sergey Ivashchenko
Flask - Python microframework
Guillaume Thibaux - Can we win the fight against performance bottlenecks? Les...
CodeIgniter - PHP MVC Framework by silicongulf.com
Ad

Similar to Black Magic of Code Generation in Magento 2 (20)

PPTX
Code Generation in Magento 2
PPTX
Igor Miniailo - Magento 2 API Design Best Practices
PPTX
Magento Technical guidelines
PPTX
API design best practices
PPTX
Magento Dependency Injection
PPTX
API Design Best Practices by Igor Miniailo
PDF
Chernivtsi Magento Meetup&Contribution day. Naida V.
PPTX
Backward Compatibility Developer's Guide in Magento 2
PPTX
Magento Meetup New Delhi- Magento2 code generation
PPTX
Valeriy Nayda - Best Practices in Magento 2. Based on Multi Source Inventory ...
PPTX
Backward Compatibility Developer's Guide Webinar
PPTX
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
PDF
Magento 2 Backend Development Essentials
PPTX
Chernivtsi Magento Meetup&Contribution day. Miniailo.I.
PPTX
MageConf 2017, Design API Best Practices
PDF
Zepplin_Pronko_Magento_Festival Hall 1_Final
PPTX
Backwards Compatibility Developers Guide. #MM17NL
PDF
Vinai Kopp - How i develop M2 modules
PPTX
Key Insights into Development Design Patterns for Magento 2 - Magento Live UK
PDF
Magento best practices
Code Generation in Magento 2
Igor Miniailo - Magento 2 API Design Best Practices
Magento Technical guidelines
API design best practices
Magento Dependency Injection
API Design Best Practices by Igor Miniailo
Chernivtsi Magento Meetup&Contribution day. Naida V.
Backward Compatibility Developer's Guide in Magento 2
Magento Meetup New Delhi- Magento2 code generation
Valeriy Nayda - Best Practices in Magento 2. Based on Multi Source Inventory ...
Backward Compatibility Developer's Guide Webinar
Backward Compatibility Developer's Guide in Magento 2. #MM17CZ
Magento 2 Backend Development Essentials
Chernivtsi Magento Meetup&Contribution day. Miniailo.I.
MageConf 2017, Design API Best Practices
Zepplin_Pronko_Magento_Festival Hall 1_Final
Backwards Compatibility Developers Guide. #MM17NL
Vinai Kopp - How i develop M2 modules
Key Insights into Development Design Patterns for Magento 2 - Magento Live UK
Magento best practices
Ad

More from Sergii Shymko (10)

PPTX
Developing Loosely Coupled Modules with Magento
PPTX
Composer in Magento
PPTX
Magento 2 Composer for Extensions Distribution
PPT
Magento 2 Enhanced Theme/Skin Localization
PPTX
Magento Performance Toolkit
PPTX
Developing Loosely Coupled Modules with Magento
PPTX
Magento 2 View Layer Evolution
PPTX
Magento 2 Theme Localization
PPTX
Running Magento 1.x Extension on Magento 2
PPTX
Composer for Magento 1.x and Magento 2
Developing Loosely Coupled Modules with Magento
Composer in Magento
Magento 2 Composer for Extensions Distribution
Magento 2 Enhanced Theme/Skin Localization
Magento Performance Toolkit
Developing Loosely Coupled Modules with Magento
Magento 2 View Layer Evolution
Magento 2 Theme Localization
Running Magento 1.x Extension on Magento 2
Composer for Magento 1.x and Magento 2

Recently uploaded (20)

PPTX
OOP with Java - Java Introduction (Basics)
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
DOCX
573137875-Attendance-Management-System-original
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Welding lecture in detail for understanding
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPT
Project quality management in manufacturing
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
Sustainable Sites - Green Building Construction
PPTX
Construction Project Organization Group 2.pptx
OOP with Java - Java Introduction (Basics)
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
573137875-Attendance-Management-System-original
Mechanical Engineering MATERIALS Selection
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Welding lecture in detail for understanding
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
CYBER-CRIMES AND SECURITY A guide to understanding
Project quality management in manufacturing
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Model Code of Practice - Construction Work - 21102022 .pdf
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Sustainable Sites - Green Building Construction
Construction Project Organization Group 2.pptx

Black Magic of Code Generation in Magento 2

  • 1. #mm15de @SergiiShymko Senior Software Engineer Magento, an eBay Inc. company Code Generation in Magento 2
  • 2. #mm15de Introduction to Code Generation • Automatic programming – generation of computer program • Source code generation – Generation based on template • Allows to write code at higher abstraction level • Enables aspect-oriented programming (AOP) • Enables generic programming – parameterization over types • Avoids writing boilerplate code
  • 5. #mm15de Code Generation in Magento 2 • Code is generated: – On the fly (development) • Autoload non-existing class that follows naming pattern – Beforehand (production) • Run CLI tools php dev/tools/Magento/Tools/Di/compiler.php • Location of generated code: var/generation/
  • 6. #mm15de Factories • Factory creates objects • Single method – create() • Used for non-injectables, i.e. entities • Isolation from Object Manager • Type safety • IDE auto-completion • Class name pattern: NamespaceClassFactory
  • 7. #mm15de Factory Usage namespace MagentoCatalogModelProduct; class Copier { public function __construct( MagentoCatalogModelProductFactory $productFactory ) { $this->productFactory = $productFactory; } public function copy(MagentoCatalogModelProduct $product) { $duplicate = $this->productFactory->create(); // ... } } app/code/Magento/Catalog/Model/Product/Copier.php
  • 8. #mm15de Generated Factory (Simplified) namespace MagentoCatalogModel; class ProductFactory { public function __construct( MagentoFrameworkObjectManagerInterface $objectManager ) { $this->objectManager = $objectManager; } public function create(array $data = array()) { return $this->objectManager->create( 'MagentoCatalogModelProduct', $data ); } } var/generation/Magento/Catalog/Model/ProductFactory.php
  • 9. #mm15de Proxies • Implementation of GoF pattern • Follows interface of subject • Delays creation of subject – Delays creation of dependencies • Forwards calls to subject • Used for optional dependencies of DI • Class name pattern: NamespaceClassProxy
  • 10. #mm15de Proxy Usage in DI Config <config> <type name="MagentoCatalogModelResourceProductCollection"> <arguments> <argument name="customerSession" xsi:type="object"> MagentoCustomerModelSessionProxy </argument> </arguments> </type> </config> app/code/Magento/Catalog/etc/di.xml
  • 11. #mm15de Generated Proxy (Simplified) namespace MagentoCustomerModelSession; class Proxy extends MagentoCustomerModelSession { protected function getSubject() { if (!$this->subject) { $this->subject = $this->objectManager->get( 'MagentoCustomerModelSession' ); } return $this->subject; } public function getCustomerId() { return $this->getSubject()->getCustomerId(); } // ... } var/generation/Magento/Customer/Model/Session/Proxy.php
  • 12. #mm15de Interception • Primary customization approach • AOP-like mechanism • Used for plugins • Attach behavior to public methods – Before – After – Around • Plugins declared in DI config
  • 13. #mm15de Plugin Implementation namespace MagentoStoreAppActionPlugin; class StoreCheck { public function aroundDispatch( MagentoFrameworkAppActionAction $subject, Closure $proceed, MagentoFrameworkAppRequestInterface $request ) { if (!$this->storeManager->getStore()->getIsActive()) { throw new MagentoFrameworkAppInitException( 'Current store is not active.' ); } return $proceed($request); } } app/code/Magento/Store/App/Action/Plugin/StoreCheck.php
  • 14. #mm15de Plugin Declaration in DI Config <config> <type name="MagentoFrameworkAppActionAction"> <plugin name="storeCheck" type="MagentoStoreAppActionPluginStoreCheck" sortOrder="10"/> </type> </config> app/code/Magento/Store/etc/di.xml
  • 15. #mm15de Generated Interceptor (Simplified) namespace MagentoFrameworkAppActionAction; class Interceptor extends MagentoFrameworkAppActionAction { public function dispatch( MagentoFrameworkAppRequestInterface $request ) { $pluginInfo = $this->pluginList->getNext( 'MagentoFrameworkAppActionAction', 'dispatch' ); if (!$pluginInfo) { return parent::dispatch($request); } else { return $this->___callPlugins( 'dispatch', func_get_args(), $pluginInfo ); } } } var/generation/Magento/Framework/App/Action/Action/Interceptor.php
  • 16. #mm15de Code Generation for Service Layer • Service layer – ultimate public API • Services implement stateless operations • Generated code: – Repository* – Persistor* – Search Results – Extension Attributes * – may be removed in future releases
  • 17. #mm15de Generated Repository (Simplified) namespace MagentoSalesApiDataOrder; class Repository implements MagentoSalesApiOrderRepositoryInterface { public function __construct( MagentoSalesApiDataOrderInterfacePersistor $orderPersistor, MagentoSalesApiDataOrderSearchResultInterfaceFactory $searchResultFactory ) { $this->orderPersistor = $orderPersistor; $this->searchResultFactory = $searchResultFactory; } public function get($id); public function create(MagentoSalesApiDataOrderInterface $entity); public function getList(MagentoFrameworkApiSearchCriteria $criteria); public function remove(MagentoSalesApiDataOrderInterface $entity); public function flush(); } var/generation/Magento/Sales/Api/Data/Order/Repository.php
  • 18. #mm15de Extension Attributes • Extension to data interfaces from 3rd party modules • Attributes declared in configuration • Attribute getters/setters generated • Type-safe attribute access • IDE auto-completion • Class name pattern: NamespaceClassExtensionInterface NamespaceClassExtension
  • 19. #mm15de Declaration of Extension Attributes <config> <custom_attributes for="MagentoCatalogApiDataProductInterface"> <attribute code="price_type" type="integer" /> </custom_attributes> </config> app/code/Magento/Bundle/etc/data_object.xml
  • 20. #mm15de Entity with Extension Attributes namespace MagentoCatalogApiData; interface ProductInterface extends MagentoFrameworkApiCustomAttributesDataInterface { /** * @return MagentoCatalogApiDataProductExtensionInterface|null */ public function getExtensionAttributes(); public function setExtensionAttributes( MagentoCatalogApiDataProductExtensionInterface $attributes ); // ... } app/code/Magento/Catalog/Api/Data/ProductInterface.php
  • 21. #mm15de Generated Interface of Extension Attributes namespace MagentoCatalogApiData; interface ProductExtensionInterface extends MagentoFrameworkApiExtensionAttributesInterface { /** * @return integer */ public function getPriceType(); /** * @param integer $priceType * @return $this */ public function setPriceType($priceType); // ... } var/generation/Magento/Catalog/Api/Data/ProductExtensionInterface.php
  • 22. #mm15de Generated Implementation of Extension Attributes namespace MagentoCatalogApiData; class ProductExtension extends MagentoFrameworkApiAbstractSimpleObject implements MagentoCatalogApiDataProductExtensionInterface { /** * @return integer */ public function getPriceType() { return $this->_get('price_type'); } /** * @param integer $priceType * @return $this */ public function setPriceType($priceType) { return $this->setData('price_type', $priceType); } // ... } var/generation/Magento/Catalog/Api/Data/ProductExtension.php
  • 23. #mm15de Loggers • Implementation of GoF pattern Decorator • Activated with the profiler – Object Manager wraps instances with loggers • Tracks method call stack • Forwards calls to original methods • Class name pattern: NamespaceClassLogger
  • 24. #mm15de Summary of Code Generation • DI – Factory – Proxy • Interception • Service Layer – Repository – Persistor – Search Results – Extension Attributes • Logger
  • 25. #mm15de Thank You! Q & A @SergiiShymko sshymko@ebay.com sergey@shymko.net

Editor's Notes

  • #3: Automatic programming – some mechanism generates a computer program AOP – separation of cross-cutting concerns Generic programming – style of computer programming in which algorithms are written in terms of types to-be-specified-later Generics in Java, C#, Delphi, Ada Templates in C++
  • #5: Magento 2 employs code generation for a number of core mechanisms
  • #6: Application modes: default, developer, production In addition to what “compiler.php” does “singletenant_compiler.php” also generates caches
  • #7: GoF creation pattern
  • #9: Code has been simplified
  • #12: Code has been simplified
  • #13: APO – Aspect-Oriented Programming
  • #16: Code has been simplified
  • #17: Repository – pattern of Domain-Driven Design Repository – imitates in-memory entity collection Persistor – persists entities in Repository Search Results – subset of entities in Repository Extension Attributes – extension to data interfaces
  • #18: Method create($entity) adds entity to repository
  • #19: Explicit, safe, type-safe attribute access Replacement for free-format Varien_Object