Mapping Model Objects <--> Window Interface

To present data, it is necessary to combine base algorithms from the InstantView® engine for visualization purposes such as building blocks. InstantView® achieves this flexibility by mapping data on the interface. Access Paths which control data in- and export, are assigned to the window objects (input fields).

Object relations can be visualized in that way, too.

 

Data transfer from model to interface and back will be caused by four InstantView® statements:

FillWindow model --> interface window input field, object box to display relations
DrainWindow interface --> model window input fields, object box to display relations
FillObox model --> interface object set as object box table
OboxEdit interface --> model edit table objects

This example with three hypothetical classes shows, how InstantView® binds data to interface window objects: classes A, B describe a person with any amount of assigned address information (or none) - class C:


   class A
   {
      . . .
      char *name;
      char *firstName;
      short sex;
   };
 
   class B : public A
   {
      . . .
      os_Set<C *> address;  // 0 ... n addresses
      . . .
   };
 
   class C
   {
      . . .
      char *city;
      . . .
   }
 

This data is displayed in a window, whereas there are maximum three addresses: 

   Window(win1, 30, 30, 600, 110, "F i l l W i n d o w")
   {
     Prompt(p1, 10, 10, T("Name:", "name:", "nom:"))
     String(A::name, 70, 10, 140)
     Prompt(p2, 250, 10, T("Vorname:", "first name:", "prénom:"))
     String(A::firstName, 350, 10, 140)
     Enum(A::sex, 350, 20,  115, 30)
     // bis zu drei Adressen werden dargestellt:
     Prompt(p3, VOLATILE(adr1), 10, 40, T("Adresse 1:", "1st address", "adresse 1"))
     String(B::address[0].city, VOLATILE(adr1), 129, 40, 200)
     Prompt(p4, VOLATILE(adr2), 10, 50, T("Adresse 2:", "2nd address", "adresse 2"))
     String(B::address[1].city, VOLATILE(adr2), 129, 50, 200)
     Prompt(p5, VOLATILE(adr3), 10, 60, T("Adresse 3:", "2nd address", "adresse 2"))
     String(B::address[2].city, VOLATILE(adr3), 129, 60, 200)
   }
 
There is the following connection between any object of the class B and the window object:

 

Variable 'person' shall contain the instance of class B shown above.

        person  FillWindow(win1)
 
provides:


Please note, that FillWindow considers the derivation A --> B. The line for address 3 is hidden, since the collection 'address' contains only two objects of class C.

In the example above, window objects and data fields are clearly assigned. If this is not possible, Access Functions provide the option to realize rather complex interrelations between data fields and window interface. The  separation of model class and visualization however, will be maintained.