3.5 Interview Mode (5.11)

Source: Internet
Author: User

Access to the learner model. Can start from the following aspects.

    1. Suppose a programming language supports double dispatch (multiple dispatch). There is not much value in the interview model. In fact, after reading the Java simulation Double-Dispatch, you should do your own final title: Change the above code. Makes the message A.foo (b), where a is declared as an X-type variable, and B is declared as a Z-type variable. When the topic is done, the interview pattern is yours.

      So...... To play tricks on the basis of the interview pattern, we'll continue.

    2. The intent of the interview mode facilitates the addition of new interfaces to a class .


    3. Why should gof mention " some kind of object structure " and elements ? A lot of examples on the web, the interview mode, do not make a list to think that they are very unprofessional. In fact, there is no relationship between the data structure and the dime.

Learn the interview pattern. It is not recommended that you look directly at the design mode 5.11visitor

In fact, a class can have many sub-types in the class hierarchy! (This seems to be too much to say) even if these subtypes are different. They can always be attributed to an implementation class of an interface. So. You must remember: when you want to hit a dozen people. Hit (Devil), Hit (stick), dozen (loading); Of course, I want to hit them too, and we need to access the caller mode to handle the overloaded methods .

In addition to a friend, hit (Devil), Hit (stick), Hit (loaded), he can define the action on these two goods on the body of the new operation-for example, with a knife cut.

So, this reflects the intent of the access pattern--it's easy to add new interfaces to a class.


Last modified: 2015.4.26

3.5 Interview Mode (5.11)

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.