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 null, getters-and-setters, code in constructors, mutable objects, static methods, annotations, type casting, implementation inheritance, data objects, etc.
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?)