Coding Clone Warehouse Address: Https://git.coding.net/huyifeng1998/jieduixiangmu.git
First, the expected PSP:
Two, the design of the pair programming to the interface
Information hiding:
Information hiding means that the specific information (process or data) contained within a module is inaccessible to other modules that do not require this information when designing and determining the module.
We put various commonly used classes and methods in the pair project, rather than embedding them in a class, so that each class is clearly divided and easy to modify. Information hiding at the same time reflected in a variety of classes, algorithms are not visible to users, can hide the complexity of the source of hidden changes.
Interface Design:
The most important principle of object-oriented design is the design of interface. Interfaces can be well defined, not only for their own maintenance, but also for the upper-level applications that do not require much change. So we have clearly designed the interface before the project starts, so as not to work hard.
Loose coupling:
The coupling degree between objects in software engineering is the dependence between objects. The higher the degree of coupling between objects, the higher the maintenance cost. So the underlying functions that we design in our project are as simple as possible, and we try to avoid modifying the underlying functions. function similar function, design more than 2, do not reduce the amount of code, the function of a function design too much, otherwise it is not easy to modify.
Design and implementation of module interface
Three JSP pages:
First.jsp is the home page, you can choose to jump to download or Zuoti
download.jsp is the download page, you can customize the topic on this page and download
Zuoti.jsp is the title page, you can upload documents to correct, you can also do online questions
Two servlets:
Chuanservlet is used to get the title, call the Dangejisuan class method to get the topic and pass to the foreground
Xianshi is used to download printing, and from the foreground to get parameters passed to the class method, called the creation of the topic of the two classes creat and CREAT1, respectively, constructs the expression without multiplication and the expression containing multiplication
Iv. Effectiveness Analysis
V. Exception handling
Exception handling of the number of topics:
Public Static void scopeofsumerror (intthrows exception{ if(num<=0| | num>10000) thrownew Exception ("Input range is wrong, please re-enter"); }
Exception handling for the upper and lower bounds of the operand:
Public Static void Scopeofargsmerror (int scope_lower,intthrows exception{ if(scope _lower<1| | scope_lower>100| | scope_upper<50| | scope_upper>1000) thrownew Exception ("The input range of M is wrong" ); if (scope_lower>=scope_upper) Throw New Exception ("Upper bound greater than the lower bound"); }
Exception Handling for operators:
Public Static void Operationerror (int operation)throws exception{ if(operation<=0| | operation>10000) thrownew Exception ("O input error,-O range is 1 to ten"); }
Vi. Design of Interface module
Home first.jsp:
Home we have used bootstrap and CSS:
<script src= "Js/jquery-3.3.1.min.js" ></script><link rel= "stylesheet" href= "css/ Bootstrap-3.3.7-dist/css/bootstrap.css "/><link rel=" stylesheet "href=" Css/first.css "/>
Topic page download.jsp:
<divclass= "Center" style= "Background-color:gray;" > class= "Wrap" action= "Servlet/chuanservlet" method= "POST" > <divclass= "Form-inline" > <divclass= "Form-group" > <label for= "ExampleInputName2" > Number of topics </label> <inputclass= "Form-control" name= "problem-number" placeholder= "Please enter Number" > </div> </div> <divclass= "Form-inline" > <divclass= "Form-group" > <label for= "ExampleInputName2" > Lower value </label> <input type= "text"class= "Form-control" name= "down-number" placeholder= "Please enter" > </div> <divclass= "Form-group" > <label for= "EXAMPLEINPUTEMAIL2" > Upper value </label> <inputclass= "Form-control" name= "up-number" placeholder= "Please enter" > </div> </div> <divclass= "Form-inline" > <divclass= "Form-group" > <label for= "ExampleInputName2" > Number of Operators </label> <inputclass= "Form-control" name= "operator-number" placeholder= "Please enter" > </div> </div> <divclass= "Form-inline" > <label for= "ExampleInputName2" > Whether multiplication method </label> <select is requiredclass= "Form-control" name= "Select-chengchu" > <option> Yes </option> <option> no </option> </select> <label for= "ExampleInputName2" style= "margin-left:8%;" > If brackets </label> <select are requiredclass= "Form-control" name= "Select-kuohao" > <option> Yes </option> <option> no </option> </select> </div> <button type= "Submit"class= "Btn Btn-default" style= "margin-left:30%;" > Print topics to local </button> </form> <div> <a href= "first.jsp" > <button type= "button"class= "Btn Btn-default" style= "margin-left:70%" > Back home </button> </a> <a href= "zuoti.jsp" > <button Type= "button"class= "BTN Btn-default" > Direct title </button> </a> </div></div>
Interface module and calculation module docking
Because our group does is the web version of the arithmetic, so our front-end connection and data transmission is mainly through the foreground JS and background servlet. In MVC mode, the servlet does the controller. Through the form call table only son to Servlet,servlet call the final interface of the background, the interface calls various related classes, the implementation of the topic customization and download.
Eight, the advantages and disadvantages of pairing programming
Advantages of pairing Programming:
1, the programmer can help each other, improve efficiency
2, to enhance the code and product quality
3, share knowledge, reduce the cost of the current study
4, in programming, discuss with each other, may solve the problem faster and more effectively.
Disadvantages of trooped Programming:
1, with the people do not come together programming prone to disputes, not conducive to team harmony.
2. Experienced veteran may have a feeling of dissatisfaction with the novice.
3. There may be differences between the developers on a certain issue, resulting in contradictions, resulting in unnecessary internal friction.
4. Developers may talk about work-related things, distract themselves and cause inefficiency.
Nine, the pair process
The advantages of Fortune:
Strong logical thinking and rigorous programming skills
Serious and responsible
Strong hands-on capability and high efficiency
The disadvantages of Fortune:
Perfectionism, too tangled up in page design
My advantages:
Careful and careful
Have patience
Strong Learning Ability
My weaknesses:
Lack of programming experience
Ten, the actual PSP
Pair assignment: Arithmetic Web version