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

preview_player
Показать описание

Today, we add another Behavioral design pattern to our Design Patterns in Java series: The State Design Pattern.

Timestamps:
00:00 Introduction
00:07 What is the State Pattern?
02:06 State Pattern Implementation
03:41 The State Pattern Class Diagram
05:02 State vs Strategy
06:09 Recap
06:45 Thanks for Watching!

If you found this video helpful, check other Geekific uploads:

#Geekific #DesignPatterns #StatePattern #BehavioralPatterns
Рекомендации по теме
Комментарии
Автор

best video about state pattern, keeping it short and simple

ziekaman
Автор

Thanks Man, Really Good Job Keep up the good work!!!🤠

saoudimassinissa
Автор

explained it in a clear and understandable way, good contents

sxx
Автор

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 :)

flyingjudgement
Автор

Thank God I found your channel
Quality Education
Very grateful to you.

prashlovessamosa
Автор

Thanks for the vid! But one small correction: In the state, you dont use the Phone as a variable, but as a parameter

Cross_A
Автор

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.

bradleyberthold
Автор

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?

evandromottaz
Автор

Hello, Could you please give one example of Persistence State Pattern

samruddhisali
Автор

Hello, do u think its possible to use interface instead of abstract class ? if yes which solution is better ?

genziobal
Автор

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.

shyamamohanty