How to create new special parameter?
I was thinking about how to create a new parameter in a method, similar to Output or ByRef...
What documentation can I read to learn more about this?
I want to create a parameter customized.
Comments
I’m thinking of creating a new configuration argument, similar to "Output" itself.
Please describe your use case. What you ask for is not possible, however perhaps there are other solutions
I'm not sure what you want to implement, note that ByRef and Output are keywords (not parameters) and are for documentation purpose only, the (dot) syntax used by the caller define if an argument is passed by reference, regardless of ByRef/Output keyword specified in the called method.
What kind of customization you need to implement?
Example in Java with SpringBoot. .png)
In this code, Spring Boot has several special variables with their own configurations. Something along those lines.
I'm not familiar with Spring Boot, so I don't understand what you want to implement in IRIS.
Do you want to define a custom datatype?
What kind of behavior you need to implement in IRIS?
Let's think about a scenario where we need to save a user in the database. I create a method that receives a JSON with the user's information.
At this moment, I receive "name", "email", and "password". Right after that, I create a UserDTO class to map the data.
Method createUser(@Request user As test.UserDTO) As%Status {
// codes...
}The object that is arriving would be the %request.Content, and when passing it to the createUser method, our @Request is the one that deserializes the JSON into an Iris type.
In addition to what Enrico said: arguments in ObjectScript are typeless. In your example Request could be anything, it is the responsibilty of the Caller to provide, in this case, an argument of type test.UserDTO.
So the <argument> as <type> is only for documentation purposes for the Caller (and for code-completion)
Annotation concept you describe here is not present in IRIS/Cache. The closest you could get on this would be macros but they don't behave the same as Java Annotations.
As others have mentioned, this is something the language itself (IRIS in this case) would have to provide support for first and then developers can extend by adding their own/custom annotations.