[wp-trac] [WordPress Trac] #31985: WP_Network class

WordPress Trac noreply at wordpress.org
Wed May 27 11:53:09 UTC 2015


#31985: WP_Network class
--------------------------------+------------------------
 Reporter:  johnjamesjacoby     |       Owner:
     Type:  enhancement         |      Status:  new
 Priority:  normal              |   Milestone:  4.3
Component:  Networks and Sites  |     Version:  3.0
 Severity:  normal              |  Resolution:
 Keywords:  dev-feedback        |     Focuses:  multisite
--------------------------------+------------------------

Comment (by johnjamesjacoby):

 Replying to [comment:13 jacobsantos]:
 > Programmers who use static methods quickly realize how much of a mistake
 it is to do so.
 Not all programmers, and not all methods.

 > What reason are you defining class methods instead of instance methods?
 For identifying and encapsulating existing procedural code, so we can work
 backwards from what currently exists.

 > Are you attempting to create namespaced functions? If so, then what
 benefit do you achieve outside of just creating a function?
 None yet, other than developer sanity by identifying the logic flow (which
 currently spans several files) and isolating it to one convenient location
 to iterate from further.

 > Are you mixing class methods and instance methods? Do the class methods
 amount match or exceed the instance methods count? Would you be better
 served creating a separate class for the static methods?
 Yes. CRUD actions will be broken out into a `WP_Network_Query` class.

 > Do you wish to break extensiblity? If so, then why not just use 'final'?
 If you decide to use 'final', then what problem are you truly attempting
 to solve? Would your solution be better if it used functions instead?
 No? Not sure why this is mentioned here in this way. The current core code
 is really only extensible because core developers needed it to be for
 WordPress.org. No flexibility has been added or removed in any patches
 presented here. It's entirely likely there will be 10 or more iterations
 before we agree on a final solution.

 The patches presented so far are not prestine candidates for core, but
 rather two people unwinding a messy portion of the codebase that's gone
 untouched for several years, and several years again before that.

 I, for one, appreciate your feedback, and also look forward to your
 helping apply that feedback towards future patch iterations working
 towards the final result, if you're willing and able.

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


More information about the wp-trac mailing list