My Way to PHP: Day 33-35 of 75

Decouple your application with (Domain-)Events

Problems:

  • Big controllers

  • Big models

  • No abstraction of business rules

Events:

  • “A significant change of state”

  • No return value

  • No way to stop the execution

  • Use eventDispatcher

  • Event as state approach (enables event sourcing)

 


 

The Internet is your Application Blueprint

 

  • The internet is designed as a decoupled s ystem

  • Why are we building monolithic systems?

  • The return of SOA

  • Comment as a Service (FB, Disque)

  • Authorization as a Service (FB, Twitter, OpenID)

  • Video as a Service (Youtube, Vimeo)

  • Plattform as a Service (AWS, Heroku)

  • Think in protocols / interfaces instead of implementations

 


The Clean Code Talks – “Global State and Singletons”

  • “It never said that it needed that” (regarding the lack of DI and use of Singletons)

 


Simplify your code with annotations

  • @Route also able to add

  • Requirements

  • Name

  • Method

  • @Security with has_role()

  • @ParamConverter to convert request parameters to objects

  • @Assert for Validation

  • @Service and @Cache

 

The sound and video isn’t that good sadly.


Diving Deep Into Twig

The video starts off with a simple overview over Twig and goes into creating own extensions. I’m again surprised how simple this is. The main part is an introduction into the workflow of the Twig compiler.

You could also use Twig templates with meta programming and just compile heavy compilations once and let them generate by Twig.


Updates Goals:

  • Learn Symfony2
  • Learn a bit more about MySQL
  • Write at least one web app using Symfony2 and its core components (templating, testing, forms, validation, security)
  • Watch one video per day on average

Progress status

In Progress

  • Watch one video per day on average [69 of 75]

My Way to PHP: Day 31-32 of 75

I decided to make less posts but longer one, i.e. I try to accumulate enough content.


Standardization, the Symfony Way

  • The debug component looks pretty good. It can be easily integrated in other PHP projects.

  • StreamedResponse class for streaming

  • HttpCache = reverse proxy written in PHP


Your code sucks, lets fix it!

  • Readable? Testable? Maintanable? Reusable?

  • Objects Calistetics = Exercises for OOP

  1. One identitation level per method

  2. Don’t use the else statement

  3. Do not abbreviate

  4. Keep your classes small (200 lines per class, 10 methods per class, 15 classes per package)

  5. Limit the number of instance variables

 

Good talk!


 

Updates Goals:

  • Learn Symfony2
  • Learn a bit more about MySQL
  • Write at least one web app using Symfony2 and its core components (templating, testing, forms, validation, security)
  • Watch one video per day on average

Progress status

In Progress

  • Watch one video per day on average [64 of 75]

My Way to PHP: Day 30 of 75

Performance testing checklist for Symfony2

Yeah, only the first few minutes were interesting. The other stuff was about tools you probably heard before. At the end there are some new tools.


I debugged my other laptop a bit more and it seems that the HDD is broken. I hope it’s only this. Let’s see tomorrow I’m going to a repair shop.


Updates Goals:

  • Learn Symfony2
  • Learn a bit more about MySQL
  • Write at least one web app using Symfony2 and its core components (templating, testing, forms, validation, security)
  • Watch one video per day on average

Progress status

In Progress

  • Watch one video per day on average [62 of 75]

My Way to PHP: Day 29 of 75

Test Coverage at Google

  • Code review before every commit
  • 0.5 to 4 hours until feedback
  • Automatic code review is integrated (testing, test coverage, etc.)

  • Goal 85% (with legacy)

  • Goal 99% incrementally
  • Mostly statement tests (was this line executed?)

 


I spent most of my day debugging my other laptop. It seems that the HDD makes some problems.


Updates Goals:

  • Learn Symfony2
  • Learn a bit more about MySQL
  • Write at least one web app using Symfony2 and its core components (templating, testing, forms, validation, security)
  • Watch one video per day on average

Progress status

In Progress

  • Watch one video per day on average [61 of 75]