Android and design mode-State mode

Source: Internet
Author: User

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.