!--a11y-->
Separation of Data Retrieval, Evaluation, and Output 
To give the BSP application a clear and transparent structure, it makes sense to store logical and functional elements in
Event Handlers (these contain only program code). In the HTML-based layout part, dynamic scripting code should only be used to display data on the page in question.
In this tutorial, the book search facility demonstrates the advantages of clearly separating data retrieval, evaluation, and output:
- The page attributes for the results page are set in the OnInputProcessing of the search page. If nothing was input, the results page should not be opened.
- In the initialization part (OnInitialization) of the results page
results.htm, the method search_book is called to search for book titles that match the criteria entered. If an invalid ISBN is entered, the page invalid_isbn.htm opens. If another type of error occurs, the error page opens. If no errors occur, the titles of the books found are written to the internal table bookcat_tab.
- The layout part, then, simply checks whether or not this table is empty. If it is empty, this means that no matching entries were found. If the table is not empty, the results are output in a HTML table.
This ensures that functionality and logic (error handling) are kept out of the layout part.