Files
rosetta-wss/src/main/java/im/rosetta/service/Service.java

24 lines
968 B
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package im.rosetta.service;
/**
* Базовый класс для всех сервисов. Нужно чтобы унифицировать доступ к репозиториям,
* а так же не раздувать логику в executor'ах. Так код в executor'ах будет чище и
* проще для понимания. Для атомарных операций с сущностями сервисы не используются, они используются только для
* более сложной логики, требующей взаимодействия с несколькими репозиториями или
* иной бизнес-логики.
* @param <T> тип репозитория
*/
public abstract class Service<T> {
private T repository;
public Service(T repository) {
this.repository = repository;
}
public T getRepository() {
return repository;
}
}