The invention is illustrated by way of example and not by way of limitation in the figures of the accompanying drawings in which like references indicate similar items. References to embodiments in this disclosure are not necessarily to the same embodiment, and such references mean at least one. While specific implementations are discussed, it is understood that this is done for illustrative purposes only. A person skilled in the relevant art will recognize that other components and configurations may be used without departing from the scope and spirit of the invention.
In the following description, numerous specific details are set forth to provide a thorough description of the invention. However, it will be apparent to one skilled in the art that the invention may be practiced without these specific details. In other instances, well-known features have not been described in detail so as not to obscure the invention.
Examples are given in terms of Java, however those of skill in the art will recognize that the teachings herein are applicable to many other programming languages (e.g., C#). The embodiments described below enable fixed point annotation-driven code generation, accurate tracking of package dependencies, forward and backward type references among all source files from any level of generation, and also provide for the minimum number of recompiles even in a multi-threaded/multi-processor realization.
Programming language annotations can save software developers from the tedium of writing boilerplate code. For example, many application program interfaces (APIs) require that certain repetitive steps (e.g., data transformations) be performed as part of invoking the API. Annotations can be used in these instances to generate the boilerplate code. Another area where annotations are useful is in maintaining “side files” in parallel with source code files. By way of illustration, a side file could be a deployment descriptor for an Enterprise Java Bean (EJB). Appropriate annotations in the EJB source code keep the deployment descriptor up-to-date with the EJB and avoid the problematic practice of a software developer manually keeping the deployment descriptor in sync with the EJB source.
In order to implement annotation-driven analysis/code generation, we can satisfy type dependencies inside files that define the types that they depend on. By way of illustration and with reference to
In block 200, anti-dependencies for P are determined. In one embodiment, an anti-dependency F is software that resides in P or is a source code file that imports P wholesale (e.g., “import *” in Java). In another embodiment, F is software that depends on P. Block 202 iterates through each anti-dependency F determined in block 200. If a given F has a compilation error, it is recompiled in block 206 with the hope that the addition of T to P will resolve the error. Otherwise, it is determined in block 208 whether or not there is a shadow type of T. In one embodiment, a shadow type has the same name and/or signature as T but resides in a package that F depends on which is not P. (See
Various embodiments may be implemented using a conventional general purpose or specialized digital computer(s) and/or processor(s) programmed according to the teachings of the present disclosure, as will be apparent to those skilled in the computer art. Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software art. The invention may also be implemented by the preparation of integrated circuits and/or by interconnecting an appropriate network of conventional component circuits, as will be readily apparent to those skilled in the art.
Various embodiments include a computer program product which is a storage medium (media) having instructions stored thereon/in which can be used to program a general purpose or specialized computing processor(s)/device(s) to perform any of the features presented herein. The storage medium can include, but is not limited to, one or more of the following: any type of physical media including floppy disks, optical discs, DVDs, CD-ROMs, microdrives, magneto-optical disks, holographic storage, ROMs, RAMs, PRAMS, EPROMs, EEPROMs, DRAMs, VRAMs, flash memory devices, magnetic or optical cards, nanosystems (including molecular memory ICs); paper or paper-based media; and any type of media or device suitable for storing instructions and/or information. Various embodiments include a computer program product that can be transmitted in whole or in parts and over one or more public and/or private networks wherein the transmission includes instructions which can be used by one or more processors to perform any of the features presented herein. In various embodiments, the transmission may include a plurality of separate transmissions.
Stored one or more of the computer readable medium (media), the present disclosure includes software for controlling both the hardware of general purpose/specialized computer(s) and/or processor(s), and for enabling the computer(s) and/or processor(s) to interact with a human user or other mechanism utilizing the results of the present invention. Such software may include, but is not limited to, device drivers, operating systems, execution environments/containers, user interfaces and applications.
The foregoing description of the preferred embodiments of the present invention has been provided for purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Many modifications and variations will be apparent to the practitioner skilled in the art. Embodiments were chosen and described in order to best explain the principles of the invention and its practical application, thereby enabling others skilled in the relevant art to understand the invention. It is intended that the scope of the invention be defined by the following claims and their equivalents.
This application claims benefit from U.S. Provisional Application No. 60/706,534, entitled FIXED POINT DEPENDENCY DETERMINATION, by Jesse Michael Garms and Timothy A. Wagner, filed Aug. 9, 2005 (Attorney Docket No. BEAS-01868US0), which is hereby incorporated by reference in its entirety.