
Solidity Programming Essentials
By :

In terms of references between two structures, there are three different possibilities, which we will explore in the next sections.
In a one-to-one relationship, two structures are related to each other, with each having a single entity, and they are related using an identifier. The related instance contains a single record of data for each main structure. It is to be noted that the relationship can be navigated from both the related structure to the main structure and the main structure to the related structure. However, it is mandatory to have a relationship from the main to the related structure. The following code block shows that there is a main structure and a related structure. Both structures have a common property, familyId
, through which they are related and interconnected:
struct Main { address customerEtherAddress; uint256 familyId;...