-
Notifications
You must be signed in to change notification settings - Fork 1
Guidelines
Rubens F. N. da Silva edited this page Feb 12, 2019
·
3 revisions
When using Frontier to create your web REST based web applications, you'll always keep in mind that you:
- Should not use the WRITE command inside a dispatcher or request handler method.
- Will always return something from these methods, even if it has to be an empty string.
- Keep strong typing your arguments and method returns.
Here's a sample on how to create a method that handles a request:
ClassMethod SayHello(name As %String) As %String
{
return $$$FormatText("Hello %1!", name)
}
The framework will alert you if you leave something without a type defined, but it won't alert you about using WRITE inside these methods! Avoiding to use WRITE will also keep your code cleaner since the framework will be responsible for handling the output, this is even more evident when facing an error.