Skip to content

Updated parent inheritance #8603

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

Closed
wants to merge 1 commit into from
Closed

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