In order to describe the manner in which the above-recited and other advantages and features can be obtained, a more particular description of the subject matter briefly described above will be rendered by reference to specific embodiments which are illustrated in the appended drawings. Understanding that these drawings depict only typical embodiments and are not therefore to be considered to be limiting in scope, embodiments will be described and explained with additional specificity and detail through the use of the accompanying drawings in which:
Embodiments herein may comprise a special purpose or general-purpose computer including various computer hardware, as discussed in greater detail below.
One embodiment described herein includes a configuration file that includes one or more extensions sections. The configuration file contains configuration parameters for configuring class type instances in managed code frameworks. The extensions sections are modifiable to include configuration data consumable by other configuration sections. For example, an extension section may include name/class type pairs, where the name may correlate to a class type that is able to deserialize configuration data in other configuration sections. Thus, configuration of a class type can be extended by extending an extensions section with name and class type configuration information consumable by other sections. The other sections can then be configured with configuration information, including configuration information applicable to the extended functionality.
As a specific example, suppose that a framework ships with class types that support bindings including basic HTTP and WS HTTP. However, a developer wishes to add support for UDP. The developer can develop a UDP class type and can add an element to an extensions section that correlates a name with a class type. For example, the element added to the extensions section may correlate the name “UDP” with a class type “UDP.” A different section can then have an element UDP that defines various configuration settings. The other section can consume the name/class type pair from the extensions section such that the UDP class type can be instantiated with the configuration information in the other section.
Referring now to
In this example the name of the name/class type pair is “MyExtention.” The type of the name/class type pair is “type.” By defining the element name and the type it links to in the extensions section, the entry of the element name and type is a well known element name in the configuration file 102. The element includes a discoverable class type name, which in one embodiment may be a fully qualified name. When the element is referenced elsewhere in the configuration file 102, an instance of the type linked to the name can be instantiated. Examples of this behavior follow herein.
The extensions section 110, in one embodiment includes a number of collections which include the elements in the extensions section 110. Each collection, may be specific to a given section group such that when extended tags are used in a section, the section can reference a specific collection of name/class type pairs corresponding to the particular section group to which the section belongs. For example, in the example above, the MyExtention extension is included in the behaviors collection. Other collections may exist including, but not limited to binding element extensions and binding extensions. In one embodiment, collections may correspond to a section group, such as the section group 106 or 108 illustrated in
Once a name class type pair has been added to the extensions section, custom extension elements can be used in the other sections. For example, as shown in
The following xml code illustrates a simple configuration data structure which includes a section data structure within the configurations data structure which consumes extended name/class type pair elements in the extensions section data structure.
As illustrated in
Notably, while in the examples illustrated herein, mark-up language such as XML has been used to define section elements including elements in the extensions sections, some elements may be defined by hard-coded instructions. For example, when the managed code framework ships, configuration parameters natively supported for definitions in the sections may use a similar process to that previously described herein. In particular, configuration that is natively supported may simply refer to default parameters natively included in the framework code. For example, if a configuration section includes configuration elements for a particular class type, hard-coded references may be used to invoke the class type to deserialize the configuration elements.
Notably, in some embodiments, the use of section groups allows for certain section groups to be extensible while other groups are fixed in scope. For example, in one embodiment, the section group 106 may be extensible such that configuration information in the extensions section 110 is consumable by sections in the section group. In contrast, the section group 108 may be fixed in scope such that all configuration information can only be defined within the original limits developed for the sections in the section group 108.
Referring now to
Embodiments may also include computer-readable media for carrying or having computer-executable instructions or data structures stored thereon. Such computer-readable media can be any available media that can be accessed by a general purpose or special purpose computer. By way of example, and not limitation, such computer-readable media can comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to carry or store desired program code means in the form of computer-executable instructions or data structures and which can be accessed by a general purpose or special purpose computer. When information is transferred or provided over a network or another communications connection (either hardwired, wireless, or a combination of hardwired or wireless) to a computer, the computer properly views the connection as a computer-readable medium. Thus, any such connection is properly termed a computer-readable medium. Combinations of the above should also be included within the scope of computer-readable media.
Computer-executable instructions comprise, for example, instructions and data which cause a general purpose computer, special purpose computer, or special purpose processing device to perform a certain function or group of functions. Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.
The present invention may be embodied in other specific forms without a departing from its spirit or essential characteristics. The described embodiments are to be considered in all respects only as illustrative and not restrictive. The scope of the invention is, therefore, indicated by the appended claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope.