Declaring Services
Goals
In order to programatically discover that a service exists, Taxi should support language constructs for describing a service
Considerations
@RestService
service PersonService {
// Design notes : Is "fun" a readable name for methods? What about B.A's? Would they understand it?
// Design notes : Purposefully excluding the variable name here,
// as it's not currently needed.
@Get("/foo/bar")
fun getPerson(PersonId):Person
}
Language for describing the signatures, annotations for describing invocation details
How to invoke services is likely to evolve faster than the language, and allows 3rd party plugins for bespoke invocation approaches.
However, the specifics of the signature should be a first class citizen.
Signatures don't need parameter names
As we don't plan on expressing logic, parameter names are unneccessary.
Also, it should encourage more detail to be pushed into the type system.
For example:
fun createPerson(String,String,LocalDate):Person
is ambiguous, however:
fun createPerson(FirstName, LastName, BirthDate):Person
improves clarity, without the need for parameter names. It also encourages the creation of specific types, which can be aliased if required.