2
 Followers
11
 Likes

Placeholder Actions

Service Studio
Not right now

Just like how placeholders are fantastic when you want to specify the structure but want to leave room for some unknowns:


It would be nice to have placeholder actions where you have all of the logic but want to leave room for some unknowns:

And have the placeholder actions defined, maybe before or after Exceptions:

Very slight bonus points, The "By" parameter in ListSort could be an official placeholder action which returns an Integer and the "Condition" parameter in ListIndexOf could be a placeholder action that returns a Boolean.

Created on 23 Jan
Comments (8)

It sounds really interesting, this way tons of forge components would become much more customizable without a need to clone them. However, I don't know if this would add additional complexity to the app. In UI it's kind of straightforward, with actions though you'll have to deal with the scopes.  

Well, placeholders often increase the conceptual complexity of one module, action or screen but pay off in terms of reuse and consistency. I constantly forget one of the nine things that was supposed to change when I made another copy.

I'm less sure whether events (click, change, etc.) would be able to take the form of Placeholder Actions, but that would be a really nice use of them if so.

Maybe the ListIndexOf/ListSort suggestion might be a bit of a pain - right now, it can take an expression directly and turning it into a Placeholder Action would make someone have to make an action for it instead. On the other hand, being able to do that would be really nice. Maybe a ListIndexOfWith/ListSortWith for the Placeholder Action versions?

I can sort of imagine the sort of code the C# and Java engines would emit, too (delegates versus @FunctionalInterfaces)

Changed the category to Service Studio


Changed the status to
Not right now


Hello!

This a very interesting feature, it could allow to create templates for business logic and accelerate development in common scenarios. There are a few edge cases and scenarios that would need some polish.

For that reason I'm going to change the idea to "Not right now", but we'd like to see how the community sees this feature.

Keep them coming!

Hello!

It is nice form of how delegate implementation can look in Service Studio. 

There should be default action for each placeholder with output parameter otherwise it can course exception during execution. 


For placeholder with output parameter can be defined following behavior.:

  • If default action isn't defined (abstract placeholder or template) template shouldn't be used without such placeholder definition in consumer. 
  • if default action is defined (virtual placeholder) it can be override in consumer or used as it is. 

I've seen tickets in the ideas forum to be able to save Code Snippets for reuse.  Seems like this would be something similar.


https://www.outsystems.com/ideas/6286/Entity+CRUD+operation+management?IsFromAdvancedSearch=True

Valerij, so, maybe somewhat like a regular parameter, where it's either Is Mandatory=Yes or there's a Default Action?

There are probably even ways to get around having an exception if an action is simply not defined. I know Anders Hejlsberg was a big fan of having no event acting the exact same as a blank event. Maybe just don't call anything, hold the return parameters as their default "blank" value.

Or there could be a check, e.g. if IsActionDefined(Placeholder)... although I have found that people often abuse checks like that in other languages to implement surprising behaviour when nothing is defined :)

Ritchie, your proposal about Mandatory attribute is a nice way to define abstract (Mandatory=Yes) and virtual (Mandatory=No) placeholder types in Outsystems world.

Also idea about avoiding need of empty action for each web block notify and in our case virtual placeholder is nice as well. In case of Mandatory=No and action placeholder has return parameter Outsystem can return not initialized variable of output structure type as it is done for any variable in current implementation. So no real need to define virtual action. In such case there will be no need of IsActionDefined action.
Abstract placeholder (Mandatory=Yes) is useful in case when some default action doesn't make sense.

views
212
Followers
2