You gotta ask yourself one question. Does it matter to a cat which organization a cat or a box belongs to?
E.g., when you have a cat object, do you even need to know its owner? Is there a functionality that starts with a cat, and does something owner specific - WITHOUT knowing the owner before you even know the cat object?
E.g. a typical functionality would always start with a user:
my $org = $user->org();
Proceed to find its cats
my @cats = $org->listOwnedCats();
And then do something with one of the cats:
$cats[0]->CheckHealth();
Note the important fact: by the time you get to the specific cat - you already KNOW the organization since that was how you got the cat object in the first place. There's zero need to store $org
inside the $cat
object.
Same is true for the cats in boxes. Do you EVER need to find a cat's object's box aside from knowing that some cat isn't boxed yet?
If that functionality pattern holds (as it nearly always does), you have a VERY strait-forward object model:
- User: Attributes are "org" and some other stuff
- Org: Attributes are "UnboxedCatList" and "BoxList" - one is an array of cats that were not yet * assigned to boxes; one is an array of box objects
- One of the methods is
PlaceUnboxedCatIntoBox()
- One of the methods is
- Box: Attributes are "CatList" (array of cat objects)
- Cat: Attributes are cat specific - cat's don't own boxes or orgs.