
Magento 2 Cookbook
By :

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 parameters
get
: This loads the data from the database and returns a data interface for the specified ID
save
: This saves the record specified in the data interface
delete
: This deletes the record specified in the data interface
deleteById
: This deletes the record specified by the ID
Management interface: In a management interface, it is possible...
Change the font size
Change margin width
Change background colour