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
Filip Procházka
October 28, 2017
Technology
150
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
250
Value objects in PHP
fprochazka
1
240
Jak psát testy na REST API
fprochazka
0
130
V gitu se nic neztratí
fprochazka
0
420
4 roky remote
fprochazka
1
94
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
290
Other Decks in Technology
See All in Technology
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
JSONataとAWS Step Functionsで目指すRuntimelessな世界
mu7889yoon
0
210
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
120
映像変換サーバーなしで端末内でHLSを生成してライブ配信
hikarusato
0
130
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
開発投資の期待値を上げるプロダクトロードマップづくり ~プロダクトエンジニアが越境して事業を伸ばす~
kekekenta
1
220
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
160
Von-Neumann Machines, Dreams & The Futures of IT
ufried
0
100
Goodbye ShellScript, Hello File-based App
shunsock
0
280
AIに任せた品質は、誰が見立てるのか - AI時代のテストマネジメント
nakanao
3
2.3k
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
350
現場で役立つ技術負債の効果的な返済方法
masuda220
PRO
9
4.6k
Featured
See All Featured
We Are The Robots
honzajavorek
0
380
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
300
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
290
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
550
Believing is Seeing
oripsolob
1
220
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
74
42k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
730
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
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