Outsystems development question - Actions - Identifier or Record type param?


I wonder, in an Action parameter, which is better? Entity Identifier or Entity Record?

I suppose that Entity identifier mostly better since it does notuse so much memory and the query to the Database ought to be optimized to only retrieve desired columns.

The bright side of using Entity Record would be avoiding making an aditional Database query in case you already have the record.
The con would be demanding the invoker to, in case they don't have a record, query the Database for the record before asking for behavior (which should be a simple black box).

Or one could implement the both actions? :D

Thanks for your input.
Alexandre -

It's performance vs. encapsulation. Passing an ID lets it be encapsulated... "black box". Passing the record is more efficient, especially when the action is happening in a loop. Better to make 1 query and get 50 records than 50 queries for 1 record.

I lways prefer to pass an ID, unless testing shows it is slow enough to be noticed.