𝗘𝗹𝗲𝗴𝗮𝗻𝘁 𝗢𝗯𝗷𝗲𝗰𝘁𝘀

The Elegant Object

Contents

  • What are Elegant Objects?
  • EO principles
  • Resources

The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.
– Joe Armstrong

What are Elegant Objects?

Elegant Objects (EO) is an object-oriented programming paradigm that renounces traditional techniques like nullgetters-and-setterscode in constructorsmutable objectsstatic methodsannotationstype castingimplementation inheritancedata objectsetc.

EO Principles

  • No null (why?)
  • No code in constructors (why?)
  • No getters and setters (why?)
  • No mutable objects (why?)
  • No readers, parsers, controllers, sorters, and so on (why?)
  • No static methods, not even private ones (why?)
  • No instanceof, type casting, or reflection (why?)
  • No public methods without a contract (interface) (why?)
  • No statements in test methods except assertThat (why?)
  • No ORM or ActiveRecord (why? and why?)
  • No implementation inheritance (why? and why?)

Resources

https://www.elegantobjects.org/

Related posts

Leave a Comment