Pro Yearly is on sale from $80 to $50! »

Time Driven Development

Time Driven Development

Software architecture is more than blindly following design principles or using design patterns. They come with trade-offs that you should keep in mind before deciding on the right architecture for your project. Use them as tools to achieve simpler code that's easier to maintain as opposed to goals that you aim to achieve regardless of the context.

6165f5bae67e249133eba24da4b93780?s=128

Katerina Trajchevska

July 25, 2019
Tweet

Transcript

  1. TIME DRIVEN DEVELOPMENT @ktrajchevska

  2. 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
  3. @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.
  4. Example #1 Developing a module for managing user profiles

  5. None
  6. App\ZohoCandidate.php

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

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

  9. App\Http\Controllers\CandidateController.php

  10. @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.
  11. Demo #1 Changing the storage to MySQL

  12. @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.
  13. How can we save time by improving the code design?

  14. 1. Don’t depend on concrete implementations.

  15. App\Repositories\Interfaces\CandidateRepositoryInterface.php

  16. App\Http\Controllers\CandidateController.php

  17. App\Http\Controllers\CandidateController.php

  18. 2. Be mindful about what your program expects.

  19. App\Crm\Candidate.php

  20. profile.blade.php

  21. 3. Bind abstractions with concrete implementation.

  22. App\Providers\AppServiceProvider.php

  23. Demo #2 Changing the storage to MySQL

  24. @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.
  25. Example #2 Developing a module for integrating Github

  26. Integrations\VersionControl\VersionControlFactory.php

  27. App\Integrations\Interfaces\AbstractVersionControl.php

  28. Integrations\VersionControl\Github.php

  29. App\Http\Controllers\Admin\CandidateController.php

  30. None
  31. You Aren’t Gonna Need It

  32. Is there a better way to do it?

  33. App\Http\Controllers\Admin\CandidateController.php

  34. Why Time Driven Development?

  35. @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.
  36. Software Design Principles are your tools, not your goals.

  37. @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.
  38. Thanks! @ktrajchevska adeva.co Exclusive developers’ network.