009 the Interfaces in JAVA (official website document translation)

Source: Internet
Author: User

Interfaces

There was a number of situations in software engineering when it was important for disparate groups of programmers to agree To a "contract" that spells out how their software interacts. Each group should was able to write their code without any knowledge of how the other group's code is written. Generally speaking, interfaces is such contracts.

In many cases of software engineering, it is important that teams or programmers who do not want to do so agree on contracts that describe how the software interacts. With the help of the contract, each group writes code without having to know how the other team's code is written. In general, such contracts are served by interfaces.

For example, imagine a futuristic society where computer-controlled robotic cars transport passengers through city streets Without a human operator. Automobile Manufacturers Write Software (Java, of course) that operates the automobile-stop, start, accelerate, turn left, And so forth. Another industrial group, electronic guidance instrument manufacturers, make computer systems that receive GPS (Global Pos Itioning System) position data and wireless transmission of traffic conditions and use this information to drive the car.

Imagine, for example, that in the near future, computer-controlled robotic cars carry passengers through city streets, and cars are unmanned. and the car manufacturer uses Java software to operate the car-stop, start, accelerate, turn left, and so on. Another industry group of electronic guidance equipment manufacturers use computer systems to receive GPS data and traffic conditions of wireless transmission data, and the data received to drive the car.

The auto manufacturers must publish an Industry-standard interface this spells out in detail what methods can be invoked t o Make the car move (any car, from any manufacturer). The guidance manufacturers can then write software this invokes the methods described in the interface to command the car. Neither industrial group needs to know how the other group's software is implemented. In fact, each of the group considers its software highly proprietary and reserves the right-to-modify it at any time, as long as It continues to adhere to the published interface.

The manufacturer of the car must publish an industry standard interface, explaining what method to invoke to move the car, and then instruct the manufacturer to invoke the method in the interface description to control the car, while the industry group does not have to know how the other group's software is implemented. In fact, each group considers itself highly proprietary to the software and can modify the software at any time, provided that it follows the published interface specification.

009 the Interfaces in JAVA (official website document translation)

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.