Skip to content

Use Case

The use case is the corner stone of this framework where you'll be able to write your own business logic domain wide.

The use case is made up of a set of possible sequences of interactions between systems and users in a particular environment and related to a particular goal. A complete use case will include one main or basic flow and various alternate flows. The alternate flow -- also known as an extending use case -- describes normal variations to the basic flow as well as unusual situations.

Torpedo let you abstract your code based on use cases isolating business logic, testing, and more!

How Torpedo works with Use Cases

Once that you have finished the use case schema and after generate your code, Torpedo will create 2 classes. The UseCaseBase and the UseCase. The first one is the class that contains the autogenerated code wit all entities dependencies and the second one is where your business logic must be written.

classDiagram
  UseCaseBase <|-- UseCase

  UseCase : +RegisterUser(user.UserEntity userModel)

  UseCaseBase : user.IService userSrv
  UseCaseBase : log.ILogger logger