protected function objectToKey($object)
    {
        $typeName = $object instanceof AppliesToResource ? $object->resourceName() : get_class($object);

        if (!$object instanceof Identifiable) {
            throw new InvalidArgumentException('Cannot generate cache id of unknown class '.get_class($object));
        }

        return $typeName.'_'.$object->getId();
    }