Slide 1

Slide 1 text

every developer should consider lemi orhan ergin 10 exclusive development practice

Slide 2

Slide 2 text

LEMi ORHAN ERGiN co-founder, Craftbase founder, Software Craftsmanship Turkey alumni, Sony, eBay, ACM, iyzico programming, since 2001 with love speakerdeck.com/lemiorhan @lemiorhan

Slide 3

Slide 3 text

Something is wrong in software development

Slide 4

Slide 4 text

we are not developers anymore, we are framework implementers

Slide 5

Slide 5 text

high coupling and low cohesion makes impossible to write tests

Slide 6

Slide 6 text

we are afraid of refactoring even with a comprehensive test suite

Slide 7

Slide 7 text

rework is inevitable even the development is already done

Slide 8

Slide 8 text

we write unit tests, but functionalities still fail

Slide 9

Slide 9 text

Start with a mono-repo Refactoring is the most common activity you do for an immature in-progress product. So do not drown in change sets among multi repos. Start with one, split if required in the future.

Slide 10

Slide 10 text

Clear ownership for each repo Possible to restrict access for each repo Lightweight repository, narrow clones Independent upgrade & versioning strategy Manage like open source applications Multi Repository System Cross repo changes and refactorings are painful Adds overhead if one team handles multiple repos Need to open multiple IDEs to write code Need to manage versions of many small libraries Need to pull changes on many repos

Slide 11

Slide 11 text

All about moving fast and getting things done Enables experimenting cross-project More relevant pull requests & commits Cannot restrict to access for specific projects Low flexibility of dependency upgrade Needs special tooling for building Usefulness of tags diminishes Mono Repository System Easier to navigate on sourcecode Unified versioning, one source of truth You don’t need to define version numbers Easy cross-project refactoring Update dependencies to latest overall No wasting time with multiple git commands Increase developer productivity Twi!er, Facebook, Google, Digital Ocean, Foursquare, Etsy, Shippable, Ravelin Who migrated from multi to mono repositories?

Slide 12

Slide 12 text

You can not do CI without using mono-repos Ivan Moore

Slide 13

Slide 13 text

You can not do CI without using mono-repos Ivan Moore B C A unit tests integration tests component tests contract tests external verifier contract stub tests functional tests

Slide 14

Slide 14 text

Demo Time: Special Tooling with Gradle

Slide 15

Slide 15 text

Microservice Microservice Microservice Microservice Microservice Microservice Mono Repository Microservice Microservice Microservice Microservice Microservice Microservice

Slide 16

Slide 16 text

Microservice Microservice Microservice Microservice Microservice Microservice Mono Repository Microservice Microservice Microservice Microservice Microservice Microservice Read-only Multi Repositories splitting

Slide 17

Slide 17 text

Microservice Microservice Microservice Microservice Microservice Microservice Mono Repository Microservice Microservice Microservice Microservice Microservice Microservice Read-only Multi Repositories packaging & deployment splitting

Slide 18

Slide 18 text

Demo Time: Sparse Checkout

Slide 19

Slide 19 text

Using microservices when you are not prepared

Slide 20

Slide 20 text

Start with monoliths If you have no experience with building microservices at production, it could be a nightmare if you jump into it. Microservices requires to have devops culture, agile mindset and a new paradigm for software development. So be pragmatic.

Slide 21

Slide 21 text

HELL DEPENDENCY OF MICROSERVICES

Slide 22

Slide 22 text

Focus on modularity If you cannot develop well-crafted monoliths, how can you be sure you can build well- crafted microservices? Make your architecture clean and modular by following related design patterns and principles. Make your monolith well-crafted first. Then if you need to scale, split it to microservices.

Slide 23

Slide 23 text

https://twitter.com/martinfowler/status/606096712969633794 Martin Fowler Author, speaker, and general loud mouth on Software Development. Works for ThoughtWorks. posted: the monolith-first strategy to building microservices (or not) Martin Fowler @martinfowler 4:54 PM · Jun 3, 2015

Slide 24

Slide 24 text

Image Credit: Benoit Hediard, https://medium.com/@benorama/the-evolution-of-software-architecture-bd6ea674c477

Slide 25

Slide 25 text

Image Credit: Benoit Hediard, https://medium.com/@benorama/the-evolution-of-software-architecture-bd6ea674c477

Slide 26

Slide 26 text

