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
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
トークン化預金DCJPYの取り組みと活用ユースケース
finengine
0
210
JAWSUG TOHOKU 青森支部 「LoGoチャット」のAWS移行で 乗り越えたこと
taketakekaho
0
360
こんにちは!SORACOM です & IoT とは【SORACOM UG 東北 in 八戸】
soracom
PRO
0
160
LambdaWebFunctionsを試してみた / exploring-lambda-web-functions
koukihosaka
1
380
Claude Code on Bedrock で統制をかける小ネタ集/claude-code-bedrock-governance-tips
emiki
1
130
~最速でビジネスインパクトを創出する~ Sansanのデータ基盤と活用事例
sansantech
PRO
0
110
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
140
Tofu-Controller lightning talk @ Containerday 2026
gionn
0
160
Refining Active Record
shugo
0
190
How to Design Configuration for Rails Applications
willnet
1
1.1k
AI駆動で「他アプリの音を加工できる」アプリを作った
satomasahiro2005
0
190
価値について
gree_tech
PRO
0
140
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Evolving SEO for Evolving Search Engines
ryanjones
0
330
Between Models and Reality
mayunak
4
500
Faster Mobile Websites
deanohume
310
32k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
560
Building Flexible Design Systems
yeseniaperezcruz
330
41k
We Are The Robots
honzajavorek
0
400
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
2
410
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
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