Some developers build form-based graphical user interfaces (GUIs) that give users the illusion of mapping the value of an input field to all other fields. Typical examples are unit converters and other types of conversion tools used in business oriented sites and scientific sites. This is frequently done by coding in the background M number of fields M number of times, with most fields hidden or dynamically coded. These M x M fields are then conditionally processed.
As M increases, said strategy becomes very inefficient from both the coding and processing standpoint. Modifying these types of GUIs can be messy. For instance, to display a simple GUI for cross-converting five different units requires the coding of 25 fields. To add an additional conversion unit requires the coding of 6 x 6 = 36 fields. Insane!
Other developers use a single form with M fields, but then write in the background M different if-else conditioned functions based on which field is not empty. As M increases, the degree of if-else statements equally increases so they end up coding a chicken dance!
To overcome all those drawbacks, we developed O2M: a one-to-many fields mapping algorithm. The algorithm is quite simple and works as follows. Given a form with M unique text fields, randomly using one as an input field instructs the algorithm to treat the remaining ones as output fields. Only one function is required, avoiding the if-else chicken dance. It does not matter which field is initially used or from where the data comes from (i.e., a user or database). Its value will be mapped to the remaining M - 1 fields. As a whole, an O2M GUI behaves as a many-to-many (M2M) solution.
The following tools are relevant to many fields and disciplines. These are O2M-based.
The following tools are relevant to many fields and disciplines. These are not O2M-based.