19
Views
3
Comments
Solved
Reusable queries in core service layer?

Just getting started with OutSystems 11.

In the reactive project I'm working on, I've created a core service module with my entities.  It's a simple ticketing system where a Ticket is assigned to a Technician (a User).  in my core service module, I created a Server Action called Get Open Tickets for Technician.  The caller passes the user id and gets back a list of Ticket instances.  The Server Action has an aggregate that performs the query and then an assignment that assigns the result to an output parameter, a List of Tickets.

Is there any downside to doing it this way - ie passing the list back as an output parameter.  I could also see the web modules defining their own aggregates and not going through the core service.  I just wonder if there's any performance hit or limitations to using the output of a Server Action rather than an aggregate directly.

Thanks for any insight.

Rank: #170
Solution

Jim you should definitely not do that!

One of the best practices about queries is exactly to avoid that see: 



This explains why you shouldn't do that!!

And also points the rule's exception... in Remarks...

But be aware that this may lead to performance problems in the future


Cheers and Regards,

RR :)

Rank: #172

Hello Jim,

Look this document about architecture, 

I think it will help you find the best definition of how to do.

Regards.

Rank: #170
Solution

Jim you should definitely not do that!

One of the best practices about queries is exactly to avoid that see: 



This explains why you shouldn't do that!!

And also points the rule's exception... in Remarks...

But be aware that this may lead to performance problems in the future


Cheers and Regards,

RR :)

Hi Jim,

When you using the aggregate in server action you should be careful about the output structure of server action.

you can also go through below link

https://success.outsystems.com/Documentation/Best_Practices/Performance/Performance_Best_Practices_-_Queries

 Regards

Shashikant Shukla