How would you design objects whose purpose it is to get “metadata” from models? Example in post.

Let’s say I got a model called “Chef”. This object has methods such as what kinds of dishes this chef is able to cook. Like Chef->getAvailableDishes() or something. Now I have some code in another part of the application where I would want to get some “metadata” about this chef, which is a combination of methods and calculations made with the help of the Chef object.

For example ChefMetadataHelper::canCookDish($dish); or ChefMetadataHelper::hasEnoughTimeOverToCookDishesOnDate($dishes, $date).

Like… some form of other objects that interact and usually return boolean values for question asked around in the code base. What would you call these objects? What’s the best approach?

submitted by /u/InNeedOfPrinting
[link] [comments]