Skip to content

Conversation

@koenner01
Copy link
Contributor

Fix for #8587

Copy link
Contributor

@maghamed maghamed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replied in the issue #8587 (comment)

@koenner01 Why do you need Image to be successor of DefaultFrontend?

An example of where this is already done in the core:
Magento\Eav\Model\Entity\Attribute\Frontend\Datetime

We don't have these neither in 2.0.*
https://github.com/magento/magento2/blob/2.0.13/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php#L11
nor in 2.1.*
https://github.com/magento/magento2/blob/2.1.4/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php#L11
nor in develop branch
https://github.com/magento/magento2/blob/develop/app/code/Magento/Eav/Model/Entity/Attribute/Frontend/Datetime.php#L11

Actually for now Magento\Eav\Model\Entity\Attribute\Frontend\DefaultFrontend class doesn't have any successor.

Currently the only place where Default Frontend class is used is in the AbstractAttribute class

    /**
     * Retrieve frontend instance
     *
     * @return \Magento\Eav\Model\Entity\Attribute\Frontend\AbstractFrontend
     */
    public function getFrontend()
    {
        if (empty($this->_frontend)) {
            if (!$this->getFrontendModel()) {
                $this->setFrontendModel($this->_getDefaultFrontendModel());
            }
            $this->_frontend = $this->_universalFactory->create($this->getFrontendModel())->setAttribute($this);
        }

        return $this->_frontend;
    }

and this behavior looks correct for me.
What customization abilities you are losing, having such hierarchy of inheritance ?

Magento discourages usage of inheritance. So, a deep inheritance tree is a "smell" from architectural point of view.

@maghamed maghamed closed this Mar 1, 2017
magento-devops-reposync-svc pushed a commit that referenced this pull request Mar 7, 2024
…fix-10262023

Cia 2.4.7 beta3 develop bugfix 10262023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants