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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
Facilitating Awesome Meetings
lara
57
6.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
750
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
300
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
300
Deep Space Network (abreviated)
tonyrice
0
45
KATA
mclloyd
PRO
34
15k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
120
Scaling GitHub
holman
464
140k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
53
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
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?