Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Co se PHP programátor může naučit od Javy?
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Filip Procházka
October 28, 2017
Technology
1
130
Co se PHP programátor může naučit od Javy?
Filip Procházka
October 28, 2017
Tweet
Share
More Decks by Filip Procházka
See All by Filip Procházka
Evolving architecture
fprochazka
0
230
Value objects in PHP
fprochazka
1
220
Jak psát testy na REST API
fprochazka
0
110
V gitu se nic neztratí
fprochazka
0
400
4 roky remote
fprochazka
1
88
Před čím tě Nette ani Symfony neochrání
fprochazka
0
150
Nejlepší cache je žádná cache
fprochazka
0
130
Doctrine: co dělat, když entity nestačí
fprochazka
0
75
Nette framework - How to compile an extensible di container
fprochazka
0
270
Other Decks in Technology
See All in Technology
Exadata Fleet Update
oracle4engineer
PRO
0
1.3k
Agentic Software Modernization - Back to the Roots (Zürich Agentic Coding and Architectures, März 2026)
feststelltaste
1
120
Serverless Agent Architecture on Azure / serverless-agent-on-azure
miyake
1
130
AI Coding Agentの地殻変動 ~ ai-coding.info の定点観測 ~
kotauchisunsun
1
510
「使いにくい」も「運用疲れ」も卒業する UIデザイナーとエンジニアが創る持続可能な内製開発
nrinetcom
PRO
1
770
マネージャー版 "提案のレベル" を上げる
konifar
14
11k
Oracle Cloud Infrastructure:2026年2月度サービス・アップデート
oracle4engineer
PRO
0
200
ソフトウェアアーキテクトのための意思決定術: Create Decision Readiness—The Real Skill Behind Architectural Decision
snoozer05
PRO
28
8.6k
競争優位を生み出す戦略的内製開発の実践技法
masuda220
PRO
2
530
名刺メーカーDevグループ 紹介資料
sansan33
PRO
0
1.1k
バクラクのSREにおけるAgentic AIへの挑戦/Our Journey with Agentic AI
taddy_919
2
970
What's new in Go 1.26?
ciarana
2
280
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Reality Check: Gamification 10 Years Later
codingconduct
0
2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.4k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
290
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
660
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
98
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
130
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
280
Balancing Empowerment & Direction
lara
5
930
The Cost Of JavaScript in 2023
addyosmani
55
9.7k
A Soul's Torment
seathinner
5
2.4k
Transcript
Co se PHP programátor může naučit od Javy? @ProchazkaFilip
Návrhové vzory jsou super • Decorator • Strategy • Visitor
• Builder • Factory • BuilderFactory ❤ • FactoryBuilderFactory ❤❤ • BuilderFactoryBuilderFactory ❤❤❤
None
“Patterns always have two parts: the how and the when.
Not just do you need to know how to implement them, you also have to know when to use them and when to leave them alone.” ~ Martin Fowler
• Premature abstraction • Premature optimalization • … • Nejprve
“nahrubo” • Dodržovat základní pravidla • Po pochopení refaktoring YAGNI
Don’t reinvent the wheel: Hotová řešení • Frameworky ◦ Spring
vs Nette vs Symfony • Knihovny ◦ Hibernate vs Doctrine • Články • Nástroje • ….
Don’t reinvent the wheel: Standardy • JSR 354: Money and
Currency API ◦ https://github.com/brick/money • JSR 310: Date and Time API ◦ https://github.com/brick/date-time
Compile-time • Kompilace je spása ◦ Chvilku trvá... ◦ Nenahrazuje
testy! • PHPStan https://xkcd.com/303/
(silné) Typy!
Silné typy: array • Std lib + Generika ◦ Map<LocalDate,
List<LocalTime>> ◦ LinkedList vs ArrayList ◦ HashMap vs TreeMap • PHPDoc ◦ Příklady v PHPStan testech /** @var Collection|Dolor[] */ private $dolors;
Silné typy: string • Musí být typehint string? • Nešlo
by to lépe?
Value objects • VO vs Entity • Hodnota vs identita
Value objects • PHP nemá Time ani Date, má Datetime
◦ Můžu si napsat vlastní ◦ Nebo můžu použít Brick! :) • EmailAddress • PhoneNumber • Url (Nette) • DateRange, TimeRange, NumberRange • PostalAddress ◦ Může a nemusí být VO
Value objects: vlastnosti • Rovnost ◦ == vs === vs
equals() • Validita • Immutabilita • VO != DTO
Shrnutí • Návrhové vzory jsou super • Don’t reinvent the
wheel • Silné typy • Value objects
@ProchazkaFilip