Skip to content

Instantly share code, notes, and snippets.

View balch's full-sized avatar

Jay Balcher balch

View GitHub Profile
@balch
balch / README.md
Last active March 22, 2017 23:04
Balch's SDTs

Balch`s Software Design Terms

  • PE - Premature Encapsulation

The act of always creating an interface for a class that has, and will likely only ever have, one implementation

  • ID - Injectile Dysfunction

Causing code bloat via boilerplate syntax and generated classes so one can use an Inject annotation to access Application and Local scoped objects

  • RxSTD - RxJava StackTrace Dementia
@balch
balch / 1 - README.md
Last active January 6, 2017 04:33
Better BuilderPattern

A Better Builder Pattern

The Builder pattern came up during a recent PR while looking at the standard Getter/Setter POJO pattern. I usually avoided the classic Builder pattern based on the necessity to duplicate the member variables in the static inner Builder class.

After some Googling and discussion we decided to use a slightly different Builder pattern. In this version the base object is instantiated in the Builder constructor and simply returned (and discarded) from the build() function. This pattern allows for efficiently creating an