Say I have a situation where a person who is uniquely defined by their firstName
and lastName
can rent a car uniquely defined by its licensePlateNumber
and dayOfRental
.
Can I say both of these statements capture the domain requirement?
firstName, lastName -> licensePlateNumber, dayOfRental
licensePlateNumber, dayOfRental -> firstName, lastName
Is there a difference between the two?
First, there's clearly a difference between {firstName, lastName}->{licensePlateNumber, type} and {licensePlateNumber, type}->{firstName, lastName}. In symbolic notation, you'd have A->B and B->A. Those two are clearly different.
Second, both those together do seem to capture the requirement you're interested in.
Third, I'd expect license plate number alone to uniquely identify a car. But that doesn't change the substance of your question or of my answer.