Introduction

Hooks can be used for the List and Show methods. To a large extent, the flow for List and Show is comparable to the flow for other top-down methods such as Create or Change. However, some differences exist, because the number of component instances processed for Create and Change depend on the request contents, while the number of component instances processed for List and Show depend on the data that is read from the database.

Consequently, in the before execute hook for Create and Change you are sure a specific instance is being processed. In case of List and Show the next instance has not been read yet, and may not even exist. So for List and Show the before, on and after method hooks are invoked per instance, but these functions are executed 'once too often'. This is because the last invocation of the execute function will fetch nothing. In the before execute and on execute hooks for Create and Change, all attribute values will be input, while in case of List and Show most attribute values will be output only.

Note: A List or Show method cannot be bottom-up. They can only be top-down or batch. If List and/or Show are implemented as batch methods, the interfaces differ.

The implementation for Show is comparable to the implementation of List. The main difference is that the input differs for the top-level component. Actually, we can say that the Show is a special type of List, having a filter on the identifiers for the top-level component. Although technically the Show method is not implemented this way.

In case of a batch implementation for the List method, the on execute hook must handle the filter, selection, iterator and 'maxNumberOfObjects'. In case of a top-down implementation, the iterator and 'maxNumberOfObjects' are handled in the public layer. You do not need to take these into account in the hook code.

Regarding selection and filtering see the following section.