IP Library Granted Patent US 8,806,469
Granted Patent B2
US 8,806,469 · App. 13/357,301 · Granted Aug 12, 2014

Runtime code replacement

Inventors: Gareth E. Jones (Winchester, GB); James Thomas (Newbury, GB)
Assignee: International Business Machines Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,806,469
App. No.
13/357,301
Granted
Aug 12, 2014
Kind
B2
Abstract

Runtime code replacement at a client-side Web application is provided, and preferably comprises: determining that source code of a Web application has been updated at a server; retrieving the updated source code; and replacing existing runtime code at a running client-side Web application with the updated source code. Replacing existing runtime code may replace live objects in a memory of a Web browser on which the client-side Web application is running, without requiring a restart of the client-side application.

Claims (55)

1. A method for runtime code replacement at a client-side Web application, the method comprising:

determining that source script code used in a Web application running on a client browser has been updated at a server;

sending a request from the Web application to the server to request retrieving the updated source script code used in the Web application from the server to the client;

receiving the requested updated source script code at the client; and

replacing an existing runtime version of the source script code used in the Web application, while the Web application continues running on the client browser, with the updated source script code without requiring a restart of the running Web application, further comprising:

creating at least one new object, as required to implement the updated source script code;

locating each of at least one object corresponding to the existing runtime version;

removing any located object for which the creating did not create a corresponding new object; and

for each remaining located object, using a new prototype of a corresponding one of the at least one new object as a replacement for an existing prototype of the located object, the new prototype determined from the updated source script code, further comprising:

determining each of at least one property of the located object; and

storing a copy of a value of each determined property of the located object into a corresponding property of the corresponding new object.

2. The method as claimed in claim 1 , wherein the located objects and the new objects reside in a memory used by the client browser.

3. The method as claimed in claim 2 , wherein no browser page refresh is required for the client browser responsive to the replacing.

4. The method as claimed in claim 1 , wherein determining that source script code has been updated comprises one of:

manually initiating the sending of the request for retrieving the updated source script code from the server;

using polling requests to trigger the sending of the request to the server; and

initiating the sending of the request responsive to client-side communication with a server daemon that checks file modification timestamps and determines that a more-recent version of the source script code exists.

5. The method as claimed in claim 1 , wherein the source script code and the updated source script code are each encoded as a module specification in JavaScript scripting language.

6. The method as claimed in claim 1 , wherein existing object instances that inherit functions from the located objects automatically inherit the functions from the new corresponding objects.

7. The method as claimed in claim 1 , further comprising tracking which objects are produced by which source script code to determine which runtime version of script code should be replaced.

8. A system for runtime code replacement at a client-side Web application, the system comprising:

a computer comprising a processor; and

instructions which are executable, using the processor, to perform functions comprising:

determining that source script code used in a Web application running on a client browser has been updated at a server;

sending a request from the Web application to the server to request retrieving the updated source script code used in the Web application from the server to the client;

receiving the requested updated source script code at the client; and

replacing an existing runtime version of the source script code used in the Web application, while the Web application continues running on the client browser, with the updated source script code without requiring a restart of the running Web application, further comprising:

creating at least one new object, as required to implement the updated source script code;

locating each of at least one object corresponding to the existing runtime version;

removing any located object for which the creating did not create a corresponding new object; and

for each remaining located object, using a new prototype of a corresponding one of the at least one new object as a replacement for an existing prototype of the located object, the new prototype determined from the updated source script code, further comprising:

determining each of at least one property of the located object; and

storing a copy of a value of each determined property of the located object into a corresponding property of the corresponding new object.

9. The system as claimed in claim 8 , wherein the located objects and the new objects reside in a memory used by the client browser.

10. The system as claimed in claim 8 , wherein determining that source script code has been updated comprises one of:

manually initiating the sending of the request for retrieving the updated source script code from the server;

sending polling requests to trigger the sending of the request to the server; and

initiating the sending of the request responsive to client-side communication with a server daemon that checks file modification timestamps and determines that a more-recent version of the source script code exists.

11. The system as claimed in claim 8 , wherein the source script code and the updated source script code are each encoded as a module specification in JavaScript scripting language.

12. The system as claimed in claim 8 , further comprising tracking which objects are produced by which source script code to determine which runtime version of script code should be replaced.

13. A computer program product stored on a non-transitory computer-readable medium and loadable into an internal memory of a digital computer, the computer program comprising computer-readable program code for causing the digital computer to perform:

determining that source script code used in a Web application running on a client browser has been updated at a server;

sending a request from the Web application to the server to request retrieving the updated source script code used in the Web application from the server to the client;

receiving the requested updated source script code at the client; and

replacing an existing runtime version of the source script code used in the Web application, while the Web application continues running on the client browser, with the updated source script code without requiring a restart of the running Web application, further comprising:

creating at least one new object, as required to implement the updated source script code;

locating each of at least one object corresponding to the existing runtime version;

removing any located object for which the creating did not create a corresponding new object; and

for each remaining located object, using a new prototype of a corresponding one of the at least one new object as a replacement for an existing prototype of the located object, the new prototype determined from the updated source script code, further comprising:

determining each of at least one property of the located object; and

storing a copy of a value of each determined property of the located object into a corresponding property of the corresponding new object.

14. The computer program product as claimed in claim 13 , further comprising tracking which objects are produced by which source script code to determine which runtime version of script code should be replaced.

15. The computer program product as claimed in claim 13 , wherein:

the located objects and the new objects reside in a memory used by the client browser; and

no browser page refresh is required for the client browser responsive to the replacing.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 24, 2012
From: JONES, GARETH E.; THOMAS, JAMES
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 027586/0790 →
Priority Claims (1)
EP 11155415 · Feb 22, 2011 · regional
Continuity (1)
Related Publication 20120216184A1 · Aug 23, 2012