expensive) unmaintainable code base, with zero or low test coverage Application has to be rebuilt / redesigned several times (meaning the whole Application, not the UI) Many lead companies had to face the painful challenge of rebuilding! The (most usual) problem
coupled! Controller knows too much Taken from iOS article. Appliable to Android and other frameworks https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52
coupled! Controller knows too much Taken from iOS article. Appliable to Android and other frameworks https://medium.com/ios-os-x-development/ios-architecture-patterns-ecba4c38de52
is modeled as an interaction between two main actors: the View and the Presenter. Activities / Fragments / CustomViews implement the abstract View class (do not confuse with android.view.View) Presenter represents the events that can happen to the App (onItemClicks, onDataReceived, onCreate). View represents the reactions to these events (showLoading, hideLoading, showUsersList, showErrorMessage, showPushDialog).
in software design. When a system is littered with many snippets of identical, or nearly identical code, it is indicative of sloppiness, carelessness, and sheer unprofessionalism. It is the guilt-edged responsibility of all software developers to root out and eliminate duplication whenever they find it." Robert C. Martin, “Clean Code - A handbook of agile Software Craftmanship”
only call methods of these: • C • an object created by f() • an object passed to f() as argument • an instance variable of C public class C { public void f() { // ... } }
- Watch out for premature optimization - Avoid deep class hierarchies - Go with the “L” (do Liskov exchanges) - Expose your dependencies - Depend on abstractions, never concretions
- Watch out for premature optimization - Avoid deep class hierarchies - Go with the “L” (do Liskov exchanges) - Expose your dependencies - Depend on abstractions, never concretions
- Watch out for premature optimization - Avoid deep class hierarchies - Go with the “L” (do Liskov exchanges) - Expose your dependencies - Depend on abstractions, never concretions
- Watch out for premature optimization - Avoid deep class hierarchies - Go with the “L” (do Liskov exchanges) - Expose your dependencies - Depend on abstractions, never concretions
Do extensive use of them - Three ways of implementing: 1. Extending from Widgets (TextView, ImageView, EditText…) 2. Extending from Layout / ViewGroup, inflating XML layout 3. Extending from View and overriding onDraw to paint on canvas - Don’t forget to abstract when possible! - Example: ProgressButtonView (2.) - WheelIndicatorView (3.) https://speakerdeck.com/voghdev/number-androiddev-like-engineers
var, layout, view naming. Never violate it! - Package distribution - iterate / choose the one that fits best - Checkstyle - Gradle flavors - BuildConfig vars https://github.com/voghDev/dagger2-clean-mvp-example/
Alt+A > Search everywhere • Alt+J > God (in form of Android Studio shortcut) • (2x) Shift > Search everywhere • (2x) Ctrl+Shift+S > Extract style • Alt+Shift+Up/Down > Move line up / down • Ctrl+D > Duplicate line • (2x) Ctrl+Shift+G > Generate Signed APK • Shift+F6 > Refactor - Rename... • Alt+Enter (some usages in the next slide)
Alt+A > Search everywhere • Alt+J > God (in form of Android Studio shortcut) • (2x) Shift > Search everywhere • (2x) Ctrl+Shift+S > Extract style • Alt+Shift+Up/Down > Move line up / down • Ctrl+D > Duplicate line • (2x) Ctrl+Shift+G > Generate Signed APK • Shift+F6 > Refactor - Rename... • Alt+Enter (some usages in the next slide)
Alt+A > Search everywhere • Alt+J > God (in form of Android Studio shortcut) • (2x) Shift > Search everywhere • (2x) Ctrl+Shift+S > Extract style • Alt+Shift+Up/Down > Move line up / down • Ctrl+D > Duplicate line • (2x) Ctrl+Shift+G > Generate Signed APK • Shift+F6 > Refactor - Rename... • Alt+Enter (some usages in the next slide) Special thanks to @jrgonzalez (Quadbits) for telling me about Alt+J !!
(Available in https://github.com/voghDev/DevFestTalks/tree/master/settings) ✓ They save us precious time ✓ Risky when code is not clean! - Act as an effective “boilerplate machinegun” • datasource • presenter • presenter-impl • renderers An interesting talk: http://www.slideshare.net/everywaretech/weapons-for-boilerplate-destruction
(Available in https://github.com/voghDev/DevFestTalks/tree/master/settings) ✓ They save us precious time ✓ Risky when code is not clean! - Act as an effective “boilerplate machinegun” • datasource • presenter • presenter-impl • renderers An interesting talk: http://www.slideshare.net/everywaretech/weapons-for-boilerplate-destruction
full MVP implementation made by @goKarumi, based on CLEAN architecture - RxJava - “Java library for asynchronous programming with observable streams” - MVVM - Another interesting architectural pattern, alternative to MVP - Scala on Android - applying this Lightweight Functional Programming language for #AndroidDev - Kotlin - Concise, simple and very easy to read Programming language made by JetBrains
neither do I - If you have gained some “experience points” and feel motivated to start improving your coding skills, that’s definitely a win - Feel free to come and ask me, or reach me via email: [email protected]
architecture blueprints: https://github.com/googlesamples/android-architecture/ - Very skilled android architectures and good practices: http://www.quadbits.com - Rosie - Android framework to create applications following the principles of CLEAN architecture: https://github.com/Karumi/Rosie - All the credited talks and repos in https://github.com/voghDev/dagger2-clean-mvp-example - Ez video to gif converter: http://ezgif.com/video-to-gif/