Boost Fertility New Invention Ups Success Rates.pdf
Akka-http
1. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com1
Akka-http
Open Access Quality Assurance & Related Software Development for Financial Markets
Tel: +7 495 640 2460, +1 415 830 38 49
www.exactpro.com
Дата 20.02.2017
Автор Антон Ситников
2. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com2
Дневник успеваемости
Понедельник
Математика
Физика
Литература 4
Физическая культура
Вторник
Русский язык 2
Математика
Английский язык 5
Технология
3. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com3
Наше приложение
Single-page
web application
ДанныеWeb-сервис
4. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com4
Наше приложение
Single-page
web application
ДанныеWeb-сервис
Ractive.js REST / JSON
5. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com5
Наше приложение
Single-page
web application
ДанныеWeb-сервис
Ractive.js REST / JSON
SQL Server
6. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com6
Наше приложение
Single-page
web application
ДанныеWeb-сервис
7. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com7
Web-сервис
HTTP backend
Сервис
данных
8. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com8
Web-сервис
akka-http akka JSON
HTTP backend
Сервис
данных
9. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com9
Сервис данных
Студенты Расписание Предметы
Оценки
10. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com10
01 public class ScheduleActor extends AbstractActor {
02
03 public ScheduleActor() {
04 receive(ReceiveBuilder
05 .match(SetSchedule.class,
06 command -> this.setSchedule(command.getGroupSchedules()))
07 .match(GetSchedule.class,
08 command -> this.getSchedule(command.getGroupId()))
09 .build());
10 }
11 }
ScheduleActor
12. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com12
SetSchedule
01 import static java.util.Collections.unmodifiableList;
02
03 public class SetSchedule {
04 private final List<Schedule> groupSchedules;
05
06 public SetSchedule(final List<Schedule> groupSchedules) {
07 this.groupSchedules = unmodifiableList(groupSchedules);
08 }
09
10 public List<Schedule> getGroupSchedules() {
11 return this.groupSchedules;
12 }
13 }
13. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com13
Данные
Студенты Расписание Предметы
Оценки
14. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com14
Markbook actor
MarkbookActor StudentsActor ScheduleActor SubjectsActor
GetStudent
Student
GetSchedule
Schedule
GetSubjects
List<Subjects>
15. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com15
Markbook actor
MarkbookActor StudentsActor ScheduleActor SubjectsActor
GetStudent
Student
GetStudent
Student
16. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com16
Child workers
Родитель
17. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com17
Child workers
Родитель
Ребенок
18. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com18
Child workers
Родитель
Ребенок Ребенок
19. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com19
Child workers
Родитель
Ребенок Ребенок
20. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com20
Child workers
Родитель
Ребенок Ребенок
21. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com21
Markbook worker actor
WorkerActor StudentsActor ScheduleActor SubjectsActor
GetStudent
Student
GetSchedule
Schedule
GetSubjects
List<Subjects>
22. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com22
Child workers
Markbook
Worker
23. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com23
Markbook actor
WorkerActor StudentsActor ScheduleActor SubjectsActor
Set<Marks>
GetMarks
GetSchedule
Schedule
GetSubjects
List<Subjects>
Markbook
GetStudentMarks
24. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com24
Markbook worker actor
01 private static class WorkerActor extends AbstractActor {
02
03 public WorkerActor() {
04 receive(ReceiveBuilder
05 .match(GetStudentWeekMarks.class,
06 command -> this.start(
07 command.getStudentId(), command.getWeekNumber()))
08 .match(Student.class,
09 student -> this.processStudent(student))
10 .match(Schedule.class,
11 schedule -> this.processSchedule(schedule))
12 .match(SortedMap.class,
13 marks -> this.processMarks(marks))
14 .match(List.class,
15 subjects -> this.processSubjects(subjects))
16 .build());
17 }
25. Open Access Quality Assurance & Related Software Development for Financial Markets Tel: +7 495 640 24 60 , +1 415 830 38 49
www.exactpro.com25
Markbook worker actor
01 private void processSchedule(final Schedule schedule) {
02 this.schedule = schedule;
03 final HashSet<Integer> subjectIds = new HashSet<>();
04 schedule.getDays().forEach(
05 daySchedule -> subjectIds.addAll(daySchedule.getSubjectIds()));
06 this.context().actorSelection("/user/subjects").tell(
07 new GetSubjects(subjectIds), this.self());
08 this.context().actorSelection("..").tell(
09 new GetStudentWeekMarks(this.studentId, this.weekNumber),
10 this.self());
11 }