ports business adapters mysql adapter stripe adapter rest api web ui domain

Slide 27

Slide 27 text

ports adapters domain 3rd party apps command line soap calls admin gui batch jobs mobile apps other hexagons cache provider elastic search mail server database sms provider message queue other hexagons business mysql adapter stripe adapter rest api web ui

Slide 28

Slide 28 text

ports adapters notification payment billing order basket restaurant scheduling caching search mail account messaging stripe adapter rest api mysql adapter web ui domain business

Slide 29

Slide 29 text

Hexagons in practice

Slide 30

Slide 30 text

domain infra

Slide 31

Slide 31 text

No content

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

Sebastian Daschner from his talk about “Design principles for the effective developer” at Devoxx Ukraine 2019

Slide 34

Slide 34 text

No content

Slide 35

Slide 35 text

Let it shaped with Domain Driven Design

Slide 36

Slide 36 text

ports adapters notification payment billing order basket restaurant scheduling caching search mail account messaging stripe adapter rest api mysql adapter web ui domain business

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

a SEARCH

Slide 39

Slide 39 text

a c SEARCH PAYMENT

Slide 40

Slide 40 text

c a SEARCH PAYMENT ACCOUNT

Slide 41

Slide 41 text

Walking Skeleton First release delivers an extremely small, but functional, initial version of your system. Once the skeleton of the system is in place, we have various places where we can start fleshing out functionality - putting meat on the bones. from the book “Growing Object-Oriented Software, Guided by Test” Deploy to production early and often, even start from the first sprint Focus on integration tasks first Build CD pipeline from the first day

Slide 42

Slide 42 text

Release and deploy code to prod multiple times a day Trunk Based Development lets you release multiple times a day. But it is a long journey to complete. do you really need that?

Slide 43

Slide 43 text

Weekly Releases STEP-1 Multiple Releases in a Day STEP-3 Daily Releases STEP-2

Slide 44

Slide 44 text

Daily Releases STEP-2 Multiple Releases in a Day STEP-3 Using Git-Flow Everyone codes individually No/few tests, huge manual test cost CI server used for building packages Weekly releases at best Manual deployment to pre-prod Manual functionality testing Manual deployment to prod DoD: Developed & tested at local

Slide 45

Slide 45 text

Multiple Releases in a Day STEP-3 Master-Feature branching Active Pair programming Have a test suite CI server runs tests for validation Daily releases at best Pull requests for code review Automatic deployment to pre-prod Manual functionality testing Manual deployment to prod DoD: Deployed to pre-prod Using Git-Flow Everyone codes individually No/few tests, huge manual test cost CI server used for building packages Weekly releases at best Manual deployment to pre-prod Manual functionality testing Manual deployment to prod DoD: Developed & tested at local

Slide 46

Slide 46 text

No branches, just master Feature flags Active Mob programming Have a elegant test suite Multiple releases per day at best No pull requests Each commit is deployable On-demand env. at each merge Automatic deployment to pre-prod Automatic acceptance testing Manual deployment to prod DoD: Deployed to prod Master-Feature branching Active Pair programming Have a test suite CI server runs tests for validation Daily releases at best Pull requests for code review Automatic deployment to pre-prod Manual functionality testing Manual deployment to prod DoD: Deployed to pre-prod Using Git-Flow Everyone codes individually No/few tests, huge manual test cost CI server used for building packages Weekly releases at best Manual deployment to pre-prod Manual functionality testing Manual deployment to prod DoD: Developed & tested at local trunk based development

Slide 47

Slide 47 text

If you want to go fast, go African Proverb If you want to go far go alone together

Slide 48

Slide 48 text

If you want to go fast, go Software Development Proverb If you want to go far go with pair with mob

Slide 49

Slide 49 text

One driver, many navigators Switch the keyboard regularly At least half a day in every week Mob Programming

Slide 50

Slide 50 text

1. Start with mono-repository 2. Mono-repo splitting for easy CD pipeline 3. Advanced tooling with Gradle 4. Sparse-checkout for dealing with fewer files 5. Start with a monolith 6. Hexagonal architecture for modular monoliths 7. Mob programming 8. Trunk based development 9. Deploy to production from the first sprint 10. Release and deploy to production multiple times a day

Slide 51

Slide 51 text

@craftbaseio craftbase.io LEMi ORHAN ERGiN @lemiorhan