Slide 1

Slide 1 text

TIME DRIVEN DEVELOPMENT @ktrajchevska

Slide 2

Slide 2 text

Exclusive Developers’ Network Katerina Trajchevska ● 1x Engineer & Mozilla Tech Speaker ● Co-founder of Adeva, an exclusive developers’ network. ● Consultant with startups and Fortune 500 @ktrajchevska

Slide 3

Slide 3 text

@ktrajchevska What are we going to talk about? 1. How to design software for easy maintenance, extension and modification. 2. How to know when to stop and make better use of your time.

Slide 4

Slide 4 text

Example #1 Developing a module for managing user profiles

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

App\ZohoCandidate.php

Slide 7

Slide 7 text

App\Http\Controllers\CandidateController.php ! We directly depend on the CRM storage.

Slide 8

Slide 8 text

profile.blade.php ! Using arrays to access the data.

Slide 9

Slide 9 text

App\Http\Controllers\CandidateController.php

Slide 10

Slide 10 text

@ktrajchevska Red Flags Controller knows too much and is open for modification. Methods depend directly on the CRM storage and their naming conventions. View uses arrays that should be replaced with Collections in future.

Slide 11

Slide 11 text

Demo #1 Changing the storage to MySQL

Slide 12

Slide 12 text

@ktrajchevska What does it take to switch the storage? 1. Add Eloquent models to use with MySQL. 2. Change controller dependencies from CRM class to Eloquent. 3. Use Eloquent instead of CRM to pull data for the view. 4. Switch all variables to the new naming convention. 5. Change the way we access data in the views. 6. Adjust the unit tests to work accordingly.

Slide 13

Slide 13 text

How can we save time by improving the code design?

Slide 14

Slide 14 text

1. Don’t depend on concrete implementations.

Slide 15

Slide 15 text

App\Repositories\Interfaces\CandidateRepositoryInterface.php

Slide 16

Slide 16 text

App\Http\Controllers\CandidateController.php

Slide 17

Slide 17 text

App\Http\Controllers\CandidateController.php

Slide 18

Slide 18 text

2. Be mindful about what your program expects.

Slide 19

Slide 19 text

App\Crm\Candidate.php

Slide 20

Slide 20 text

profile.blade.php

Slide 21

Slide 21 text

3. Bind abstractions with concrete implementation.

Slide 22

Slide 22 text

App\Providers\AppServiceProvider.php

Slide 23

Slide 23 text

Demo #2 Changing the storage to MySQL

Slide 24

Slide 24 text

@ktrajchevska What does it take to switch the storage? 1. Add Eloquent models to use with MySQL. 2. Create MysqlCandidateRepository that implements CandidateRepositoryInterface. 3. Change the binding for CandidateRepositoryInterface in AppServiceProvider.

Slide 25

Slide 25 text

Example #2 Developing a module for integrating Github

Slide 26

Slide 26 text

Integrations\VersionControl\VersionControlFactory.php

Slide 27

Slide 27 text

App\Integrations\Interfaces\AbstractVersionControl.php

Slide 28

Slide 28 text

Integrations\VersionControl\Github.php

Slide 29

Slide 29 text

App\Http\Controllers\Admin\CandidateController.php

Slide 30

Slide 30 text

No content

Slide 31

Slide 31 text

You Aren’t Gonna Need It

Slide 32

Slide 32 text

Is there a better way to do it?

Slide 33

Slide 33 text

App\Http\Controllers\Admin\CandidateController.php

Slide 34

Slide 34 text

Why Time Driven Development?

Slide 35

Slide 35 text

@ktrajchevska Why Time Driven Development? ● Software design practices come with trade-offs. Know them. ● Software design principles should simplify your life, not complicate it. ● Thinking about the bigger picture will help you create more than just software. It will help you create value.

Slide 36

Slide 36 text

Software Design Principles are your tools, not your goals.

Slide 37

Slide 37 text

@ktrajchevska How to start practicing Time Driven Development? ● Talk to your lead to understand the business goals before proposing an architecture. ● Always have the context in mind when designing software. ● Don’t shame others for not adhering to “the best” software design practices.

Slide 38

Slide 38 text

Thanks! @ktrajchevska adeva.co Exclusive developers’ network.