nus-cs2103-AY2324S2 / pe-dev-response

0 stars 0 forks source link

Inaccuracies in Clear Command sequence diagram #1465

Open nus-se-script opened 6 months ago

nus-se-script commented 6 months ago

Note from the teaching team: This bug was reported during the Part II (Evaluating Documents) stage of the PE. You may reject this bug if it is not related to the quality of documentation.


image.png

In the sequence diagram, it is shown that the Model instance and LogicManager instance are destroyed. However, from the code in ClearCommand.java, it looks like only the AddressBook instance has been replaced with a new one, but not the Model or LogicManager.

    @Override
    public CommandResult execute(Model model) {
        requireNonNull(model);
        model.setAddressBook(new AddressBook());
        model.resetRelationshipDescriptors();
        return new CommandResult(MESSAGE_SUCCESS);
    }

[original: nus-cs2103-AY2324S2/pe-interim#1200] [original labels: severity.Medium type.DocumentationBug]

Bandov commented 6 months ago

Team's Response

Seeing as this is the Developer guide targeted to experienced Java developers. This bug should only constitute to be of severity Low due to the reasons below.

Understanding of Object Lifecycles: The sequence diagram's implication that the Model and LogicManager instances are destroyed might simply be a misinterpretation of what happens during the ClearCommand execution. As seasoned java developers, they would be able to understand that these are not actual object destructions but rather a state reset within the Model, then the diagram’s error would not lead to a serious misunderstanding of the system's behavior.

Correct Code Functionality: From the provided code snippet, the ClearCommand is functioning correctly by clearing the AddressBook and resetting relationship descriptors. The execution of this command correctly performs its intended function without any side effects or system crashes, then the inconsistency with the diagram is deemed a minor documentation issue and does not affect the actual running of the app.

No Runtime Impact: Since there is no evidence that this discrepancy affects the runtime behavior of the application, it does not pose a direct threat to the functionality or integrity of the system.

Duplicate status (if any):

--