HTL encourages separation of concerns by not allowing business logic to mix with markup. Business logic can be implemented through the Use-API.
The following table gives an overview of the advantages and disadvantages of each API.
For page components, it is recommended to use a mixed model, where all model logic is located in Java, providing clear APIs that are agnostic to anything that happens in the view (i.e. within the components). AEM comes with great default models like the Page or the Resource API that should be able to cover most cases.