Freigeben über


Using the Cognitive Dimensions - Progressive Evaluation

Here's the next in the series of posts for using the Cognitive Dimensions framework...

For each user goal that the API supports, describe the tasks that the user has to implement to accomplish that goal. For example, in the System.IO namespace one goal might be to append a line of text to a file. For such a goal, the list of tasks might be:

 

  • Open the file with a given name
    • Create the file if it does not already exist
  • Write a line of text to the file
  • Close the file

 

Then, for each individual task, consider how easy it is for the user to stop and check their progress towards accomplishing their goal.

 

For example, when using System.IO.StreamWriter to write code to append a line of text to a file, the user may want to check their progress after writing code to open or create a file. However, in order to do so they must additionally write code to close the file since otherwise there is no guarantee when the file handle will be released by the garbage collector (and hence the user could be prevented from reopening the file for some period of time afterwards). So, in order to check their progress regarding creating or opening the file, the user needs to do additional work to make sure that they close the file.

 

The extent to which progress towards a goal can be evaluated can be described in the following terms.

 

  • If the user can stop and evaluate their progress after each line of code that they write, the API supports progressive evaluation at the line of code level.
  • If the user can only stop and evaluate their progress for one task after writing enough code to perform two or more tasks, the API supports progressive evaluation at the functional chunk level.
  • If the user needs to work with multiple classes in parallel that need to be in a consistent state with respect to one another before they can stop and check their progress, the API supports progressive evaluation at the parallel components level.

 

Given the above definition of progressive evaluation, the System.IO classes used for appending text to a text file exhibit progressive evaluation close to the functional chunk level, since in some cases the user needs to write code to accomplish two or more one tasks, before they can check their progress on one task. In all cases, the user does not need to work with two or more classes.