-
Notifications
You must be signed in to change notification settings - Fork 42
Closed
Labels
Description
This is a proposal for UseCase#shouldExecute life-cycle method.
What it UseCase#shouldExecute?
Currently, the user can't prevent to execute of UseCase by declaratory.
Also, almin-logger does log the execute, but this usecase is not executed actually,
class MyUseCase extends UseCase {
execute(args){
if(condition){
return false; // if this usecase should not execute
}
// do something
}
}This proposal allow to write following.
Thun, the user canprevent to execute of UseCase by declaratory.
almin-logger does not log the execution.
class MyUseCase extends UseCase {
shouldExecute(args): boolean {
return false; // if this usecase should not execute
}
execute(args){
// do something
}
}Pros
- Write preconditions in the UseCase by declaratory
- It help to support Design by contract
- Reduce confused logging
- It will help almin-logger
Cons
- Adding new life-cycle methods
Reactions are currently unavailable