February 2019
Intermediate to advanced
446 pages
10h 55m
English
Now we can implement the repository pattern, as learned about in this chapter. To start with, you will first create the two interfaces, Repository and ReadOnlyRepository. The ReadOnlyRepository interface will be used to provide an abstraction for read-only operations, whereas the Repository abstraction will be used to perform all types of operations:
public interface ReadOnlyRepository<TE, T> {
boolean contains(T id);
TE get(T id);
Collection<TE> getAll();
}
The following diagram contains the OTRS domain repositories:

Based on the defined interface, we could create the abstraction of the Repository ...
Read now
Unlock full access