Working with service layers/contracts
A service layer/contract is a fixed interface to get and store data without knowing the underlying layer. It is possible to swap the way the data is stored without changing the service layer.
A service layer consists of three interface types:
Data interface: A data interface is a read-only presentation of a record, and therefore, this type of interface only has getters to represent a data record.
Repository interface: A repository interface gives access to read and write (and delete) data. Every repository interface has the following methods:
getList
: This returns a list of records based on the (optionally) provided search parametersget
: This loads the data from the database and returns a data interface for the specified IDsave
: This saves the record specified in the data interfacedelete
: This deletes the record specified in the data interfacedeleteById
: This deletes the record specified by the ID
Management interface: In a management interface, it is possible...