In Elegant Objects Vol 1 most chapters have an associated blog post.
I've read the book and as clear by my review, I'm a big fan.
A lot of co-workers and colleagues want to borrow one of my copies. To help give some insight into the contents of the book; I've compiled the links to the blog posts here.
With this post, linking to all of Yegor's posts, it'll give a simpler, quicker, hopefully easier, insight into what Elegant Objects is about.
- Encapsulate as little as possible - No Link
- Encapsulate something at the very least
- Always user interfaces
- Choose method names carefully
- Don't use public constants
- Be immutable
- Don't mock; use fakes
- Keep interfaces short; use smarts
- Expose Fewer than five public methods - No Link
- Don't use static methods
- Never accept
- Be loyal and immutable or constant
- Never use getters and setters
- Don't use
newoutside of secondary ctors - No Link
- Avoid type introspection and casting
- Never return
- Throw only checked exceptions
- Be either final or abstract
- Use RAII - No Link
That's the high level of Elegant Objects Volume 1. I hope this shows how great the book is, or at least can open some discussion around these topics.