The State Pattern Explained and Implemented in Java | Behavioral Design Patterns | Geekific

  Рет қаралды 57,060

Geekific

Geekific

Күн бұрын

Пікірлер: 36
@ziekaman2450
@ziekaman2450 3 жыл бұрын
best video about state pattern, keeping it short and simple
@geekific
@geekific 3 жыл бұрын
Thank you :) Much appreciated!
@kdbwiz
@kdbwiz Жыл бұрын
Outstanding example, thank you.
@seriaaterriblee
@seriaaterriblee 2 ай бұрын
i understood EVERYTHING, thank you.
@prashlovessamosa
@prashlovessamosa Жыл бұрын
Thank God I found your channel Quality Education Very grateful to you.
@geekific
@geekific Жыл бұрын
Glad it was helpful! Thanks a lot :)
@khomo12
@khomo12 Ай бұрын
Very nice! Thank you!
@bradleyberthold4606
@bradleyberthold4606 Жыл бұрын
It can help if you are a programmer in C or C++ to pretend the state classes are just function pointers (which really at the low level they are) and the state is just swapping around function pointers.
@TruthSeeker0145
@TruthSeeker0145 2 жыл бұрын
Thanks Man, Really Good Job Keep up the good work!!!🤠
@sxx2491
@sxx2491 2 жыл бұрын
explained it in a clear and understandable way, good contents
@geekific
@geekific 2 жыл бұрын
Glad it was helpful :)
@flyingjudgement
@flyingjudgement 2 жыл бұрын
Great explanation, Thanks a lot no wounder I been struggling how to get this right. I need both for Procedural Move/Fight. If I look at a pair of legs; Strategy is great for a higher level order, like choosing a leg for actions: "Move" , "Attack" , "Jump". Each of them have a different state execution order, and the states can be changed at any time decoupled from the present order. State Is need for deeper executions, like : InAir, Landing, OnSolidObject, TransferEnergy( return Vector3 AccelerateOrHit). This was supper usefull, thaks for comparing them, both in here and on the Strategy VIdeo too. I go and start Refactoring :)
@geekific
@geekific 2 жыл бұрын
Way to go! Glad it was helpful and Good Luck :)
@anujupadhyay1854
@anujupadhyay1854 Жыл бұрын
Amazing!
@ChetanMahale-mx1mh
@ChetanMahale-mx1mh 23 күн бұрын
can we use interface instead of abstract class???????
@markconnolly5260
@markconnolly5260 Жыл бұрын
Great videos
@samruddhisali
@samruddhisali 2 жыл бұрын
Hello, Could you please give one example of Persistence State Pattern
@geekific
@geekific 2 жыл бұрын
Hello, will add it to my list of upcoming videos! Stay Tuned!
@kaisskander1867
@kaisskander1867 2 жыл бұрын
excellent content
@geekific
@geekific 2 жыл бұрын
Glad you liked it :)
@evandromottaz
@evandromottaz 4 ай бұрын
ReadyState need to override onHome without using it, this is not anti pattern of Interface Segregation? A class that need a method that dont using?
@sahulraj9536
@sahulraj9536 3 ай бұрын
yes i felt the same,it is a violation of inteface segregation, but we can make it right by having different interfaces for common functions and uncommon functions
@genziobal7281
@genziobal7281 2 жыл бұрын
Hello , do u think its possible to use interface instead of abstract class ? if yes which solution is better ?
@geekific
@geekific 2 жыл бұрын
There are always multiple ways to implement the same logic, so of course anything will work and will lead to the desired results. However, in this case and in this example, making use of the abstract class reduces duplicate attributes leading to a cleaner solution in my opinion. Cheers :)
@genziobal7281
@genziobal7281 2 жыл бұрын
@@geekific I see ! thanks for the quick answer, im gona use ur design pattern playlist to try my best for my next coming exam :) thanks u for the clean videos
@geekific
@geekific 2 жыл бұрын
@@genziobal7281 Good luck!
@Cross_A
@Cross_A 5 ай бұрын
Thanks for the vid! But one small correction: In the state, you dont use the Phone as a variable, but as a parameter
@shyamamohanty7132
@shyamamohanty7132 10 ай бұрын
Not pretty clean as both the State class has an instance of Phone & Phone class also has an instance of state so unnecessary coupling. Better would be to pass an instance of Phone to each of the methods of state change in the State class.
@hrithikt9987
@hrithikt9987 Ай бұрын
yes, i was thinking the same.
@mnm4324
@mnm4324 2 жыл бұрын
Anyone Know the intro music?
@geekific
@geekific 2 жыл бұрын
It's You Got Jazz by Diego Nava
@coolfyb
@coolfyb 3 жыл бұрын
eXcellent’e
@geekific
@geekific 3 жыл бұрын
Many thanks!
@mnm4324
@mnm4324 2 жыл бұрын
Yung Lean?
@geekific
@geekific 2 жыл бұрын
nope :P
@ongeri
@ongeri Ай бұрын
Smartphones don't have a home button anymore 😔
Как Я Брата ОБМАНУЛ (смешное видео, прикол, юмор, поржать)
00:59
Thank you Santa
00:13
Nadir Show
Рет қаралды 48 МЛН
Миллионер | 3 - серия
36:09
Million Show
Рет қаралды 2,2 МЛН
State Pattern - Design Patterns (ep 17)
1:20:30
Christopher Okhravi
Рет қаралды 153 М.
Programming a BETTER state machine
10:16
iHeartGameDev
Рет қаралды 82 М.
Applying the State Pattern in Kotlin
12:55
Dave Leeds
Рет қаралды 7 М.
8 Design Patterns EVERY Developer Should Know
9:47
NeetCode
Рет қаралды 1,1 МЛН
3 Powerful Design Patterns You Should Know
14:26
Amichai Mantinband
Рет қаралды 13 М.
10 Design Patterns Explained in 10 Minutes
11:04
Fireship
Рет қаралды 2,3 МЛН
Как Я Брата ОБМАНУЛ (смешное видео, прикол, юмор, поржать)
00:59