Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Elegant Objects and Cactoos

Elegant Objects and Cactoos

Overview of the EO paradigm and small overview of the Cactoos library for Porto Codes Meetup

Filipe Freire

December 21, 2017
Tweet

More Decks by Filipe Freire

Other Decks in Programming

Transcript

  1. Quick intro Learner, tester, developer, husband
 OSS contributor 2y work

    as a “coding” tester
 1y work as a developer Currently @ filfreire.com 2
  2. 17

  3. An object isn’t: 1) A link between worlds 2) A

    collection of procedures 
 plus data 22
  4. A Finder of Prime Numbers vs A List of numbers

    that 
 returns only primes 24
  5. Example “I want results for a Tennis match” Tennis_31Feb.xlsx TENNIS.txt

    tennis_res.json Sources: … ExcelTennisMatch TextTennisMatch JsonTennisMatch 34
  6. Example “I want results for a Tennis match” ExcelTennisMatch TextTennisMatch

    JsonTennisMatch TennisMatch GameMatch implement extends 35
  7. Some benefits Thread Safety Avoiding Temporal Coupling Avoiding side effects

    Avoiding identity mutability (more at http://yegor256.com/2014/06/09/objects-should-be-immutable.html) 40
  8. - Hello, is it a software department?
 - Yes.
 -

    Let me talk to your employee "Jeffrey" please.
 - Hold the line please...
 - Hello.
 - … 43
  9. - Hello, is it a software department?
 - Yes.
 -

    Let me talk to your employee "Jeffrey" please.
 - Hold the line please...
 - Hello.
 - Are you NULL? (more at http://www.yegor256.com/2014/05/13/why-null-is-bad.html) 44
  10. Meaning… No null No code in constructors No getters and

    setters No mutable objects No static methods, not even private ones (among other stuff) 48