Which approach is more best practice? I have a database with Products table and Categories table. Product always has its category. Now I am implementing the Product entity class and I do not know if it is better to have an int property "category_id" or object property with Category class. So if the contructor should be:
public Product(int id, int category_id)
or
public Product(int id, Category category)
Which of these is better? Or should I use both properties?
thanks for reply