Jump to content

bernardnthiwa

New Members
  • Posts

    1
  • Joined

  • Last visited

bernardnthiwa's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello, I'm configuring php api endpoints for crud operations with a React.JS frontend. I would like help on how to implement the logic with OOP, an abstract class for the main product logic. I have three product types, Book, Furniture, and DVD. All products have a name, sku (primary key), and price. Moreover, each product type has a product-specific value. A book has a weight property, furniture has dimensions (length, width, and height) and a DVD has a size property. How can I proceed to use polymorphism to achieve this, so that i can avoid using conditional statements to detect product type.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.