Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
What to Upload to SlideShare
Next
Download to read offline and view in fullscreen.

1

Share

Download to read offline

Java Annotations Are Evil

Download to read offline

JPoint 2017; Moscow, Russia; 8 April 2017; video is here: https://www.youtube.com/watch?v=20QBvrHq6TA

Related Books

Free with a 30 day trial from Scribd

See all

Related Audiobooks

Free with a 30 day trial from Scribd

See all

Java Annotations Are Evil

  1. 1. /24@yegor256 1 Аннотации — это зло Yegor Bugayenko Annotations Are Evil
  2. 2. /24@yegor256 2 “Егор в своем стиле: все гондурасы, а я д’Артаньян.” Д’Артаньян и три мушкетёра (1978)
  3. 3. /24@yegor256 3 “Попал как будто на выступление лидера какой-то секты.” The Evil Cult (1993)
  4. 4. /24@yegor256 4 “Автор — маньяк.” The Silence of the Lambs (1991)
  5. 5. /24@yegor256 5 1000+ takes.org 14000+ jcabi.com rultor.com jare.io since
 1988 2007 250+
  6. 6. /24@yegor256 6 since 2014
  7. 7. /24@yegor256 7 Compiler: @Override, @Deprecated, @SuppressWarning DI: @Inject, @Singleton, etc. Serialization: @XmlElement, etc. Validation: @NotNull, etc. Behavior: @GET, @Transaction AOP: @RetryOnFailure, @Cacheable Unit testing: @Test, @Before, @Rule, etc. Lombok: @ToString, @EqualsAndHashCode, etc. Something else?…
  8. 8. /24@yegor256 8 class Page { @GET String index() { return “Hello, world!”; } }
  9. 9. /24@yegor256 9 class Page { String index(Request request) { if (request.method().equals(“GET”)) { return “Hello, world!”; } return “Method not allowed”; } }
  10. 10. /24@yegor256 10 class Page { @GET String index() { return “Hello, world!”; } } class Dispatcher { String dispatch(Page page, Request request) { if (request.method().equals(“GET”) && page.getClass().getMethod(“index”) .isAnnotationPresent(GET.class)) { return page.index(); } return “Method not allowed”; } }
  11. 11. /24@yegor256 11 Page Dispatcher
  12. 12. /24@yegor256 12 Page Dispatcher 1 upside down
  13. 13. /24@yegor256 13 Page Dispatcher 2 unclear dependencies ???
  14. 14. /24@yegor256 14 —Ты BeanPostProcessor видишь? —Нет. —А он есть! ДМБ (2000)
  15. 15. /24@yegor256 15 Page 3 no encapsulation Data
  16. 16. /24@yegor256 16 HelloPage GETPage
  17. 17. /24@yegor256 17 class HelloPage implements Page { @Override String index(Request request) { return “200 Hello, world!”; } } class GETPage implements Page { private final Page page; @Override String index(Request request) { if (request.method().equals(“GET”)) { return page.index(); } return “Method not allowed”; } }
  18. 18. /24@yegor256 18 procedural
  19. 19. /24@yegor256 19 object-oriented
  20. 20. /24@yegor256 20 Compiler: @Override, @Deprecated, @SuppressWarning DI: @Inject, @Singleton, etc. Serialization: @XmlElement, etc. Validation: @NotNull, etc. Behavior: @GET, @Transaction AOP: @RetryOnFailure, @Cacheable Unit testing: @Test, @Before, @Rule, etc. Lombok: @ToString, @EqualsAndHashCode, etc.
  21. 21. /24@yegor256 21
  22. 22. /24@yegor256 22 Can I see the code?Можно ли посмотреть код?
  23. 23. /24@yegor256 23 The Shining (1980)
  24. 24. /24@yegor256 24 yegor256.com
  • StrasserMathias1

    May. 13, 2017

JPoint 2017; Moscow, Russia; 8 April 2017; video is here: https://www.youtube.com/watch?v=20QBvrHq6TA

Views

Total views

860

On Slideshare

0

From embeds

0

Number of embeds

3

Actions

Downloads

5

Shares

0

Comments

0

Likes

1

×