-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Супрядкина Дарья ИТМО DWS stage 1 #18
Conversation
public class Server extends HttpServer { | ||
|
||
private ReferenceDao dao; | ||
private List<Integer> permittedMethods = List.of(Request.METHOD_GET, Request.METHOD_PUT, Request.METHOD_DELETE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Private field 'permittedMethods' could be made final; it is only initialized in the declaration or constructor.
|
||
@Override | ||
public Service create(ServiceConfig serviceConfig) { | ||
Config referenceDaoConfig = new Config(Path.of(serviceConfig.workingDir().toUri()), 1024 * 1024); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1024 * 1024 - очень невнятное число, особенно для того кто смотрит со стороны и не знает API. Лучше вынести в константу и назвать как-то осознанно
|
||
public class Server extends HttpServer { | ||
|
||
private final ReferenceDao dao; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В полях лучше использовать как можно более общий тип, т/е/ интерфейс
public class Server extends HttpServer { | ||
|
||
private final ReferenceDao dao; | ||
private final List<Integer> permittedMethods = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
для этих целей лучше использовать Set
public class ServiceIml implements Service { | ||
|
||
private Server server; | ||
private ReferenceDao dao; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тот же комментарий про более общий тип - лучше интерфейс
} | ||
|
||
@Override | ||
public CompletableFuture<Void> start() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
старт/стоп лучше сделать синхронизированными
надо добавить обработку неожиданных ошибок |
исправила |
* HW1: add realization * HW1: fix code style * HW1: change exception constructor * HW1: add report * HW1: add flame graphs description * HW1: add flame graphs description * HW1: fix code style * HW1: fixes according to review --------- Co-authored-by: atimofeyev <[email protected]>
* HW1: add realization * HW1: fix code style * HW1: change exception constructor * HW1: add report * HW1: add flame graphs description * HW1: add flame graphs description * HW1: fix code style * HW1: fixes according to review --------- Co-authored-by: atimofeyev <[email protected]>
HW1