Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m attempting to write a cancel operation for a software download application.

ID: 658539 • Letter: I

Question

I'm attempting to write a cancel operation for a software download application. This application will first transfer the software to the device and then install the software on it. (These are givens I'm not allowed to change).

What should the cancel operation do? When a user presses 'cancel', the application should stop transferring/installing the software immediately.

Question: Since I've never written a "cancel" function, I'm wondering what are the types of things to consider when writing the code, and what are the common bugs I should expect and how to deal with them?

Couldn't find anything in google so if you have some links that would be good reads I'd really appreciate it since I'm not looking for answers I'm just looking for guidelines/macro/concept help

Explanation / Answer

From a macro perspective, we have the "Installation Transaction". I refer to it as a transaction, since it is a set of ACID operations, kinda.

When the transaction is initiated, you start with the download, into a temporary directory probably. That's the first operation.

After that, you start the installation operation, and that happens mostly by copying files to the appropriate places. You need to modify some other files, probably, you should back those up in your temp directory, as well.

Each task you perform, you can create a memento for. If the transaction is cancelled, simply go over the memos and roll back everything to restore the user's computer to it's initial state.

The devil is in the details, as well as the language. I don't think I can go any deeper.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote