Date post: | 20-Jun-2015 |
Category: |
Technology |
Upload: | andrew-panfilov |
View: | 397 times |
Download: | 3 times |
dropwizardframework for developing ops-friendly, high-
performance, RESTful web services
обо мне
● Андрей Панфилов● Java Developer
история вопроса
● распространенное мнение: java == кровавый энтерпрайз
● некоторым хочется легкости (не в ущерб преимуществ java)
● dropwizard -- легковесный фреймворк для веб (It's an answer to the complexity of Java Web and Application Containers, which tend to be overkill for 90% of your use-cases.)
об авторе
● Coda Hale (codahale.com)● «I’m a software engineer in Berkeley,
CA.»● Principal Software Developer
(Microsoft), Infrastructure Architect (Yammer)
определение
● Dropwizard is a Java framework for developing ops-friendly, high-performance, RESTful web services.
● Основная идея: pulls together stable, mature libraries from the Java ecosystem into a simple, light-weight package.
● Название: что такое dropwizard?
комикс
компоненты dropwizard'а
● Jetty for HTTP● Jersey for REST● Jackson for JSON● Metrics for metrics● Guava (highly optimized immutable data structures,
speed up development)● Logback and slf4j for performant logging● Hibernate Validator (JSR-303)● Apache HttpClient and Jersey client (interaction with
other web services)● JDBI or Hibernate● Liquibase● Freemarker or Mustache (simple template system)● Joda Time (handling dates and times)
Jetty
● Incredibly tuned embedded HTTP server.● Running your service as a simple process.● No PermGen issues● No application server configuration and
maintenance● No arcane deployment tools● No ClassLoader troubles● No hidden application logs● No trying to tune a single garbage collector
to work with multiple application workloads
Jersey
● JAX-RS (JSR 311: Java API for RESTful Web Services)
● full-featured RESTful web framework● nothing beats in terms of features and
performance● allows to write clean, testable classes which
gracefully map HTTP requests to simple Java objects
● supports streaming output, matrix URI parameters, conditional GET requests
● and much, much more
Jackson
● lightning fast● has a sophisticated object mapper● allows to export domain models directly
Metrics
● powerful toolkit of ways to measure the behavior of critical components in your production environment
● with modules for common libraries like Jetty, Logback, Log4j, Apache HttpClient, Ehcache, JDBI, Jersey and reporting backends like Ganglia and Graphite, Metrics provides you with full-stack visibility.
hello world
hello world
hello world
hello world
hello world
hello world
hello world
сборка
● Apache Maven● Fat JAR
запуск приложения
java -jar target/hello-world-0.0.1-SNAPSHOT.jar server hello-world.yml
лицензия
● Apache License v2.0
интересности
● Отсутствие IoC● Optional:Optional<Integer> possible = Optional.of(5);possible.isPresent(); // returns truepossible.get(); // returns 5● Immutability
SWOT
● Strengths○ Provisioning○ Deployment○ Monitoring and Logging○ Alerting○ Tend to Service Oriented Architecture○ Loose Coupling
● Weaknesses● Opportunities● Threats
○ Support
ссылки
● dropwizard.codahale.com● github.com/codahale/dropwizard
конец
Вопросы?