Title: Why so structural?
Last modified: April 19, 2018

---

# Why so structural?

 *  Resolved [dyszczo](https://wordpress.org/support/users/dyszczo/)
 * (@dyszczo)
 * [8 years, 1 month ago](https://wordpress.org/support/topic/why-so-structural/)
 * While I was developing a plugin depentent on WooCommerce I found some rather 
   strange refactor approach in the WC code. The reduce_order_stock method from 
   WC_Order class was extracted and put into library file wc-stock-functions.php
   as standard function without OOP context.
    I’m wondering why decision like that
   could be made? If the purpose of this change was to slim down the WC_Order class
   I could easly imagine that the WC_Order_Stock or even WC_Stock class could be
   written to deal with the stock managing issues. Why would developers reduce the
   OOP and enlarge static function base?
    -  This topic was modified 8 years, 1 month ago by [dyszczo](https://wordpress.org/support/users/dyszczo/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fwhy-so-structural%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [Joel Williams](https://wordpress.org/support/users/joelwills/)
 * (@joelwills)
 * Automattic Happiness Engineer
 * [8 years, 1 month ago](https://wordpress.org/support/topic/why-so-structural/#post-10200232)
 * Hi there!
 * The best place to get an answer to this would be from the developers of WooCommerce
   where they discuss features, fix bugs etc.
 * While this is NOT a place to get support, it would be the place to look at the
   code and see if you can find issues where the change was made and why:
 * [https://github.com/woocommerce/woocommerce/issues](https://github.com/woocommerce/woocommerce/issues)
 * Hope that helps!

Viewing 1 replies (of 1 total)

The topic ‘Why so structural?’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [clean code](https://wordpress.org/support/topic-tag/clean-code/)
 * [oop](https://wordpress.org/support/topic-tag/oop/)

 * 1 reply
 * 2 participants
 * Last reply from: [Joel Williams](https://wordpress.org/support/users/joelwills/)
 * Last activity: [8 years, 1 month ago](https://wordpress.org/support/topic/why-so-structural/#post-10200232)
 * Status: resolved