US 12,093,758 B2
Middleware in web framework
Andrew Michael Lees, Ferndown (GB); David Richard Jones, Eastleigh (GB); Christopher Neil Bailey, Southampton (GB); and Ian Partridge, Eastleigh (GB)
Assigned to International Business Machines Corporation, Armonk, NY (US)
Filed by International Business Machines Corporation, Armonk, NY (US)
Filed on Mar. 7, 2019, as Appl. No. 16/295,860.
Prior Publication US 2020/0285530 A1, Sep. 10, 2020
Int. Cl. G06F 9/54 (2006.01)
CPC G06F 9/548 (2013.01) 12 Claims
OG exemplary drawing
 
1. A computer-implemented method for middleware in a web framework, the method comprising:
defining a target object type configured to hold results of a middleware function, by accounting for information produced by processing the middleware function;
enabling a type-safety of the middleware function;
receiving a first object for an application;
performing a process of the middleware function using the first object to generate a process result;
enabling a plurality of middleware functions configured to execute sequentially to each other;
consulting a route table in a web framework;
dispatching a relevant middleware function according to the route table;
based on the process result, generating by the middleware an instance of the middleware wherein the instance of the middleware includes creating a second object of the target object type, wherein the second object is not an altered version of the first object; and
providing the second object from the middleware to a next applicable piece of code in the application;
wherein a route handler function is attached to a route in the application and is configured to provide the second object from the middleware function to the route handler function, and to determine how to handle the second object.