Main Index
PREV
NEXT
|
Deciding which template to use for each component depends on the specific requirements of the application. Some solutions may be provided with a single component, others may require a mixture of two or more components. The following sections provide examples of how particular templates can be utilised within an application.
This multi-purpose form component shown in Figure 1 performs Create, Read, Update and Delete operations on an entity. Anyone who has been granted access to this form can therefore perform all these operations. It is not possible to restrict individual operations to individual users or classes of user.
Figure 1 - A Multi-Purpose Function
This option is usual under the following circumstances:
When it is required to allow an ordinary user to view the contents of the entity so that a specific occurrence can be chosen this can be provided in one of the following ways:
Each of the form components shown in Figure 2 performs a single function. Giving a user access to a function is therefore as simple as granting access to the component which performs that function.
Figure 2 - A group of Single-Purpose Functions
This combination has the following set of characteristics:
In the combination shown in Figure 3 the parent form is a List form (with limited selection criteria in the Profile Area), and the use of the Select form, which allows any field to be profiled, is entirely optional.
Figure 3 - 'List' to 'Select'
The identity of the Select form is defined in the Extra Parameters area for the List form on the Menu database.
In the combination shown in Figure 4 the parent form is a Select form, and this must be negotiated before the List form can be processed. The List form does not contain a Profile Area, and performs an automatic <retrieve> based on the profile that is passed to it by its parent form.
Figure 4 - 'Select' to 'List'
The identity of the child form is defined in the Extra Parameters area for the Select form on the Menu database.
In the combination shown in Figure 5 the profile used by 'List MANY', which contains entities 'A' and 'B' as foreign entities, can come from a number of different sources.
Figure 5 - Various 'Selects' to 'List'
In this situation the 'One' entity can also be referred to as the 'up' entity, and the 'Many' entity can also be referred to as the 'down' entity. The primary key of the 'One' entity also exists as a foreign key on the 'Many' entity.
In this type of relationship several options are available when creating an occurrence of 'Many'. These options mainly revolve around the choice of the outer entity in the component structure, as any parameters which are passed from the parent form normally apply only to the outer entity.
This is where there is a simple ONE-to-MANY structure as shown in Figure 6.
Figure 6 - A single Foreign Entity
In this structure ONE is the 'up' or 'foreign' entity while MANY is the 'down' entity. When included within a component these two entities may be arranged as shown in either Figure 7 or Figure 8.
Figure 7 Structure for ADD 1 Component |
The ADD 1 template has the following characteristics:
|
Figure 8 Structure for ADD 2 Component |
The ADD 2 template has the following characteristics:
|
This is where two 'up' entities are connected to the same 'down' entity, as shown in Figure 9.
Figure 9 - Multiple Foreign Entities
In this example the database structure could lead to the generation of three different components to create new occurrences of the MANY entity, as shown in Figures 10, 11 and 12.
Figure 10 Structure for ADD 1 Component |
The ADD 1 template has the following characteristics:
|
Figure 11 Structure for ADD 2 Component (a) |
The ADD 2 template has the following characteristics:
|
Figure 12 Structure for ADD 2 Component (b) |
This is the same as the previous ADD 2 component, but the positions of entities ONE(a) and ONE(b) have been reversed. In this case the parameter which is passed in should include the primary key for the ONE(b) entity instead of the ONE(a) entity. |
Note here that two different components are constructed from the ADD 2 template as there are two possible choices for the outer entity. Along with the ADD 1 component this will result in a mixture of parent/child forms as shown in Figure 13.
Figure 13 - 3 Components to add an occurrence of MANY
If a component were constructed from the ADD 1 template and modified to expect any one of the foreign key values to be included in the passed parameters it would reduce the number of components, as shown in Figure 14.
Figure 14 - Access to a shared version of ADD 1
It is even possible to extend this ability to share components across several layers in the hierarchy, as shown in Figure 15.
Figure 15 - Access to several shared components
The LIST(Many) form would accept the following as pased parameters:
The action taken by ADD 1 would depend on the parameters passed down by its parent:
http://www.tonymarston.net |