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 conversion unit tools and other types of converters used in science and business oriented 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 unit conversion tool with five conversion units requires the coding of 25 fields. To add an additional conversion unit requires the coding of 6 x 6 = 36 fields. Insane!
To overcome all those drawbacks, we have developed what we call a one-to-many fields mapping algorithm or O2M. 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. 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. To grasp the concept, try one of our O2M tools at