Create Use Cases
In the previous sections we initiated a new project as a placeholder for our application ToDoApplication
using Averos Designer.
Then we created and configured our business entities along with their managing service.
In this section we are going to create the use cases which we identified in the application design & specifications section.
Remember earlier in the design phase we have identified a couple of use cases according to our business requirements.
These use cases have been grouped into two main categories (remember we draw two use case diagram earlier) depending on the entities they are related to as follows:
- Use cases related to
ToDoArea
- Use cases related to
ToDoTask
Let’s start creating the use cases related to the entity ToDoArea
.
I. ToDoArea
Use Cases
Remember, in the design phase, we have identified the following actions a user can execute while interacting with ToDoArea
entity:
- a user can
View
/delete
/add
/update
aToDoArea
instance- a user can
Assign
/Unassign
aToDoTask
to aToDoArea
- a user can
Search
forToDoArea
instances- All these actions are performed while the user is signed into the application (user is in the private context).
- some actions includes a search for
ToDoArea
(View
,add
andupdate
aToDoArea
are possible after executing a search action)
Now let’s get few steps back and recall what are the use cases available to us that averos framework provides out of the box, shall we ?
Averos Framework provides three types of generic use cases, namely SEARCH
, CREATE
, and CRUD
use cases.
CREATE
type is a generic use case that provides entity creation capabilities along with customizable field validations and advanced field relationships logics and domain controllers.
It creates one default menu link in the application’s user private space menu.
SEARCH
type, on the other hand, is a generic use case that mainly provides entity search capabilities using criteria based on the entity members values.
It provides built-in components for entity view, entity deletion, entity edition as well as entity creation all in the same component.
It creates one default menu link in the application’s user private space menu.
As for CRUD
type it is considered as the combination of the types CREATE
and SEARCH
.
It creates two default menu links in the application’s user private space menu (one for create and one other for search use cases).
🔖 Further informations about Averos Generic Use Cases could be found in the Averos official documentation.
So, now the question is: can we leverage Averos Use cases and create the ones we identified for our ToDoApplication
?
Well, of course we can!
Here is how!
Lets browse the use cases one by one and see what Averos Use Case is most suitable for it.
1. a user can
View
/delete
/add
/update
aToDoArea
instance
☑️ An Averos Use Case of type SEARCH
could provide all the capabilities described in this use case in the same page; whereas another one of type CREATE
should provide the entity creation capability in a dedicated page.
🙋♂️We could have used only one use case of SEARCH
type for all the requirements above, but we wanted you to try the type CREATE
as well.
2. a user can
Assign
/Unassign
aToDoTask
to aToDoArea
This use case could be seen as an update in the relationship between a ToDoArea
object and a ToDoTask
object.
However, since we already know that this relationship is part of ToDoArea
attributes (remember the design phase?), this use case turns out to be a simple update on a ToDoArea
object.
☑️ The same Averos Use Case of type SEARCH
which we assigned to the first requirement, already meets the requirements of this one.
3. a user can
Search
forToDoArea
instances
☑️ The Averos Use Case of type SEARCH
exactly meets any Search
requirements so again we will use this type for this use case too.
4. All these actions are performed while the user is signed into the application (user is in the private context).
☑️ This requirement is already met since averos framework provides multi-users capabilities which implies a private space for each user.
5. some actions include a search for
ToDoArea
(View
,add
andupdate
aToDoArea
are possible after executing a search action).
☑️ This means that actions performed on a single entity such as view
, edit
and delete
, could be preceded by a search action.
☑️ The Averos Use Case of type SEARCH
meets exactly any Search
requirements, so again, we will use this type for this use case too.
🙋♂️ So all in all, we need to create only two averos use cases of type SEARCH
and CREATE
in order to meets ToDoArea
entity requirements.
Ok then, let’s get back to Averos Designer and start creating these two use cases.
First we are going to create a new use case of type SEARCH
for ToDoArea
entity.
From Averos Components panel, expand Use Cases & Pages
list and drag and drop a Use Case
component into the canvas.
Select this new use case and update its properties as follows:
- Use Case Name:
SearchToDoArea
- Use Case Type: Choose
SEARCH
- Use Case Related Entity Name: Choose
ToDoArea
Click on apply
.
Now, let’s create another use case of type CREATE
for ToDoArea
entity.
From Averos Components panel, expand Use Cases & Pages
list and drag and drop a new Use Case
component into the canvas, then update its properties as follows:
- Use Case Name:
CreateToDoArea
- Use Case Type: Choose
CREATE
- Use Case Related Entity Name: Choose
ToDoArea
Click on apply
.
That’s it !
We have implemented all the use cases related to the entity ToDoArea
. 🚀
Let’s create the use cases related to ToDoTask
entity.
II. ToDoTask
Use Cases
As we did with ToDoArea
, following the same logic we could find that both SEARCH
and CREATE
use cases could meet all ToDoTask
entity requirements.
However, for the sake of diversity, we are going to use the type CRUD
which is regarded as the combination of the two previous use cases.
Go ahead and add a new Use Case
component to the canvas, then update its properties as follows:
- Use Case Name:
ToDoTaskCRUD
- Use Case Type: Choose
CRUD
- Use Case Related Entity Name: Choose
ToDoTask
Click on apply
.
All is good! 🚀
All our use cases defined in the specification phase were created.
Next, we will create a blank page
(empty page) and configure its menu link as expected by our additional requirements.
See you in the next section!