IP Library Granted Patent US 7,418,659
Granted Patent B2
US 7,418,659 · App. 10/377,582 · Granted Aug 26, 2008

System and method for declaring a resource within a markup document

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 7,418,659
App. No.
10/377,582
Granted
Aug 26, 2008
Kind
B2
Abstract

Described is a system and method for declaring a resource element in markup that is intended to be instantiated lazily only upon use at run-time rather than always at markup load time. In one embodiment, the invention provides a parent resources tag that encloses resource elements that may be any type of markup element. On compile, a specially prepared compiler/parser identifies the Resource tag and creates definitional information sufficient to describe the resource elements in such a manner that the resource elements are defined but not created at run-time when the markup is first loaded, and are created only upon use at run-time. A resource may be defined to be shared or non-shared. If shared, the resource is instantiated only once and that same instance is handed out each time the resource is accessed. If non-shared, a new instance of the resource is always created and handed out on each access of the resource.

Claims (45)

1. A computer-readable storage medium encoded with computer-executable instructions, the instructions comprising:

analyzing a markup document to identify a plurality of elements declared within the markup document;

identifying a Resources tag declared within the markup document;

identifying a resource element declared within the Resources tag, wherein the Resource tag indicates to a markup compiler to create source code having identification information for the resource element within the source code and to not create an instance of the resource element until the resource element is requested at run-time;

causing the markup compiler to compile the markup document to generate the source code, wherein the source code includes identification information for the resource element within the source code, wherein the identification information includes a public property that returns a method for creating an instance of the resource element when the resource element is requested at run-time, wherein the source code does not include an instance of the resource until the resource element is requested at run-time and the method is executed;

receiving a request for the instance of the resource element after the source code is generated; and

obtaining the identification information for the resource element and executing the method in the source code to create an instance of the resource element in response to the request.

2. The computer-readable storage medium of claim 1 , further comprising passing the identification information to the runtime environment for execution on a host computing system.

3. The computer-readable storage medium of claim 1 , wherein identifying the Resources tag further comprises parsing the markup document to identify each of multiple tags within the markup document, each tag declaring an element.

4. The computer-readable storage medium of claim 1 , wherein the Resources tag encloses a plurality of resource elements, each resource element having a resource identifier that is unique within the markup document.

5. The computer-readable storage medium of claim 4 , wherein the plurality of resource elements includes at least one tree resource further enclosing another plurality of elements.

6. A computer-implemented method of compiling a markup document, comprising:

evaluating the markup document to identify a Resources tag that encloses a resource element, wherein the Resource tag indicates to a markup compiler to create source code having identification information for the resource element within the source code and to not create an instance of the resource element until the resource element is requested at run-time;

causing the markup compiler to compile the markup document to generate source code, wherein the source code includes identification information for the resource element within the source code, wherein the identification information includes a public property that returns a method for creating an instance of the resource element when the resource element is requested at run-time, wherein the source code does not include an instance of the resource until the resource element is requested at run-time;

receiving a request for the instance of the resource element after the source code is generated; and

obtaining the identification information for the resource element and executing the method in the source code to create an instance of the resource element in response to the request.

7. The computer-implemented method of claim 6 , further comprising passing the identification information to the runtime environment for execution on a host computing system.

8. The computer-implemented method of claim 7 , wherein identifying the Resources tag further comprises parsing the markup document to identify each of multiple tags within the markup document, each tag declaring an element.

9. The computer-implemented method of claim 7 , wherein the Resources tag encloses a plurality of resource elements, each resource element having a resource identifier that is unique within the markup document.

10. A computer-readable storage medium encoded with computer-executable components, comprising:

a markup document including a plurality of tags, the plurality of tags including a Resources tag that encloses a resource element, wherein the resource tag indicates to a markup compiler to create source code having identification information for the resource element within the source code and to not create an instance of the resource element until the resource element is requested at run-time; and

a compiler/parser configured to evaluate the markup document, identify the Resources tag, and generate source code, wherein the source code includes identification information for the resource element within the source code, wherein the identification information includes a public property that returns a method for creating an instance of the resource element when the resource element is requested at run-time, wherein the source code does not include an instance of the resource until the resource element is requested at run-time, wherein the compiler/parser is configured to receive a request for the instance of the resource element after the source code is generated, and wherein the compiler/parser is configured to obtain the identification information for the resource element and execute the method in the source code to create an instance of the resource element in response to the request.

11. The computer-readable storage medium of claim 10 , wherein the resource element includes a resource identifier that is unique within the markup document.

12. The computer-readable storage medium of claim 10 , wherein the resource element further comprises a tree resource element that encloses other elements.

13. The computer-readable storage medium of claim 12 , wherein the tree resource element is a container element for the other elements.

14. A computer-implemented method for compiling a markup document, the method comprising:

analyzing a markup document to identify a plurality of elements declared within the markup document;

identifying a Resources tag declared within the markup document;

identifying a resource element declared within the Resources tag, wherein the resource tag indicates to a markup compiler to create source code having identification information for the resource element within the source code and to not create an instance of the resource element until the resource element is requested at run-time;

causing the markup compiler to compile the markup document to generate the source code, wherein the source code includes identification information for the resource element within the source code, wherein the identification information includes a public property that returns a method for creating an instance of the resource element when the resource element is requested at run-time, wherein the source code does not include an instance of the resource until the resource element is requested at run-time and the method is executed;

receiving a request for the instance of the resource element after the source code is generated; and

obtaining the identification information for the resource element and executing the method in the source code to create an instance of the resource element in response to the request.

15. The computer implemented method of claim 14 , further comprising passing the identification information to the runtime environment for execution on a host computing system.

16. The computer implemented method of claim 14 , wherein identifying the Resources tag further comprises parsing the markup document to identify each of multiple tags within the markup document, each tag declaring an element.

17. The computer implemented method of claim 14 , wherein the Resources tag encloses a plurality of resource elements, each resource element having a resource identifier that is unique within the markup document.

18. The computer implemented method of claim 17 , wherein the plurality of resource elements includes at least one tree resource further enclosing another plurality of elements.

19. A system for compiling a markup document, the method comprising:

a processor; and

a memory having computer-executable instructions stored thereon, wherein the computer-executable instructions are configured to:

analyze a markup document to identify a plurality of elements declared within the markup document;

identify a Resources tag declared within the markup document;

identifying a resource element declared within the Resources tag, wherein the resource tag indicates to a markup compiler to create source code having identification information for the resource element within the source code and to not create an instance of the resource element until the resource element is requested at run-time;

cause the markup compiler to compile the markup document to generate the source code, wherein the source code includes identification information for the resource element within the source code, wherein the identification information includes a public property that returns a method for creating an instance of the resource element when the resource element is requested at run-time, wherein the source code does not include an instance of the resource until the resource element is requested at run-time and the method is executed;

receive a request for the instance of the resource element after the source code is generated; and

obtain the identification information for the resource element and executing the method in the source code to create an instance of the resource element in response to the request.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2014
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 034541/0477 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 27, 2003
From: RAMANI, SUNDARAM; GRAMBIHLER, ROGER F.; RELYEA, ROBERT A.; BOGDAN, JEFFREY L.
To: MICROSOFT CORPORATION
Reel/Frame 014211/0570 →