OO2019 fourth job summary

The fourth unit operation twice architecture

The first job

This homework, our task is to structure UML class diagram analysis to sort out, from json file parsing out of the UML elements in the figures established hierarchy, and based on a given class diagram to complete some basic query tasks.

I UmlClass, UMLInterface UMLOperation classes, and this job of the second package to give a corresponding MyClass, and MyOperation MyInterface class, the class inherits the store as in MyClass class parent class, the class directly related to implementation and operation of the like information, classes and class members by the UML class diagram elements in the relationship.

For the above design, the process of establishing a relationship UML elements implemented as a traversal of scattered identifying classes and interfaces which are stored in the top layer; and then the remaining elements of inheritance, and association methods to identify a second layer UML elements and establish these relationships identified in the first layer of the classes and interfaces; last traverse method parameters, to add it to its corresponding method, the relation of each element constructing complete UML class diagram.

As a method associated interfaces and classes, class class implements query After establishing relationships between elements of the above-described class diagrams, and other new package by MyClass class member variables can be calculated to give, in order to improve efficiency and , after the results of its use calculated member variables are stored, in order to improve query performance.

Second job

The second job on the basis of the first job on the added inspection order and state diagrams, and class diagram relevant rules. And query elements for building relations of sequence and state diagrams, we took the first job and the same strategy, the need to store data like UMLInteraction information and UMLStateMachine the package, and the establishment of order in the process of drawing through the elements of and the state diagram element, correlation calculation is performed by the class member variable.

For Rule002 queries, I repeated the name in statistical process MyClass class and its Attribute and Association to establish contact, whereby the completion of the inquiry Rule002.

For Rule008 query, I abstract class a graph, by Tarjan algorithm checks whether there has to FIG ring; for Rule009 queries whether there is the same between the plurality of memory used with the DFS algorithm in FIG class two check points paths.

Four jobs in architecture design and OO methods

A first operation unit calculates the task of expression, although the first operation unit, but the synthesis has been relatively strong, the basic concept for the packaging of objects, inheritance and polymorphism are applied by class package, we can associate the data package and associated method in a class, to modular, can greatly improve the rate of code reuse through inheritance parent class, implement the same interface with different classes, can be dynamic method invocation; in addition, I also learned a combination of object-oriented model, the visitor pattern and factory pattern and other common design patterns, and in practice a few times in job experience to use with object-oriented design patterns It brings process-oriented than the previous process type code for scalability and ease of maintenance.

Second unit task in a job is through the Java multithreading simulation of multiple elevators, this assignment on the basis of correctness and security procedures set forth requirements, we need to choose the right program architecture more mode behavior beyond expectations to ensure coordination of multi-threaded large extent, the process will not, we can choose to use Java class libraries thread-safe, use keyword synchronize protect shared variables to avoid conflicts between threads, while singleton the observer pattern and design architecture also provides a help, through this work, we learned that a good object-oriented architecture also helps to support the security of the program.

The third unit operations around the JML specifications to start work three progressive layers, so that we fully recognize the significance of a good architecture for scalability by JML language learning, we can expect formal expression Java program execution, JML language architecture design is on a higher level, more abstract, and therefore in the programming process, first the function of each module-level behavioral function on JML sort, can contribute to the effectiveness of the follow-up process and code implementation correctness. At the same time JML also check whether the correct procedures to achieve a way,, cvc4 and other SMT solver can be verified whether the program meets expectations by z3.

The fourth unit operation in the UML language we learn, is a more abstract modeling language, methods of solving the task described by class diagrams, sequence diagrams and state diagrams, design the program to achieve this level compared to the more abstract, and more intuitive compared to JML language representation method for solving the task, but also help to test the correctness of the program. UML model analysis by writing Java programs, we better understand the effectiveness of the link between the various elements of the UML model and the model.

Understanding and practice test

A first operation unit I used JUnit test over the comparison test, the test sample packets by simple inspection of seeking accuracy guide function of each other, and by automated test test efficiency is improved greatly.

Second unit work in real time as the elevator is dynamic, so the test is relatively complicated, and due to the uncertainty of multithreaded programs, it is difficult to ensure the stability of the output results, taking into account the mutable variable to be a bug in the root of all evil, I variable-focus state variables tested were observed and, in addition, the operation unit is not complicated tests, which may also cause loss of intensity measurement points. Efficient procedures for multi-threaded test is always a problem in this area there are many techniques you can learn.

The third unit operation also uses JUnit to test the job, with the help of language JML specifications can write one by one test sample to check the correctness of the program to improve the comprehensiveness of testing. Unfortunately, this seems to be more fancy the job performance of programs, so many of my intensity measurement test points have not seen, so the testing process is considered particularly important for the program to be performance.

The fourth unit test job I have just the place easy to go wrong constructed test sample to be examined, and did not use some efficient means of testing. I can say that in testing capacity in this area is lacking, later also we need to take more exercise. But compared to the test, I have more trust formal verification, subsequent learning process, I will be more focused on the work of functional programming and formal verification field.

Course harvest

Harvest very much.

The use of the Java language. This part is a lot of training and re-read the code to modify the code for me to become more familiar with the language Java.

Object-oriented design patterns. Objects in the natural benefits while also brings some limitations, can enhance the simplicity and correctness of the code to a greater extent by the rational use of object-oriented design-oriented mode.

Understanding of multi-threaded programs. In the modern programming systems, concurrent processing program is particularly common, through the training module of the elevator, I learned the technique in principle on more thread-safe programming and implementation.

JML UML and other abstract language. Compared to the specific Java code, these abstract designs are more advanced content from a more abstract level to effectively address the problem, write out the code will certainly not bad.

Program Improvement Recommendations

Three recommendations are as follows (I'm a Engineering student):

Experimental curriculum to students and teachers or teaching assistants in units of groups discuss the details of design and code implementation. First of all, I feel very experimental content class bored and there is no need, I feel as if the lesson is to test students' work and teachers do not trust set up under the class able to finish the levels, but each time the class after the test any feedback at all, so I am very disappointed, it is better to use this time to polish the code repeatedly jobs under class, the teacher often said that even after a strong measure still exists a variety of bug, feel just talking about it, which is very strange, it is better use this opportunity to go into details about the experimental class .

Work relationship is not very close at JML language and class. According to the feedback of the students around me, the third work of the third unit of JML and there is little relationship, but also focusing on algorithm performance, it is better to change some validation on JML language, consider KeY verification tools, reference KeY verification tools for validation JDK open source library Timsort algorithm, of course OO curriculum may consider some simple procedures for authentication.

The first blog I saw the work group feedback course, there is no back, although all students read the blog is really much, but such a good course OO group must be a way to solve a good right.

Happy OO, Happy Hacking!

Guess you like

Origin www.cnblogs.com/huluobo7161/p/11076405.html