1_Тайчинов.pptx
- Количество слайдов: 32
Android Action Architecture Тайчинов Марат 2017
Немного истории
Clean Architecture. Теория
Clean Architecture. Практика
Clean Architecture. Практика
Clean Architecture. Слой Presentation
Clean Architecture. Слой Domain
Clean Architecture. Слой Data
Action. Views
Clean Architecture. Схема работы данных
Action. Views. Схема работы данных
Action. Views. Схема работы данных
Action. Views. Структура проекта
Action. Views. Структура проекта
Action. Views. Структура проекта
Clean Architecture. Use. Case public interface Use. Case
{ interface Callback
Clean Architecture. Use. Case @Override public void execute(final Integer feed. Id, final Callback> callback) { try { callback. on. Success( feed. Repository. get. Feed. Articles(feed. Id)); } catch (final Throwable throwable) { callback. on. Error(throwable); } }
Action. Views. Presenter public void get. Employment() { execute( m. Employment. Service. get. Filtered(filter), this: : on. Get. Employment ); }
Action. Views. Service @Override public Observable
Action. Views. Presenter public void get. Employment() { execute( m. Employment. Service. get. Filtered(filter), this: : on. Get. Employment ); }
Action. Views. Обработка response private void on. Get. Employment( Employment employment) { m. View. set. Employment(employment); }
Action. Views
Action. Views. Как было до m. Composite. Subscription. remove(m. Subscription); m. Subscription = m. Data. Manager. get. Blocked. Users(COUNT, m. Offset). compose(Rx. Util: : async). compose(Rx. Util. loading(m. View)). compose(Rx. Util. empty. Error. Stub(m. Error. Stub. View)). compose(Rx. Util. error. No. Internet(m. No. Internet. View)). subscribe(this: : handle. Response, Rx. Util: : error. No. Action); m. Composite. Subscription. add(m. Subscription);
Action. Views. Схема работы
Action. Views. Схема работы
" src="https://present5.com/presentation/5205167_452203652/image-26.jpg" alt="Подключаем Action. View. XML
Подключаем Action. View. Код @Override public Error. View get. Error. View() { return new Toast. View(get. Context()); } @Override public Empty. View get. Empty. View() { return empty. View; } @Override public No. Internet. View get. No. Internet. View(){ return no. Internet. View; }
Подключаем Action. View. Код empty. View. set. Another. Views(main. Layout, no. Internet. View, main. Loading. View); no. Internet. View. set. Another. Views(main. Layout, empty. View, main. Loading. View); like. Loading. View. set. Another. Views(button. Like); main. Loading. View. set. Another. Views(main. Layout, empty. View, no. Internet. View);
4 шага к использованию Action. Views 1) Custom. View 2) xml 3) Код 4) Another. Views
Action. Views. Плюсы 1) Нет boilerplate 2) Многопоточность уже реализована 3) Механизм Action. View 4) Своя реализация обработки ошибок 5) Удобные, готовые базовые классы 6) Простота и скорость 7) Кастомизация 8) Поддержка и доработка
Action. Views. Минусы 1) Тяжелая кастомизация 2) Порог вхождения 3) Усложненное тестирование 4) Документация
Action Architecture СПАСИБО ЗА ВНИМАНИЕ!


