[wp-trac] [WordPress Trac] #58555: Backport: Duotone changes, refactor, enhancements and fixes

WordPress Trac noreply at wordpress.org
Tue Jul 18 15:22:35 UTC 2023


#58555: Backport: Duotone changes, refactor, enhancements and fixes
-------------------------------------------------+-------------------------
 Reporter:  onemaggie                            |       Owner:
                                                 |  isabel_brison
     Type:  task (blessed)                       |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.3
Component:  Editor                               |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-unit-tests gutenberg-merge has-  |     Focuses:
  patch                                          |
-------------------------------------------------+-------------------------

Comment (by hellofromTonya):

 >I am strongly against the use of static in this class.

 While I know you are against static class wrapper design pattern
 @spacedmonkey, I respectfully disagree.

 This
 [https://github.com/WordPress/gutenberg/pull/48698#discussion_r1171489996
 design pattern has been discussed previously in Gutenberg] with
 [https://github.com/WordPress/gutenberg/pull/48698#issuecomment-1517129204
 support from] @azaozz.

 >My PR proves the fact it is unneeded.

 How does your PR prove it?

 Your PR converts it into another design pattern, i.e. OOP. IMO one design
 pattern is not better than the other as both are valid and acceptable
 within WordPress Core.

 One of the disadvantages of OOP is the need of a global way to access the
 object(s) for usage within Core, hooks and extender customization. Globals
 can introduce issues such as added costs of it adds a global variable to
 gain access to the object, which includes the cost of maintenance (as the
 global must be maintained forever within the project) and the potential
 instability or unexpected behavior if the global is overwritten.

 IMO I do not see compelling reasons to warrant changing the architectural
 design pattern from static class wrapper to OOP, especially within Core at
 this late stage. I think the request to change to OOP is personal
 preference (I mean no disrespect).

 I think the time to have discussed this was during the development of this
 class in Gutenberg's development cycle. At this stage, the class has
 already been through Gutenberg's development, release, feedback, and
 testing cycles. Without compelling reasons, I think it's too late to
 change it now. In doing so could introduce risks to (a) the release as
 unintended and possibly unknown issues or bugs could be introduced and (b)
 extenders who may already being customizing or using the class.

 My vote is to reclose this ticket as fixed.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/58555#comment:38>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list