Ronaldo Pace fell in love with Android since the HTC Dream (a.k.a. the G1); When he was working at an agency he had the chance to develop a few internal use libraries and even his very own image download and caching (before Picasso/Glide). After moving to Berlin and working at EyeEm Ronaldo got deeper into open sources libraries and he has been hard at work developing some interesting tools.
To promote a more flexible feature development on EyeEm’s Android platform, Ronaldo and his team developed the decorator and router libraries. To better serve a 17-million strong photo community, they opted for a new architectural pattern that follows the single responsibility principle, favors composition over inheritance, and helps developers iterate much faster on UIs. This allows for dynamic addition of features on demand – feature flags, A/B tests, personalization – and helps avoid “inheritance hell.”
The goal is to decouple responsibilities from the parent class into reusable components. Individual decorators can then be attached to otherwise empty parent classes to do a single job. This allows a simple java class to have multiple and dynamic inheritance. At EyeEm they have engineered an easy-to-use code-generation library to make this pattern scalable with minimal boilerplate, and to automate most of its creation.
The router library was inspired by Clay Allsopp’s Router project and introduces an expansive configuration file that allows newbies, non-technical people and veterans to quickly grasp the relationships between different parts of the app, while simplifying complex URL handling. The configuration can be modified at runtime, opening up the possibilities and flexibility to sideload it from the assets folder, or even change it directly from servers.
In this session you will dive into the technical implementation of a modular application and the talk is accompanied with open sourcing libraries and sample code/implementations. After the session, attendees can implement this pattern into their projects.