Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Co se PHP programátor může naučit od Javy?
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Filip Procházka
October 28, 2017
Technology
160
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Co se PHP programátor může naučit od Javy?
Filip Procházka
October 28, 2017
More Decks by Filip Procházka
See All by Filip Procházka
Evolving architecture
fprochazka
0
260
Value objects in PHP
fprochazka
1
250
Jak psát testy na REST API
fprochazka
0
140
V gitu se nic neztratí
fprochazka
0
420
4 roky remote
fprochazka
1
95
Před čím tě Nette ani Symfony neochrání
fprochazka
0
160
Nejlepší cache je žádná cache
fprochazka
0
140
Doctrine: co dělat, když entity nestačí
fprochazka
0
89
Nette framework - How to compile an extensible di container
fprochazka
0
300
Other Decks in Technology
See All in Technology
AIに攻撃される前に、AIに攻撃させる
tsuchikazu
0
160
自作バイナリを動かす「入口」8選
puhitaku
1
100
freeeらしさをAIとともに作る / Creating the freee Experience with AI
ymrl
0
210
契約書画像からの情報抽出に特化した視覚接地モデルを育てる話
sansantech
PRO
1
150
事業活動を AI Ready にする攻めと守りのデータエンジニアリング / data-engineering-for-ai-ready-business
pei0804
5
1.9k
生成AIと進める探索的データ分析(2026.10.03 第122回Tokyo.R勉強会)
tatamiya
2
1.4k
Futexes the good, the bad, the ugly
ennael
PRO
0
130
Incremental HTTP
kazuho
5
2.1k
1万名の社員が使う認証基盤で どう信頼性を担保するか?
kairim0
0
210
SREでアラート疲れを 解決しよう!
kairim0
1
210
More Freedom on the Same Shared GPU Cluster: A Small Team’s Experience with vCluster
nttcom
0
140
全PRの83%が AIレビューだけでマージできるようになった開発組織は その後どうなったか @2026/10
athug
0
120
Featured
See All Featured
Ethics towards AI in product and experience design
skipperchong
2
420
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
970
The SEO identity crisis: Don't let AI make you average
varn
0
580
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
450
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Documentation Writing (for coders)
carmenintech
77
5.6k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
420
Paper Plane
katiecoart
PRO
4
54k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
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