Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Flyweight pattern for blocks in layout updates #29

Closed
stalniy opened this issue Jun 24, 2012 · 1 comment
Closed

Use Flyweight pattern for blocks in layout updates #29

stalniy opened this issue Jun 24, 2012 · 1 comment

Comments

@stalniy
Copy link

stalniy commented Jun 24, 2012

I think it's necessary to use Flyweight pattern for blocks in layout updates that does not have their own state information. In more cases when developer need only to display some template he uses a Mage_Core_Block_Template without any parameters for example

<block type="Mage_Core_Block_Template" name="my.banner" template="banners/some_banner.phtml" />

For such situation you can create "Context" object that will observe all parameters for block by his name. It can decrease usage of memory during displaying View part of system.

@magento-team
Copy link
Contributor

@stalniy
Thank you for the idea. Magento 2 team intends to optimize this part of view layer framework and your recommendation will be considered.
The improvements planned so far:

  • Ability to reuse an object that provides data for rendering block
  • Ability to break down a template into multiple without creating new objects that are related to its rendering

Although this comment provides our best view of the product direction, priorities can change and features may be adjusted. As a result, we do not recommend making firm business decisions solely based on the information above.

magento-team pushed a commit that referenced this issue Jan 16, 2015
[MPI] Performance improvements and bug fixes
This was referenced Mar 4, 2015
@stevieyu stevieyu mentioned this issue Apr 3, 2015
okorshenko pushed a commit that referenced this issue Oct 23, 2015
@FabXav FabXav mentioned this issue Oct 11, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants