For a very brief intro to Condense, we’ll start with the classic “Hello world”. Our system will take a name, and then provide a greeting as a response.
We start by defining entities to represent this data. The Entity attribute marks them as a type of interest to Condense, and allows various behaviours to be configured.
On GuestArrival, we wish to create a Greeting in response. Converting this requirement into a method is simple. The Lambda attribute appears here, registering the method to be executed when it is triggered by new data. The default rules are appropriate here; the method will be triggered on arrival of a GuestArrival, which will fill it’s parameters.
This system is now complete, and may be hosted by a runtime. However without a way to interact, it is not particularily useful. To fix this, we will create a service contract to define an API. From this definition the runtime will expose a web service which matches this contract definition, or in the case of Condense Light, this will be accessible in code.
The signature of Arrival has a slighly different meaning to that of the lambda. This signature declares that a new GuestArrival object will be provided, which should be stored, and that the runtime should return the first Greeting that is created & related to the GuestArrival.
This relation is based on the concept of context and lineage which will be covered in later examples.