Two Laptop Bag
The moose likes OO, Patterns, UML and Refactoring and the fly likes State Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "State Pattern" Watch "State Pattern" New topic

State Pattern

Amit Chohan

Joined: Oct 31, 2002
Posts: 29
Hello All
I have found the need to apply a state pattern due to my class behaviour depending on state. What i am confused about is the operations and attributes that the concrete state classes contain?
Any ideas where i can get some info?
Thank You
Amit Chohan

Java Junior<br />Leicester<br />England
Ilja Preuss

Joined: Jul 11, 2001
Posts: 14112
The Portland Pattern Repository aka Wards Wiki is a good source of information on such subjects:
A google search also will bring up a bunch of resources:
Besides that, there are many Ranchers waiting for you to concretize your question...

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I agree. Here's the link:
subject: State Pattern
jQuery in Action, 3rd edition