UML Use Cases: how to model a “batch” feature?

2020-03-07 06:52发布

问题:

Should a batch scheduled process (for example, a nightly process) be modeled as a Use Case? it is something the system should do, but there is not an Actor "using" the feature, because it is scheduled.

Any suggestions? Thanks!

回答1:

We've defined a 'Scheduler' actor to model that scenario. The Scheduler usually has its own set of use cases which are batch jobs, or executables that need to run regularly, etc. For example, the Use Case can be written like "The Use Case begins when the current time is on the hour" for a job that runs 24 times a day. We try not to include too many of these cases because it is too easy to get bogged down into implementation details. We wait until really important activities have to be timed, like monthly close procedures for the accounting department. They don't mention any software specifics (like the name of the scheduling software), just that the Use Case is triggered by the Scheduler actor on a given day and/or time.



回答2:

First attempt:

Time can be actor in your use case.

But as you said it is strange as an primary actor.

You can think a human alternative. So ask yourself:

System automatically do a batch scheduled process but: when? how? ... So WHO will tell the system when? how ? to do you scheduled process? Is there a role which configure a batch scheduled process? If so..

Second Attempt:

There is a good article at IBM site Dear Dr. Use Case: Is the Clock an Actor?

And you can check similiar question at Is TIME an actor in a use case?



回答3:

The system (O.S.) its the "actor":

http://en.wikipedia.org/wiki/Actor_%28UML%29

In U.M.L, an "Actor" is not just a person, can be a process or the O.S., you just add an stereotype, indicating its "system".