A method comprising: receiving, by a device, a definition of a data stream processing class, the definition of the data stream processing class identifying: an output operation that produces an output value for an instance of the data stream processing class, and an update operation that updates a state of the instance of the data stream processing class, the output operation and the update operation being called using an Application Programming Interface, API, defined by the definition of the data stream processing class; instantiating, by the device, the data stream processing class in a text-based computing environment to implement the API, the text-based computing environment allowing processing of textually represented source code; and processing, by the device, a data stream via the API, processing the data stream including: using the instance of the data stream processing class to perform one or more of the output operation or the update operation on the data stream, wherein the definition of the data stream processing class further identifies one or more of the following operations: a reset operation, a terminate operation, or a retrieve output operation; and wherein the method further comprises: performing, when the definition of the data stream processing class further identifies the reset operation, the reset operation to reset the state of the instance; performing, when the definition of the data stream processing class further identifies the terminate operation, the terminate operation to release resources that are associated with the instance of the data stream processing class; or performing, when the definition of the data stream processing class further identifies the retrieve output operation, the retrieve output operation to retrieve an output value calculated before a subsequent output value, for the instance of the data stream processing class, is produced. receiving, by a device, a definition of a data stream processing class, the definition of the data stream processing class identifying: an output operation that produces an output value for an instance of the data stream processing class, and an update operation that updates a state of the instance of the data stream processing class, the output operation and the update operation being called using an Application Programming Interface, API, defined by the definition of the data stream processing class; an output operation that produces an output value for an instance of the data stream processing class, and an update operation that updates a state of the instance of the data stream processing class, the output operation and the update operation being called using an Application Programming Interface, API, defined by the definition of the data stream processing class; instantiating, by the device, the data stream processing class in a text-based computing environment to implement the API, the text-based computing environment allowing processing of textually represented source code; and processing, by the device, a data stream via the API, processing the data stream including: using the instance of the data stream processing class to perform one or more of the output operation or the update operation on the data stream, using the instance of the data stream processing class to perform one or more of the output operation or the update operation on the data stream, wherein the definition of the data stream processing class further identifies one or more of the following operations: a reset operation, a terminate operation, or a retrieve output operation; and wherein the method further comprises: performing, when the definition of the data stream processing class further identifies the reset operation, the reset operation to reset the state of the instance; performing, when the definition of the data stream processing class further identifies the terminate operation, the terminate operation to release resources that are associated with the instance of the data stream processing class; or performing, when the definition of the data stream processing class further identifies the retrieve output operation, the retrieve output operation to retrieve an output value calculated before a subsequent output value, for the instance of the data stream processing class, is produced. performing, when the definition of the data stream processing class further identifies the reset operation, the reset operation to reset the state of the instance; performing, when the definition of the data stream processing class further identifies the terminate operation, the terminate operation to release resources that are associated with the instance of the data stream processing class; or performing, when the definition of the data stream processing class further identifies the retrieve output operation, the retrieve output operation to retrieve an output value calculated before a subsequent output value, for the instance of the data stream processing class, is produced.