Why does an inventory system need a UObject class and a separate class for the DataTableRow?

So, I’m following this tutorial of a C++ inventory system in YouTube.

https://www.youtube.com/watch?v=cPgtd4m5-EI&list=PLitYOdh3OOzhJBCRqYZEGBzJYemA-SH8Z

So, at the start, this guy creates the following C++ classes…

  1. Empty header “Item Data Structs” : Contains Data Table Row with all the Structs and Enums regarding the database for Items
  2. UItemBase : The UObject base class that creates copies of the structs of “Item Data Structs”.
  3. AActor "Pickup : Which inherits the UItemBase.

I just have a general enquiry on this guys method, I’m new to Game Dev so I’m not sure if his setup is common practice, but, I don’t understand why create the header and the UObject class… I feel like they are redundant? I mean, why not have the Data Table Row declared in the PickUp Actor itself, and then create instances of this actor? Isn’t that less complicated?

I know this is probably a basic question… but if his practice is a common one, can you please enlighten me on the logic on why create all those separate classes as opposed to just one class that contains everything…

Have not followed the tutorial but made a few item systems. It is pretty common at minimum have separate classes for:

  • “item archetype”: the entries in the items database that define each item, after being loaded these never change, since they define the possible items
  • “inventory item”: the class for an instance of an item archetype in the player’s physical inventory, it will have a reference to an archetype, but also many other functions like add, remove, drop, etc.