template_banner.gif Main Index  PREV  NEXT

Valid HTML 4.01!   Valid CSS!

Choosing which Component Template to use

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.

A single Multi-Purpose function

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

s05_image001.gif

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:

A group of Single-Purpose functions

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

s05_image002.gif

This combination has the following set of characteristics:

Options available with LIST forms

'List' to 'Select'

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'

s05_image003.gif

The identity of the Select form is defined in the Extra Parameters area for the List form on the Menu database.

'Select' to 'List'

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'

s05_image004.gif

The identity of the child form is defined in the Extra Parameters area for the Select form on the Menu database.

Various 'Selects' to 'List'

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'

s05_image005.gif

Options available in One-to-Many relationships

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.

A Single Foreign Entity

This is where there is a simple ONE-to-MANY structure as shown in Figure 6.

Figure 6 - A single Foreign Entity

s05_image006.gif

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

s05_image007.gif

The ADD 1 template has the following characteristics:
  • The outer entity in this structure is the 'MANY' entity.
  • Values for foreign keys are not expected to be passed down from the parent form.
  • If any foreign key values are passed down the standard code will not preload them, nor will it automatically retrieve the specified occurrence of the foreign entities.
  • The user can select or change values for foreign keys while in this form (e.g.: via a dropdown list or a popup form).
Figure 8
Structure for ADD 2 Component

s05_image008.gif

The ADD 2 template has the following characteristics:
  • The outer entity in this structure is the 'ONE' entity.
  • The primary key of the outer entity is expected to be passed down from the parent form.
  • The specified occurrence of the outer entity will be automatically retrieved.
  • The user will not be allowed to change the occurrence of the outer entity.

Multiple Foreign Entities

This is where two 'up' entities are connected to the same 'down' entity, as shown in Figure 9.

Figure 9 - Multiple Foreign Entities

s05_image009.gif

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

s05_image010.gif

The ADD 1 template has the following characteristics:
  • The outer entity in this structure is the 'MANY' entity.
  • Values for foreign keys are not expected to be passed down from the parent form.
  • If any foreign key values are passed down the standard code will not preload them, nor will it automatically retrieve the specified occurrence of the foreign entities.
  • The user can select or change values for the foreign keys to the inner (up) entities while in this form (e.g.: via a dropdown list or a popup form).
Figure 11
Structure for ADD 2 Component (a)

s05_image011.gif

The ADD 2 template has the following characteristics:
  • The outer entity in this structure is one of the 'ONE' entities.
  • The primary key of the outer entity is expected to be passed down from the parent form.
  • The specified occurrence of the outer entity will be automatically retrieved.
  • The user will not be allowed to change the occurrence of the outer entity.
  • The user can select or change values for the foreign keys to the inner (up) entities while in this form (e.g.: via a dropdown list or a popup form).
Figure 12
Structure for ADD 2 Component (b)

s05_image012.gif

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

s05_image013.gif

A Child form being shared by Different Parents

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

s05_image014.gif

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

s05_image015.gif

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:



copyright.gif http://www.tonymarston.net