Android and design mode-State mode
He first described the State mode in the book "JAVA and mode" by Dr. Yan Hong:
Status mode, also known as Pattern of Objects for States, is the behavior mode of an object.
The State mode allows an object to change its behavior when its internal state changes. This object looks like a class that has changed it.
Status mode structure
Express in one sentence,The state pattern encapsulates the behavior of the studied object in different State objects. Each State object belongs to a subclass of an abstract state class. The intention of the state mode is to change the behavior of an object when its internal state changes.. The schematic diagram of the Status mode is as follows:
Release/release + S1saOstqjS5b/release + release/bj4s/a0y7u3vrO21M/release + release/release + CqGhoaGh8aGhoaG + release/release + expires + expires/expires + 3cGsvdPV4sj91tbN + expires + zbzW0L + 0 s/expires/wOCjrMr9vt3BrL3T1NrB + expires/expires + expires = "brush: java; "> private DataConnection (PhoneBase phone, String name, int id, DcTrackerBase dct, DcTesterFailBringUpAll failBringUpAll, DcTesterFailBringUpAll) {// [mr2] removed // setDbg (false ); addState (mDefaultState); addState (mInactiveState, mDefaultState); // mDefaultState as the parent State addState (mActivatingState, mDefaultState); addState (State, mDefaultState); addState ); addState (mDisconnectingState, mDefaultState); addState (mDisconnectingErrorCreatingConnection, mDefaultState); setInitialState (mInactiveState); // set the initial state}
Not yet resumed. please correct me if there is anything wrong.