Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Developing Libraries is Hard
Search
Domagoj Korman
October 17, 2018
0
46
Developing Libraries is Hard
Why and how to create a library and discuss potential footguns
Domagoj Korman
October 17, 2018
Tweet
Share
More Decks by Domagoj Korman
See All by Domagoj Korman
Mastering Coordinator Layout
domagojkorman
0
330
Featured
See All Featured
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
140
How to Build an AI Search Optimization Roadmap - Criteria and Steps to Take #SEOIRL
aleyda
1
1.9k
Raft: Consensus for Rubyists
vanstee
141
7.3k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
180
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
The Cost Of JavaScript in 2023
addyosmani
55
9.5k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
The Limits of Empathy - UXLibs8
cassininazir
1
210
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
170
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
75
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Transcript
Developing Libraries Is Hard DOMAGOJ KORMAN
* * * *
None
* * * * * *
SHOULD I MAKE A LIBRARY?
SHOULD I MAKE A LIBRARY? • Terrible Google API
SHOULD I MAKE A LIBRARY? • Terrible Google API •
Common problems
SHOULD I MAKE A LIBRARY? • Terrible Google API •
Common problems • Outdated existing library
OUR LIBRARY Draw 2D shape
API IMPLEMENTATION CircleDrawer I need I need I need RectangleDrawer
draw() Drawer
draw() API INTERNAL CONFIGURABLE • Prepare canvas • Prepare paint
• Draw shape • Catch/Throw exceptions • Provide paint color • Provide shape
INTERNAL CONFIGURABLE BUILDER setShapeProvider() setPaintProvider() build() PaintProvider ShapeProvider
draw() API INTERNAL CONFIGURABLE PaintProvider ShapeProvider
SHOULD I USE RXJAVA OR KOTLIN?
None
WELL MAYBE
METHOD COUNT RxJava: 10,582 Kotlin-stdlib: 6,106
MULTI-MODULE SETUP
draw() API INTERNAL CONFIGURABLE PaintProvider ShapeProvider
draw() API INTERNAL CONFIGURABLE PaintProvider ShapeProvider rxDraw() RXAPI
class RxApiImpl : RxApi { private val api: Api }
fun rxDraw(): Observable<Event> { api.draw(object: Callback { override fun onSuccess()
= observable.onCompleted() override fun onError(t: Throwable) = observable.onError(t) }) return observable }
fun rxDraw(): Observable<Event> { api.draw(object: Callback { override fun onSuccess()
= observable.onCompleted() override fun onError(t: Throwable) = observable.onError(t) }) return observable }
dependencies { implementation 'co.infinum:draw:1.0.0' implementation 'co.infinum:draw-rx:1.0.0' }
I FINISHED MY LIBRARY. AM I READY TO DEPLOY?
None
LIBRARY Code Tests Documentation (Readme, Javadoc, License) Automated release
README • Quick guide on top - as short as
possible • Complex stuff below
JAVADOC • Add javadoc to public API!
LICENSES Copyleft Permissive GNU GPL MIT Apache
AUTOMATE RELEASE • Gradle Bintray Plugin • Complex to understand
and setup • Awesome documentation • Easy to use after setup
DEPLOY
OUR STUFF https://github.com/infinum/Android-Goldfinger https://github.com/infinum/android-complexify https://github.com/infinum/android_dbinspector https://github.com/infinum/Android-prince-of-versions
Visit infinum.co or find us on social networks: infinum.co infinumco
infinumco infinum Questions?