Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is proxy pattern Structural Pattern and why is State Pattern behavioral pattern?

why is proxy pattern a structural pattern and why is state pattern a behavioral pattern. What is the criteria for determining a new pattern should be considered structural or behavioral?

like image 655
Anjana Avatar asked Dec 17 '25 16:12

Anjana


1 Answers

Patterns are structural if the focus is on how relationships between objects are organised to form larger components whereas behavioral patterns are focused on the allocation of object responsibilities and the communication between them

The proxy is structural because it acts as a surrogate for another object, state is behavioral because the state is passed in to an object to influence its behaviour at runtime.

like image 69
Tom Carter Avatar answered Dec 20 '25 11:12

Tom Carter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!