How WooCommerce handles object data

Previously on “Stop using arrays for everything“, I exposed that an array wasn’t always the best way to accomplish a task and I gave an example in which an object was a better solution for that case.

Today, I’d like to illustrate how powerful the OOP can be and the benefits of using objects. To do so, I’ll use as an example one of the most popular WordPress plugins and the biggest e-commerce platform at this moment. I’m talking about WooCommerce and how this one handles the data of its different kinds of objects like products, orders, coupons, etc.