Pair Programming-elevator Scheduling

Source: Internet
Author: User

Programming task: Elevator Scheduling

Peer staff: Zuo Shaohui-12061209, Yang haolan-12061202, Lu yurang

I. This soft job is really a daunting task. However, pairing programming gives me the confidence to complete the job and I have no active team members, later, we only applied to join the already-established team. Therefore, we are actually a three-person group. We all said that the team has a lot of power, and the idea will be much more open, and the job will be much smoother. At first, I was not very familiar with my homework. I just got drunk when I was reading English. Later, I started reading code for a long time. I thought the syntax was just as general as I did when I studied C, however, we can see that such brilliant code is still a variety of samples ~ It is really difficult to do it by yourself, but we are a team with a high flame of firewood. My teammates gave me a lot of feelings and help. The following describes the advantages and disadvantages of teammates. Yang Haoran is a very thoughtful person. He can quickly adapt to and grasp new things, and will communicate with us without reservation, but his sense of crisis is insufficient. Lu yurang has a good team spirit, can actively participate in collaboration and often give some suggestions.

Photo:

Ii. Advantages and Disadvantages of Pair Programming

Advantages:

(1) At the development level, paired programming can provide better design quality and code quality, and the cooperation between the two parties can provide better problem-solving capabilities.

(2) For developers themselves, pairing work can bring more confidence, and high-quality output can bring higher satisfaction.

(3) At the enterprise management level, pairing can communicate more effectively, learn from each other and pass on experience, and better handle the flow of personnel. Because one person's knowledge has been shared by others.

(4) The process of pairing programming is also a process of mutual supervision. Everyone's every action is within the sight of others, and all ideas should be evaluated by the other party. Due to this pressure of supervision, programmers work more seriously. Pair Programming forces programmers to communicate frequently and improve their technical capabilities to avoid being underestimated by others.

(5) Pair programming keeps the code written by two people in the review process. Review is a process of continuous review to improve the design and coding quality, so that problems can be found and solved in a timely manner, so as to avoid dragging the problem to the next stage.

Disadvantages:

(1) Pair programming is a gradual process of mutual learning and interaction. Developers need time to adapt to this new development model. The first pair programming is likely to be more efficient than independent development.

(2) If the team members need to work in multiple projects and do not fully guarantee sufficient Pair programming time, the Members will always be in the waiting status, which affects the efficiency.

(3) when one of them wants to think about it for a while, it may be considered as a non-cooperative performance.

3. (1) Information Hiding

Information Hiding is an isolation principle in the program design process, which can prevent users from accessing certain parts of a class. A program module can hide its information and display only one interface externally. When the specific implementation of this module changes, as long as its interface is not changed, the program can still be correctly executed even if other code outside the module is not modified. This interface ensures the stability of the entire project. By reading and understanding the chapters on Information Hiding, interface design, and loose coupling in textbooks and other materials, I have learned how to master a method or use a library function, first, you must learn how to read the attributes of a method and how to call the method, then, choose whether to call the program as needed and how to call the method to simplify and optimize the program.

(2) Interface Design

The interface design element of the software Describes how information flows into and out of the system, and how the components defined as an architecture communicate. In this assignment, the internal interfaces between various design components are used to enable internal communication and collaboration between components in the software architecture. When implementing interfaces, ensure that all operations and message transmission modes are implemented, and that different types of operations can communicate and collaborate.

(3) Losing coupling loosely coupled

Coupling is a qualitative measurement of the degree of interconnectivity between classes. As the number of communications and collaboration increases, the association between classes is getting stronger and stronger, and the complexity of the system increases, the coupling between classes increases. By adding interfaces, communication and collaboration between classes can be completed through interfaces, ensuring that the Program maintains as low coupling as possible. A loosely coupled system is usually a message-based system. At this time, the client and remote service do not know how the other party implements the system. Communication between the client and the service is governed by the message architecture. As long as the message conforms to the negotiated architecture, the implementation of the client or service can be changed as needed without worrying about damaging the other party. Loosely Coupled communication mechanisms provide many advantages that do not exist in the tight coupling mechanism, and they help reduce the dependency between the client and remote services.

4. Code contracts-design contract (DBC), also known as contract programming, is a software design method through contract and contract programming. It specifies that software designers should define forms, precise and verifiable interface specifications for software components, and thus extend the prerequisites. Generally, definitions of data types are abstracted, post conditions, and constants. These specifications are referred to as "contracts" and are represented by the terms and Obligations of the commercial contract. I have a preliminary understanding of the concept of the design contract and its role in software design, so I tried to use this knowledge in the program, so I also used standard component interfaces in the program, data type.

V. UML design diagram

Vi. Unit-test

VII. Algorithm Description

A request queue is created to store passengers and requests. There are four existing elevators. When a request is found, the nearest elevator that can be reached is considered to allocate it to the passengers, during the allocation process, you need to determine whether the load is feasible and check whether the target floor and the elevator are within the range that can be reached after entering the elevator. If feasible, allocate the elevator to the target floor, when the next elevator is allocated, the request is sent to the Request queue, if no request is received after the elevator arrives at the destination, a waiting layer is returned.

 

Pair Programming-elevator Scheduling

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.