Summary of the last three OO assignments

fourth assignment

The first time I tried multithreading, well, what I didn't expect was that using some containers in multithreading would cause some inexplicable exceptions. It's a bit desperate to find myself in the last 2 hours to get rid of this bug with only a rewrite. The root cause is that eclipse crashed my computer, preventing me from writing in advance. The last committed version still occasionally throws exceptions. There are still some lessons: the first is to honestly simulate according to the instructions in the guide, and the methods that were originally expected to simplify the judgment were eventually overturned, which resulted in wasting a lot of time; the second is to write multi-threading and use containers. careful.

Class Diagram

code analysis

test

The program of the other party is also occasionally right and often wrong, and we will have a feeling of heroes cherishing heroes after a little test. I think this is a multi-threaded problem, don't ask him so strictly. There is basically no testing strategy, anyway, a little test is a bug.

fifth assignment

Well, this time it's basically no problem. Although I think the method of judging file renaming and moving is a bit stupid, but as long as the simulation is done according to the instruction book, there is no problem. The intermediate instruction book changes the implementation requirements of a thread: dividing threads according to tasks, I feel that my code becomes ugly, but after a careful analysis, it seems that this avoids some bugs that I used to divide threads according to triggers.

Class Diagram

code analysis

test

The other party's snapshot records are not very reasonable, which is also a difficulty in this operation.

sixth assignment

This work is pretty abstract. But my own code forgot to judge the time when the taxi walks randomly. It only sleeps (20ms) each time. I thought 200ms was so short.

Class Diagram

code analysis

test

In the end I was happy with both the tester and the testee.

experience

These three jobs are all multi-threaded. I have to say that trying some containers in multi-threading has made me have an indelible memory. But I think the last two assignments are much better and abstract than the previous ones, but the corresponding tests are very troublesome, which makes me lazy to test.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325118244&siteId=291194637