20110509 Bank Business Dispatch system

Source: Internet
Author: User

According to the requirement analysis and the actual situation of waiting in the bank and the object oriented design, it is necessary to clearly have 3 objects, namely the window, the customer and the number-taking machine. Again according to different

function to implement it.

In writing the management number of the time to note that the number and call is synchronized, so pay attention to the Synchronized keyword. The machine is only one in the system, so make him

A single example.

The teacher in the video and cleverly used the enumeration class, the customer's type is represented by enumerations, and most importantly, the switch statement can receive parameters of the enumeration type, and more than if

Else efficiency is much higher.

Next is to implement the window class method, according to different customer needs, get different types of numbers to calculate the relevant time difference, in order to make the code can be reused, you can put the Quick window

With the VIP window are made into ordinary customers subclass, cover the method of the parent class, replace some of these methods, is the code more concise, more technical content.

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.