[wp-trac] [WordPress Trac] #18785: Modernize screen functions

WordPress Trac wp-trac at lists.automattic.com
Mon Oct 10 19:23:14 UTC 2011

#18785: Modernize screen functions
 Reporter:  nacin           |       Owner:  nacin
     Type:  enhancement     |      Status:  assigned
 Priority:  normal          |   Milestone:  Awaiting Review
Component:  Administration  |     Version:  3.3
 Severity:  normal          |  Resolution:
 Keywords:  needs-patch     |

Comment (by mbijon):

 I thought on the OOP-ness of this last night. My views of OOP in PHP
 aren't typical, but maybe I can limit the options explored:

 As a class or bucket of functions this code will always be tightly coupled
 to the front-end code required to display it. Generalizing for all-purpose
 use would require support for skinning and JS action hooks. That seems
 like reinventing the wheel, especially with jQueryUI built-in now. Then
 again, Koopersmith recommended against that at #wcpdx so it probably isn't
 a great idea to do either.

 [[Personally (at the risk of casting myself as anti-OOP), I think a file
 that's just a bucket of functions is OK for PHP use. Facebook may have
 gone the other way in recent years but they used to rely on "bucket" files
 to act as pseudo-objects instead of building classes. So my recommendation
 would be to just dump these methods into screen.php and forget the class]]

 Since someone else did the work of building WP_Screen I think we should
 keep it. The encapsulation will prevent method-name collisions that my way
 won't. We could generalize it later with wrapper methods and not break
 compatibility, though I don't think that's the right route.

Ticket URL: <http://core.trac.wordpress.org/ticket/18785#comment:43>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list