implement "database queries", for example in the Dynamite client library: // getting an item from a table client.getItem('user-table') .setHashKey('userId', 'userA') .setRangeKey('column', '@') .execute() .then(function(data) { // data.result: the resulting object }) A simple way to do this in JavaScript is using prototype inheritance and this. // example from https://schier.co/blog/2013/11/14/method-chaining-in-javascript.html class Kitten { constructor() { this.name = 'Garfield'; this.color = 'orange'; } setName(name) { this.name = name; return this; } setColor(color) { this.color = color; return this; } save() { console.log( `saving ${this.name}, the ${this.color} kitten` ); return this; } } // use it new Kitten() .setName('Salem') .setColor('black') .save(); Scala Scala supports a fluent syntax for both method calls and class mixins, using traits and the with keyword. For example: class Color { def rgb(): Tuple3[Decimal] } object Black extends Color { override def rgb(): Tuple3[Decimal] = ("0", "0", "0"); } trait GUIWindow { // Rendering methods that return this for fluent drawing def set_pen_color(color: Color): this.type def move_to(pos: Position): this.type def line_to(pos: Position, end_pos: Position): this.type def render(): this.type = this // Don't draw anything, just return this, for child implementations to use fluently def top_left(): Position def bottom_left(): Position def top_right(): Position def bottom_right(): Position } trait WindowBorder extends GUIWindow { def render(): GUIWindow = { super.render() .move_to(top_left()) .set_pen_color(Black) .line_to(top_right()) .line_to(bottom_right()) .line_to(bottom_left()) .line_to(top_left()) } } class SwingWindow extends GUIWindow { ... } val appWin = new SwingWindow() with WindowBorder appWin.render() Raku In Raku, there are many approaches, but one of the simplest is to declare attributes as read/write and use the given keyword. The type annotations are optional, but the native gradual typing makes it much safer to write directly to public attributes. class Employee { subset Salary of Real where * > 0; subset NonEmptyString of Str where * ~~ /\S/; # at least one non-space character has NonEmptyString $.name is rw; has NonEmptyString $.surname is rw; has Salary $.salary is rw; method gist { return qq:to[END]; Name: $.name Surname: $.surname Salary: $.salary END } } my $employee = Employee.new(); given $employee { .name = 'Sally'; .surname = 'Ride'; .salary = 200; } say $employee; # Output: # Name: Sally # Surname: Ride # Salary: 200 PHP In PHP, one can return the current object by using the $this special variable which represent the instance. Hence return $this; will make the method return the instance. The example below defines a class Employee and three methods to set its