Nella vita quotidiana di un team di sviluppo ci si trova a dover prendere decisioni sull'architettura: implementiamo un sistema basato su CQRS? Quali principi del Domain Driven Design vogliamo applicare e come? Un approccio CRUD è sufficiente in questo contesto?
Sia che questa decisione sia presa in modo partecipativo o meno ed indipendentemente dalla risposta, come ci assicuriamo che tutti rispettino la scelta fatta? In questo talk vedremo quali approcci e strumenti abbiamo a disposizione per comunicare, condividere e controllare le decisioni architetturali.
9. We’ll going implement this application using CQRS
questions on slide.do, code #phpdayPUGed
10. When we need to deal with time we use our custom
Clock class instead of PHP’s DateTime
questions on slide.do, code #phpdayPUGed
11. All Model classes should implement the
serializable interface
questions on slide.do, code #phpdayPUGed
12. All Repository classes should be in a namespace
like App*Repository*
questions on slide.do, code #phpdayPUGed
13. Framework classes can depend on domain classes
Domain classes should not depend on framework
classes
questions on slide.do, code #phpdayPUGed
14. Sooo… why should I care?
questions on slide.do, code #phpdayPUGed
15. Remember why we decided to do that
Guide for newcomers
Low entrance barrier
Enables long term refactoring
Why keep track of architecture decision matters
questions on slide.do, code #phpdayPUGed
17. Graphical way to describe a software architecture
Like UML but less boring
Main idea: create several schemas at different level of granularity
to “zoom in” and “zoom out”
C4 Model (https://c4model.com/)
questions on slide.do, code #phpdayPUGed
26. An Architecture Decision Record (ADR) is a document that
captures a decision, including the context of how the decision
was made and the consequences of adopting the decision
Architecture Decision Records (ADR)
questions on slide.do, code #phpdayPUGed
29. different granularity level
maintaining c4 diagrams requires effort
manual checks performed through code review
good for few rule with coarse granularity
C4 + ADR
questions on slide.do, code #phpdayPUGed
50. Try this at home!
Tokenizer: token_get_all()
Parser: PHP-Parser (https://github.com/nikic/PHP-Parser)
questions on slide.do, code #phpdayPUGed
51. Try this at home!
Tokenizer: token_get_all()
Parser: PHP-Parser (https://github.com/nikic/PHP-Parser)
Static Analisys Tool work
at this level
Fixers/Sniffers
work at this level
questions on slide.do, code #phpdayPUGed
53. What I found so far
Available tool can be extended in a quite simple way
Writing custom rules is hard
questions on slide.do, code #phpdayPUGed
54. What I wish for
All classes
That
Reside in namespace like “AppDTO”
Should
Have Name Ending with “Data”
questions on slide.do, code #phpdayPUGed
55. What I wish for
->allClasses()
That
Reside in namespace like “AppDTO”
Should
Have Name Ending with “Data”
questions on slide.do, code #phpdayPUGed
56. What I wish for
->allClasses()
->that()
Reside in namespace like “AppDTO”
Should
Have Name Ending with “Data”
questions on slide.do, code #phpdayPUGed
57. What I wish for
->allClasses()
->that()
->resideInNamespace(“AppDTO”)
Should
Have Name Ending with “Data”
questions on slide.do, code #phpdayPUGed
58. What I wish for
->allClasses()
->that()
->resideInNamespace(“AppDTO”)
->should()
Have Name Ending with “Data”
questions on slide.do, code #phpdayPUGed
59. What I wish for
->allClasses()
->that()
->resideInNamespace(“AppDTO”)
->should()
->haveNameEndingWith(‘*Data’);
questions on slide.do, code #phpdayPUGed