Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.

Designing functional and fluent API: example of the Visitor Pattern

206 vues

Publié le

This is the slide deck of my talk from Devoxx Belgium 2019. You can watch the video here https://www.youtube.com/watch?v=gq23w9nycBs and get the code here: https://github.com/JosePaumard/devoxx-belgium-2019-visitor-lambda.

Among the patterns from the GoF, the Visitor is probably the more complex to implement. One of the difficulties is that you need to implement it in your object model, leading to complex refactoring for legacy applications. Based on the use of all the nifty tools brought by functional programming: chaining, composition, and partial application, you can implement Visitors without having to change your object model, using a functional and fluent API. This approach can be used to implement other patterns: Builder and Validator. Using this way of designing API leads to readable and robust code, designed following the GoF patterns.

Publié dans : Formation
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Designing functional and fluent API: example of the Visitor Pattern

  1. 1. #Devoxx Designing functional and fluent API: example of the Visitor Pattern José Paumard @JosePaumard
  2. 2. #Devoxx @JosePaumard @JosePaumard https://josepaumard.github.io https://github.com/JosePaumard https://www.pluralsight.com/authors/jose-paumard https://www.slideshare.net/jpaumard https://www.youtube.com/user/JPaumard
  3. 3. #Devoxx @JosePaumard Why the Visitor Pattern? Because it is tough to implement! So if you can implement it, then you can implement anything…
  4. 4. #Devoxx @JosePaumard Live coding! How to make it functional? How to implement it without touching the visited classes? All with a fluent API
  5. 5. #Devoxx Thank you! José Paumard @JosePaumard https://github.com/JosePaumard/devoxx-belgium-2019-visitor-lambda

×