Query entities in core application or end-user application?

  

Hi. 

According to OutSystems documentation about the 4LC, and considering an application that is going to have a web and a mobile app, what I've understood is that:

- All core services should be isolated in a separate application.

- Two end-user applications should be developed: one for mobile and one for web.

Considering that, what do you think it's better?

1) Use screen preparation to query the database, using aggregates;

2) Provide core services to provide the list of records resulting from the database query.

As I see it, approach 1) has the advantage that query is automatically optimized, and approach 2) has the advantage that the data provided is exactly the same for both mobile and web apps (sometimes the aggreates are quite complex and have a good amout of filters - yes, necessary according to the app specifications and because there is no such thing as a "in"/"not in" in outsystems aggregate).

I am trying to understand how different are these two approaches (in performance terms) and what would be most recommended.

HI Mariap,

Outsystems 4LC is mainly related to application design and focused on how you can decouple espaces so that the changes will be easy and application will be more scaleble.

Also its not only preparation where platform optimizes query for you but where ever you use a aggregate platform optimize it for better performance.

Going with 1st ro 2nd  approach totally depends upon how big is your application , number of different module and communication between those modules.


Regards

-PJ-


Hello,

since we are talking about two applications built for different devices, it's not advised to go with solution 2, why? just think in what you want to display in a mobile page vs a web page! Much less information then in a web page. 

Beware also that when you put an aggregate in a server action, inside a core services, the output of that actions defines how the platforms does the performance optimization, so let's say that you have Table A with four attributes, if your output is the entire table, the aggregate will do a Select.*, so no gain in performance. But for instance if you use a structure as an output that will store only two attributes returned from the aggregate, then you have gains in terms of performance.

Best Regards,

Hugo Pinheiro