1. Technical Field
The present technical field relates in general to the field of data processing, and, in particular, to software. Still more particularly, the present technical field relates to the creation and use of perishable software code.
2. Description of the Related Art
From a high-level perspective, a computer can be viewed as a collection of hardware that, under the control of an operating system, executes programs to manipulate data (including values, images, etc.). During the development of such programs, programmers often include lines of code that have only temporary benefit and purpose. For example, during debugging operations of a program, a software developer may add a “try” statement, and alteration, etc., which is to be used only during these debugging operations. After debugging has been completed, such lines of code are no longer needed, and may in fact be detrimental to the final functionality of the program. Thus, this type of code is only needed for a short period of time, such that later it should either be disabled or deleted from the program.
To address the problem described above, presented herein are a method, system and computer-readable medium for utilizing perishable code. In one embodiment, the method includes the steps of determining if a unit of code is perishable; and in response to determining that the unit of code is perishable, disabling the unit of code.
The above, as well as additional purposes, features and advantages of the present invention will become apparent in the following detailed written description.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further purposes and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, where:
With reference now to the figures, and particularly to
If it is determined that the unit of code should be disabled after a certain amount of time (query block 106), then a command, which disables the unit of code after this certain amount of time, is inserted within or near that unit of code. This command makes the unit of code expire at a certain time, date, and/or after a particular period of time, and/or after a particular number of executions, et al. (block 108). That is, a command may be added to disable the unit of code at a particular time, date, time of day, etc., or the unit of code may be disabled after a particular amount of time passes since the unit of code was added to the program, or the code may be disabled after being executed a predetermined number of times. These “triggers” for disabling the unit of code are exemplary in nature, and are not to be construed as limiting the scope of the present invention.
Consider now an exemplary format for a command that makes a unit of code perishable, whether that perishable nature is caused by the unit of code being disabled or removed:
“Parameter 1” is the name of the command (keyword name of the command that makes the unit of code perishable). “Parameter 2” describes what date format is to be used to describe when the unit of code should be disabled (or removed). In the example shown, the International Standards Organization (ISO) format is to be used. “Parameter 3” describes whether the unit of code should simply be disabled at a particular point in time, or if it should be deleted from the program. “Parameter 4” describes whether a message should be sent when the unit of code is disabled or removed. Thus, utilizing the format shown above, an exemplary command language pseudocode may be:
wherein “Perishable” is the command name; the expiration date is Sep. 30, 2006 (in ISO format); the code is to be completely removed after that date; and a message is to be sent (e.g., to an administrator) upon removal of the unit of code that is under the control of the command “Perishable.”
As described in blocks 106 and 108, a command may be added to make the unit of code perishable by adding a command that simply disables the unit of code after a set amount of time. However, it may be desired that the unit of code be entirely deleted from the program (query block 110). If so, then a command line for deleting the unit of code at some set time, frequency, etc. is entered (block 112) within or at a control point for the unit of code. The process is reiterated for other units of code in a program (query block 114) until all units of code in the program have either been made perishable or left in their original non-perishable state. The process thus ends at terminator block 116.
Once the program has been modified to include perishable features of one or more units of code, the program may be run. Referring now to
Once the command is confirmed as being valid, a determination is made as to whether it is time for the controlled unit of code to be disabled (or removed), as described in query block 210. If the controlled unit of code is to be left alone, then it is executed (block 212). Otherwise, the controlled unit of code is disabled or removed, according to the “disable/remove” parameter set by the command (block 214). A determination can then be made to confirm that the command worked properly (block 216). This determination can be as simple as confirming that the controlled unit of code was removed, or as complex as the programmer desires (e.g., confirming that the controlled code is actually disabled through the use of test inputs; evaluating what effect the removal of the controlled code had on other code/programs; etc.). An information message can then be sent (block 218), informing a control program, human programmer (via a user interface screen), or other entity that the controlled code has or has not been disabled (or totally removed), and/or that the disabling/removing process worked properly without undue ill effects. The process continues in an iterative manner (query block 220) until the entire program has been executed (terminator block 222).
It should be noted that the order and sequence of steps shown in
With reference now to
A hard drive interface 332 is also coupled to system bus 306. Hard drive interface 332 interfaces with a hard drive 334. In a preferred embodiment, hard drive 334 populates the system memory 336, which is also coupled to system bus 306. System memory is defined as a lowest level of volatile memory in computer 300. This volatile memory may include additional higher levels of volatile memory (not shown), including, but not limited to, cache memory, registers, and buffers. Code that populates system memory 336 includes an operating system (OS) 338 and application programs 344.
OS 338 includes a shell 340, for providing transparent user access to resources such as application programs 344. Generally, shell 340 (as it is called in UNIX®) is a program that provides an interpreter and an interface between the user and the operating system. More specifically, shell 340 executes commands that are entered into a command line user interface. Thus, shell 340, also called a command processor in Windows®, is generally the highest level of the operating system software hierarchy and serves as a command interpreter. The shell provides a system prompt, interprets commands entered by keyboard, mouse, or other user input media, and sends the interpreted command(s) to the appropriate lower levels of the operating system (e.g., kernel 342) for processing. Note that while shell 340 is a text-based, line-oriented user interface, the present invention will equally well support other user interface modes, such as graphical, voice, gestural, etc.
As depicted, OS 338 also includes kernel 342, which includes lower levels of functionality for OS 338. Kernel 342 provides essential services required by other parts of OS 338 and application programs 344. The services provided by kernel 342 include memory management, process and task management, disk management, and mouse and keyboard management. OS 338 also includes a compiler 341 that is utilized by users of computer 300 to transform high level source code into executable object code. In an alternate embodiment, compiler 341 may be included in application programs 344.
Application programs 344 in system memory 336 include a Perishable Code Manager (PCM) 348. In one embodiment, PCM 348 performs, supervises, and/or manages all or some of the steps illustrated in
A network interface 350 is coupled to system bus 306. Network interface 350 allows computer 300 to communicate, via a network 352, to other resources 354, which may be a server, a supervisory computer, a management computer, a database, a web server, etc. If resource 354 is a software deploying server, then PCM 348 can be deployed to computer 300, preferably in an “on demand” basis in which the software is only deployed after computer 300 sends resource 354 a message indicating a need for PCM 348.
The hardware elements depicted in computer 300 are not intended to be exhaustive, but rather represent and/or highlight certain components that may be utilized to practice the present invention. For instance, computer 300 may include alternate memory storage devices such as magnetic cassettes, Digital Versatile Disks (DVDs), Bernoulli cartridges, and the like. These and other variations are intended to be within the spirit and scope of the present invention.
It is understood that the use herein of specific names are for example only and not meant to imply any limitations on the invention. The invention may thus be implemented with different nomenclature/terminology and associated functionality utilized to describe the above devices/utility, etc., without limitation.
As noted above, it is to be understood that at least some aspects of the present invention may alternatively be implemented in a computer-useable medium that contains a program product. Programs defining functions on the present invention can be delivered to a data storage system or a computer system via a variety of signal-bearing media, which include, without limitation, non-writable storage media (e.g., CD-ROM), writable storage media (e.g., hard disk drive, read/write CD ROM, optical media), and communication media, such as computer and telephone networks including Ethernet, the Internet, wireless networks, and like network systems. It should be understood, therefore, that such signal-bearing media, including but not limited to tangible computer-readable media, when carrying or encoded with a computer program having computer readable instructions that direct method functions in the present invention, represent alternative embodiments of the present invention. Further, it is understood that the present invention may be implemented by a system having means in the form of hardware, software, or a combination of software and hardware as described herein or their equivalent.
Thus, in one embodiment, the present invention may be implemented through the use of a computer-readable medium encoded with a computer program that, when executed, performs the inventive steps described and claimed herein. Furthermore, the computer program may be deployed to a client computer from a software providing service via an external resource such as a software deploying server. Such software may be provided in an “on demand” basis that is determined by the client computer and/or the client computer's manager.
Thus, presently disclosed herein are a method, system and computer-readable medium for utilizing perishable code. In one embodiment, the method includes the steps of determining if a unit of code is perishable; and in response to determining that the unit of code is perishable, disabling the unit of code. The unit of code may be disabled by deleting the unit of code from an interpretable source, such as a program, an applet, a HyperText Markup Language (HTML) file, etc. The method may further include the step of validating a command, which is used to disable the unit of code, before disabling the unit of code, wherein the command is automatically validated by a computer by comparing the command with a trusted list of commands, or alternatively, the command is manually validated by an administrator. The method may further include the step of transmitting a message to an administrator when the unit of code is disabled. Furthermore, the method may include the steps of determining if the disabling of the unit of code impacted on other code; and in response to determining that the disabling of the unit of code caused an impact on other code, transmitting an information message describing the impact.
While the invention has been particularly shown and described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention.