US20110307959A1 - Selectively exposing base class libraries based on application execution context - Google Patents

Selectively exposing base class libraries based on application execution context Download PDF

Info

Publication number
US20110307959A1
US20110307959A1 US12/815,018 US81501810A US2011307959A1 US 20110307959 A1 US20110307959 A1 US 20110307959A1 US 81501810 A US81501810 A US 81501810A US 2011307959 A1 US2011307959 A1 US 2011307959A1
Authority
US
United States
Prior art keywords
base class
class library
application
apis
layers
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
US12/815,018
Other versions
US8424107B2 (en
Inventor
Yashwardhan Singh
Srinivas Nadimpalli
Srivatsan Kidambi
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Microsoft Technology Licensing LLC
Original Assignee
Microsoft Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Microsoft Corp filed Critical Microsoft Corp
Priority to US12/815,018 priority Critical patent/US8424107B2/en
Assigned to MICROSOFT CORPORATION reassignment MICROSOFT CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: KIDAMBI, SRIVATSAN, NADIMPALLI, SRINIVAS, SINGH, YASHWARDHAN
Priority to CN201110170841.3A priority patent/CN102279761B/en
Publication of US20110307959A1 publication Critical patent/US20110307959A1/en
Priority to US13/855,558 priority patent/US8813258B2/en
Application granted granted Critical
Publication of US8424107B2 publication Critical patent/US8424107B2/en
Assigned to MICROSOFT TECHNOLOGY LICENSING, LLC reassignment MICROSOFT TECHNOLOGY LICENSING, LLC ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: MICROSOFT CORPORATION
Expired - Fee Related legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44536Selecting among different versions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Definitions

  • Computers and computing systems have affected nearly every aspect of modern living. Computers are generally involved in work, recreation, healthcare, transportation, entertainment, household management, etc.
  • Managed code is computer program code that requires and will only execute under the “management” of a Common Language Runtime (CLR) virtual machine.
  • CLR Common Language Runtime
  • programmers also refer to code that does not depend on the Common Language Runtime as unmanaged.
  • the method includes acts for allowing access to APIs based on application context.
  • the method includes determining an application context for an application.
  • a layer is determined for a base class library. Layers of the base class library are defined by one or more developer defined attributes associated with an API, where the API is included in the base class library.
  • the base class library is divided into layers based on the developer defined attributes. The one or more attributes define which application contexts can access the API. If the layer matches the application context then access by the application to the API is allowed.
  • FIG. 1 illustrates a diagram illustrating different code levels
  • FIG. 2 illustrates a method of allowing access to APIs based on application context.
  • Embodiments described herein allow for the use of a single runtime where classes within the runtime are annotated with information indicating application contexts for exposing application programming interfaces (APIs). This allows selective exposure of APIs for different application models.
  • APIs application programming interfaces
  • Silverlight® for Mobile uses .Net® Compact Framework (NETCF) (both available from Microsoft Corporation of Redmond Wash.) as the base runtime.
  • NETCF Net® Compact Framework
  • BCL base class libraries
  • the NETCF runtime includes support for different application models—the traditional NETCF and the SLM app models.
  • the existing NETCF API support is richer than what is available to SLM applications. Thus, embodiments may only expose a subset of the available API surface to SLM applications. It may also be desirable to restrict the API surface area due to security reasons.
  • Embodiments may implement the preceding by dividing the BCL into three layers.
  • the BCL surface area exposed to applications running under different contexts is determined based on the different level of accessibility to these layers from the user code and within these layers themselves. Accessibility of the layers is determined by a custom attribute annotation in BCL code.
  • each class or method may have an attribute that indicates to which application contexts the class should be exposed. Some classes or methods may specifically exclude an attribute where the absence of the attribute is an indicator as to the application context and layer accessibility. This can be used to essentially create logical views of the same physical class libraries.
  • embodiments may facilitate a runtime's ability to reuse the same BCL for supporting more than one application model. This can help to greatly reduce the runtime and working set size.
  • common code needed for similar functionality in different applications does not need to be replicated multiple times, once for each application context. Rather, embodiments may use code annotation to determine the API's exposure in a particular application context.
  • Embodiments may include functionality to statically verify the correctness of BCL layer partitioning. Examples are illustrated below.
  • FIG. 1 a diagram 100 illustrating base class libraries for one embodiment are illustrated.
  • the base class libraries are divided into layers (three layers are illustrated in FIG. 1 )—NETCFInternal 102 , SLMInternal 104 , and SLMPublic 106 . This is done by annotating the code at class and/or member level. Types and/or methods can be annotated.
  • classes and members can include one or more attributes which define to which division(s) a class or member exposes functionality.
  • the common language runtime reads the attribute on the class or member and determines if an application based on application context can access the attribute.
  • the code under regular NETCF context that is, user applications are allowed to access the complete BCL illustrated at 102 when executing in NETCF context as illustrated at 108 .
  • SLMPublic 106 when running in Silverlight(r) for Mobile context, applications can only access the SLMPublic 106 APIs.
  • SLMPublic 106 and SLMInternal 104 layers can access each other.
  • the NETCFInternal 102 layer is self-contained and any code running in SLM context, as illustrated at 110 , is not allowed to access it.
  • FIG. 1 The present implementation illustrated in FIG. 1 is directed towards supporting two different application models. However, embodiments can be extended to more than two application models using additional layers.
  • Embodiments may extend to transparency like models as well.
  • Transparency is a feature that helps developers write more secure framework libraries that expose functionality to partially trusted code.
  • a whole assembly, some classes in an assembly, or some methods in a class can be marked as security-transparent.
  • Security-transparent code cannot elevate privileges.
  • this restriction has three specific ramifications: (1) Security-transparent code cannot perform asserts. (2) Any link demand that would be satisfied by security-transparent code becomes a full demand. (3) Any unsafe (unverifiable) code that must execute in security-transparent code causes a full demand for the skip verification security permission.
  • Silverlight® with CoreCLR has a simplified model of transparency not implementing demands.
  • Embodiments may implement transparency like functionality by using the annotation concepts described above. However, unlike transparency, embodiments can be used to completely block off a part of the API—while transparency grants access to the full API with different privileges.
  • code annotations are done at type and method levels.
  • the code annotations can be used to define what layer a type or method is in.
  • types and methods in the NETCFInternal layer is annotated with a CompactFrameworkInternalAttribute.
  • Public code in SLMInternal layer is annotated with a SilverlightInternalAttribute. Any internal and private code in this layer is left un-annotated, because that code by definition cannot be accessed by user applications.
  • the SLMPublic layer is left totally un-annotated. Annotations at a containing type level apply to all the contained members. If a public type has no annotations, in the present example, it is in SLMPublic layer. However, the annotations can still be done at individual method levels.
  • code is annotated at type and method levels.
  • any enumerators or fields are not explicitly annotated. This is because for some embodiments they can be considered non-threatening.
  • enumerators map to harmless integer values.
  • Any field of a primitive type or referencing an object of an accessible layer is also considered safe. Any field referencing an object of an in-accessible layer cannot be accessed because of the inaccessibility of its type and hence is left un-annotated.
  • Some embodiments may use an FxCop based tool (a static code analysis tool available from Microsoft Corporation) to identify the different layers at run time.
  • the FxCop based tool can be used to identify the annotations and hence the different layers.
  • the method may be practiced in a computing environment and includes acts for allowing access to APIs based on application context, the method includes determining an application context for an application (act 202 ).
  • an application context for an application (act 202 ).
  • embodiments determine if the application is running in the full .Net® Compact Framework or Silverlight® for Mobile.
  • the application context may relate to application contexts that share some, but not all, functionality. For example, different application models provide different sets of functionalities but with major portions of common code.
  • the method 200 further includes determining a layer for a base class library (act 204 ).
  • Layers of the base class library are defined by one or more developer defined attributes associated with an API.
  • the base class library is divided into layers based on the developer defined attributes. In some embodiments, the method 200 may be implemented where portions of the base class library are annotated with the developer defined attributes.
  • the one or more attributes define which application contexts can access the API. For example, as illustrated in FIG. 1 and the related description, attributes can be used define the SLMInternal layer 104 , the SLMPublic layer 106 and the NETCFinternal layer 102 . Dividing the base class library into layers can create a plurality of logical views of the same base class library such that the base class library is used to support a plurality of application models.
  • Embodiments may be implemented where at least one layer is left totally un-annotated with a developer defined attribute.
  • the lack of annotations defines the at least one layer.
  • An example of this is illustrated above where the SLMPublic layer is left totally un-annotated.
  • Embodiments may be implemented where annotations are performed at type and method levels.
  • annotations at a containing type level apply to all the contained members.
  • the method 200 further includes, if the layer matches the application context then allowing access by the application to the API (act 206 ). In particular, applications will be allowed to access layers appropriate for the given application context.
  • the method 200 may be practiced where the base class library is a managed code base class library that requires and will only execute under the management of a Common Language Runtime virtual machine.
  • the method 200 may be practiced where the method further includes enforcing security restrictions by not allowing one or more applications access the API based the one or more application contexts of the one or more applications.
  • security restrictions by not allowing one or more applications access the API based the one or more application contexts of the one or more applications.
  • transparency like restrictions can be accomplished by using features of some embodiments.
  • the methods may be practiced by a computer system including one or more processors and computer readable media such as computer memory.
  • the computer memory may store computer executable instructions that when executed by one or more processors cause various functions to be performed, such as the acts recited in the embodiments.
  • Embodiments of the present invention may comprise or utilize a special purpose or general-purpose computer including computer hardware, as discussed in greater detail below.
  • Embodiments within the scope of the present invention also include physical and other computer-readable media for carrying or storing computer-executable instructions and/or data structures.
  • Such computer-readable media can be any available media that can be accessed by a general purpose or special purpose computer system.
  • Computer-readable media that store computer-executable instructions are physical storage media.
  • Computer-readable media that carry computer-executable instructions are transmission media.
  • embodiments of the invention can comprise at least two distinctly different kinds of computer-readable media: physical computer readable storage media and transmission computer readable media.
  • Physical computer readable storage media includes RAM, ROM, EEPROM, CD-ROM or other optical disk storage (such as CDs, DVDs, etc), magnetic disk storage or other magnetic storage devices, or any other medium which can be used to 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.
  • a “network” is defined as one or more data links that enable the transport of electronic data between computer systems and/or modules and/or other electronic devices.
  • a network or another communications connection can include a network and/or data links which can be used to carry or 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. Combinations of the above are also included within the scope of computer-readable media.
  • program code means in the form of computer-executable instructions or data structures can be transferred automatically from transmission computer readable media to physical computer readable storage media (or vice versa).
  • program code means in the form of computer-executable instructions or data structures received over a network or data link can be buffered in RAM within a network interface module (e.g., a “NIC”), and then eventually transferred to computer system RAM and/or to less volatile computer readable physical storage media at a computer system.
  • NIC network interface module
  • computer readable physical storage media can be included in computer system components that also (or even primarily) utilize transmission 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.
  • the computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language, or even source code.
  • the invention may be practiced in network computing environments with many types of computer system configurations, including, personal computers, desktop computers, laptop computers, message processors, hand-held devices, multi-processor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, mobile telephones, PDAs, pagers, routers, switches, and the like.
  • the invention may also be practiced in distributed system environments where local and remote computer systems, which are linked (either by hardwired data links, wireless data links, or by a combination of hardwired and wireless data links) through a network, both perform tasks.
  • program modules may be located in both local and remote memory storage devices.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Allowing access to APIs based on application context. A method includes determining an application context for an application. A layer is determined for a base class library. Layers of the base class library are defined by one or more developer defined attributes associated with an API, where the API is included in the base class library. The base class library is divided into layers based on the developer defined attributes. The one or more attributes define which application contexts can access the API. If the layer matches the application context then access by the application to the API is allowed.

Description

    BACKGROUND Background and Relevant Art
  • Computers and computing systems have affected nearly every aspect of modern living. Computers are generally involved in work, recreation, healthcare, transportation, entertainment, household management, etc.
  • Often, there is a need to expose different application programming interface (API) functionality for different platforms, such as managed code platforms or application models. Managed code is computer program code that requires and will only execute under the “management” of a Common Language Runtime (CLR) virtual machine. In this same context programmers also refer to code that does not depend on the Common Language Runtime as unmanaged.
  • Often the different application models provide different sets of functionalities and thus use different base class libraries, although with major portions of common code.
  • However, when deploying the different application models, there may be a need to conserve storage space rather than having two different runtimes, each with significant portions of overlapping code. For example, mobile devices, such as cell phones, pdas, etc. may have less storage space than other less portable or larger devices. Scrutiny should be given to what is installed on the mobile devices and efforts should be made to optimize storage space.
  • The subject matter claimed herein is not limited to embodiments that solve any disadvantages or that operate only in environments such as those described above. Rather, this background is only provided to illustrate one exemplary technology area where some embodiments described herein may be practiced.
  • BRIEF SUMMARY
  • One embodiment illustrated herein is directed to a method practiced in a computing environment. The method includes acts for allowing access to APIs based on application context. The method includes determining an application context for an application. A layer is determined for a base class library. Layers of the base class library are defined by one or more developer defined attributes associated with an API, where the API is included in the base class library. The base class library is divided into layers based on the developer defined attributes. The one or more attributes define which application contexts can access the API. If the layer matches the application context then access by the application to the API is allowed.
  • This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
  • Additional features and advantages will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the teachings herein. Features and advantages of the invention may be realized and obtained by means of the instruments and combinations particularly pointed out in the appended claims. Features of the present invention will become more fully apparent from the following description and appended claims, or may be learned by the practice of the invention as set forth hereinafter.
  • BRIEF DESCRIPTION OF THE DRAWINGS
  • 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:
  • FIG. 1 illustrates a diagram illustrating different code levels; and
  • FIG. 2 illustrates a method of allowing access to APIs based on application context.
  • DETAILED DESCRIPTION
  • Embodiments described herein allow for the use of a single runtime where classes within the runtime are annotated with information indicating application contexts for exposing application programming interfaces (APIs). This allows selective exposure of APIs for different application models.
  • The following illustrates a very specific example, but the concepts illustrated can be applied generally to base class libraries in general. Illustrating one example, Silverlight® for Mobile (SLM) uses .Net® Compact Framework (NETCF) (both available from Microsoft Corporation of Redmond Wash.) as the base runtime. This is to reuse a single runtime and single set of base class libraries (BCL), such as for example on space constrained mobile devices that have less storage space than less mobile or non-mobile devices, rather than deploying a parallel runtime. As such, the NETCF runtime includes support for different application models—the traditional NETCF and the SLM app models.
  • The existing NETCF API support is richer than what is available to SLM applications. Thus, embodiments may only expose a subset of the available API surface to SLM applications. It may also be desirable to restrict the API surface area due to security reasons.
  • Embodiments may implement the preceding by dividing the BCL into three layers. The BCL surface area exposed to applications running under different contexts (regular NETCF or SLM), is determined based on the different level of accessibility to these layers from the user code and within these layers themselves. Accessibility of the layers is determined by a custom attribute annotation in BCL code. In particular, each class or method may have an attribute that indicates to which application contexts the class should be exposed. Some classes or methods may specifically exclude an attribute where the absence of the attribute is an indicator as to the application context and layer accessibility. This can be used to essentially create logical views of the same physical class libraries.
  • Thus, embodiments may facilitate a runtime's ability to reuse the same BCL for supporting more than one application model. This can help to greatly reduce the runtime and working set size. In particular, common code needed for similar functionality in different applications does not need to be replicated multiple times, once for each application context. Rather, embodiments may use code annotation to determine the API's exposure in a particular application context. Embodiments may include functionality to statically verify the correctness of BCL layer partitioning. Examples are illustrated below.
  • Referring now to FIG. 1, a diagram 100 illustrating base class libraries for one embodiment are illustrated. The base class libraries are divided into layers (three layers are illustrated in FIG. 1)—NETCFInternal 102, SLMInternal 104, and SLMPublic 106. This is done by annotating the code at class and/or member level. Types and/or methods can be annotated. In particular, classes and members can include one or more attributes which define to which division(s) a class or member exposes functionality.
  • At run time, the common language runtime (CLR) reads the attribute on the class or member and determines if an application based on application context can access the attribute. In the illustrated example, no restrictions are imposed when executing the code under regular NETCF context. That is, user applications are allowed to access the complete BCL illustrated at 102 when executing in NETCF context as illustrated at 108.
  • However, when running in Silverlight(r) for Mobile context, applications can only access the SLMPublic 106 APIs. In the embodiment illustrated, the SLMPublic 106 and SLMInternal 104 layers can access each other. The NETCFInternal 102 layer is self-contained and any code running in SLM context, as illustrated at 110, is not allowed to access it.
  • The present implementation illustrated in FIG. 1 is directed towards supporting two different application models. However, embodiments can be extended to more than two application models using additional layers.
  • Embodiments may extend to transparency like models as well. Transparency is a feature that helps developers write more secure framework libraries that expose functionality to partially trusted code. A whole assembly, some classes in an assembly, or some methods in a class can be marked as security-transparent. Security-transparent code cannot elevate privileges. In the .Net® Framework, this restriction has three specific ramifications: (1) Security-transparent code cannot perform asserts. (2) Any link demand that would be satisfied by security-transparent code becomes a full demand. (3) Any unsafe (unverifiable) code that must execute in security-transparent code causes a full demand for the skip verification security permission. Similarly, Silverlight® with CoreCLR has a simplified model of transparency not implementing demands. Embodiments may implement transparency like functionality by using the annotation concepts described above. However, unlike transparency, embodiments can be used to completely block off a part of the API—while transparency grants access to the full API with different privileges.
  • While the preceding example is illustrated in the context of the .Net® Compact Framework and the new Silverlight® for Mobile application models, embodiments are flexible enough to provide support for other applications as well.
  • The following discussion illustrates how code annotations may be performed. In one embodiment, code annotations are done at type and method levels. The code annotations can be used to define what layer a type or method is in. In the example illustrated in FIG. 1, types and methods in the NETCFInternal layer is annotated with a CompactFrameworkInternalAttribute. Public code in SLMInternal layer is annotated with a SilverlightInternalAttribute. Any internal and private code in this layer is left un-annotated, because that code by definition cannot be accessed by user applications. In the embodiment illustrated, the SLMPublic layer is left totally un-annotated. Annotations at a containing type level apply to all the contained members. If a public type has no annotations, in the present example, it is in SLMPublic layer. However, the annotations can still be done at individual method levels.
  • As noted, in the preceding example, code is annotated at type and method levels. In the embodiment illustrated any enumerators or fields are not explicitly annotated. This is because for some embodiments they can be considered non-threatening. In particular, enumerators map to harmless integer values. Any field of a primitive type or referencing an object of an accessible layer is also considered safe. Any field referencing an object of an in-accessible layer cannot be accessed because of the inaccessibility of its type and hence is left un-annotated.
  • Some embodiments may use an FxCop based tool (a static code analysis tool available from Microsoft Corporation) to identify the different layers at run time. In particular, the FxCop based tool can be used to identify the annotations and hence the different layers. Once the annotations have been identified, and thus the layers identified, the application context based restrictions described above can be applied to the different layers.
  • The following discussion now refers to a number of methods and method acts that may be performed. Although the method acts may be discussed in a certain order or illustrated in a flow chart as occurring in a particular order, no particular ordering is required unless specifically stated, or required because an act is dependent on another act being completed prior to the act being performed.
  • Referring now to FIG. 2, a method 200 is illustrated. The method may be practiced in a computing environment and includes acts for allowing access to APIs based on application context, the method includes determining an application context for an application (act 202). In the examples illustrated previously, embodiments determine if the application is running in the full .Net® Compact Framework or Silverlight® for Mobile. However, other embodiments may be implemented as well. When performing this act, the application context may relate to application contexts that share some, but not all, functionality. For example, different application models provide different sets of functionalities but with major portions of common code.
  • The method 200 further includes determining a layer for a base class library (act 204). Layers of the base class library are defined by one or more developer defined attributes associated with an API. The API included in the base class library. The base class library is divided into layers based on the developer defined attributes. In some embodiments, the method 200 may be implemented where portions of the base class library are annotated with the developer defined attributes. The one or more attributes define which application contexts can access the API. For example, as illustrated in FIG. 1 and the related description, attributes can be used define the SLMInternal layer 104, the SLMPublic layer 106 and the NETCFinternal layer 102. Dividing the base class library into layers can create a plurality of logical views of the same base class library such that the base class library is used to support a plurality of application models.
  • Embodiments may be implemented where at least one layer is left totally un-annotated with a developer defined attribute. In this embodiment, the lack of annotations defines the at least one layer. An example of this is illustrated above where the SLMPublic layer is left totally un-annotated.
  • Embodiments may be implemented where annotations are performed at type and method levels. In some embodiment, annotations at a containing type level apply to all the contained members.
  • The method 200 further includes, if the layer matches the application context then allowing access by the application to the API (act 206). In particular, applications will be allowed to access layers appropriate for the given application context.
  • In some embodiments, the method 200 may be practiced where the base class library is a managed code base class library that requires and will only execute under the management of a Common Language Runtime virtual machine.
  • In some embodiments, the method 200 may be practiced where the method further includes enforcing security restrictions by not allowing one or more applications access the API based the one or more application contexts of the one or more applications. In one particular example, as explained previously above, in one embodiment, transparency like restrictions can be accomplished by using features of some embodiments.
  • Further, the methods may be practiced by a computer system including one or more processors and computer readable media such as computer memory. In particular, the computer memory may store computer executable instructions that when executed by one or more processors cause various functions to be performed, such as the acts recited in the embodiments.
  • Embodiments of the present invention may comprise or utilize a special purpose or general-purpose computer including computer hardware, as discussed in greater detail below. Embodiments within the scope of the present invention also include physical and other computer-readable media for carrying or storing computer-executable instructions and/or data structures. Such computer-readable media can be any available media that can be accessed by a general purpose or special purpose computer system. Computer-readable media that store computer-executable instructions are physical storage media. Computer-readable media that carry computer-executable instructions are transmission media. Thus, by way of example, and not limitation, embodiments of the invention can comprise at least two distinctly different kinds of computer-readable media: physical computer readable storage media and transmission computer readable media.
  • Physical computer readable storage media includes RAM, ROM, EEPROM, CD-ROM or other optical disk storage (such as CDs, DVDs, etc), magnetic disk storage or other magnetic storage devices, or any other medium which can be used to 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.
  • A “network” is defined as one or more data links that enable the transport of electronic data between computer systems and/or modules and/or other electronic devices. 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 transmission medium. Transmissions media can include a network and/or data links which can be used to carry or 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. Combinations of the above are also included within the scope of computer-readable media.
  • Further, upon reaching various computer system components, program code means in the form of computer-executable instructions or data structures can be transferred automatically from transmission computer readable media to physical computer readable storage media (or vice versa). For example, computer-executable instructions or data structures received over a network or data link can be buffered in RAM within a network interface module (e.g., a “NIC”), and then eventually transferred to computer system RAM and/or to less volatile computer readable physical storage media at a computer system. Thus, computer readable physical storage media can be included in computer system components that also (or even primarily) utilize transmission 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. The computer executable instructions may be, for example, binaries, intermediate format instructions such as assembly language, or even source code. 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 described features or acts described above. Rather, the described features and acts are disclosed as example forms of implementing the claims.
  • Those skilled in the art will appreciate that the invention may be practiced in network computing environments with many types of computer system configurations, including, personal computers, desktop computers, laptop computers, message processors, hand-held devices, multi-processor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframe computers, mobile telephones, PDAs, pagers, routers, switches, and the like. The invention may also be practiced in distributed system environments where local and remote computer systems, which are linked (either by hardwired data links, wireless data links, or by a combination of hardwired and wireless data links) through a network, both perform tasks. In a distributed system environment, program modules may be located in both local and remote memory storage devices.
  • The present invention may be embodied in other specific forms without departing from its spirit or 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.

Claims (20)

1. In a computing environment, a method of allowing access to APIs based on application context, the method comprising:
determining an application context for an application;
determining a layer for a base class library, layers of the base class library being defined by one or more developer defined attributes associated with an API, the API included in the base class library, wherein the base class library is divided into layers based on the developer defined attributes, wherein the one or more attributes define which application contexts can access the API; and
if the layer matches the application context then allowing access by the application to the API.
2. The method of claim 1, wherein the base class library is a managed code base class library that requires and will only execute under the management of a Common Language Runtime virtual machine.
3. The method of claim 1, wherein the method further comprises enforcing security restrictions by not allowing one or more applications access the API based the one or more application contexts of the one or more applications.
4. The method of claim 1, further comprising installing the base class library on a mobile device.
5. The method of claim 1, wherein performing the method creates a plurality of logical views of the same base class library such that the base class library is used to support a plurality of application models.
6. The method of claim 1, wherein portions of the base class library are annotated with the developer defined attributes.
7. The method of claim 6, wherein at least one layer is left totally un-annotated with a developer defined attribute, such that the lack of annotations defines the at least one layer.
8. The method of claim 6, wherein annotations are performed at type and method levels.
9. The method of claim 6, wherein annotations at a containing type level apply to all the contained members.
10. In a computing environment, a method of defining allowed access to APIs based on application context, the method comprising:
determining an application context for an application;
determining one or more APIs in a base class library that should be available to the application; and
adding the one or more APIs to a layer for the base class library, the layers for the base class library being a layer accessible to the application, wherein adding the one or more APIs to the layer comprises defining one or more developer defined attributes associated with the APIs, wherein the base class library is divided into layers based on the developer defined attributes, wherein the one or more attributes define which application contexts can access the API.
11. The method of claim 10, wherein the base class library is a managed code base class library that requires and will only execute under the management of a Common Language Runtime virtual machine.
12. The method of claim 10, wherein the method further comprises defining security restrictions based on the developer defined attributes by not allowing one or more applications access the API based the one or more application contexts of the one or more applications.
13. The method of claim 10, further comprising installing the base class library on a mobile device.
14. The method of claim 10, wherein performing the method creates a plurality of logical views of the same base class library such that the base class library is used to support a plurality of application models.
15. The method of claim 14, wherein portions of the base class library are annotated with the developer defined attributes.
16. The method of claim 14, wherein at least one layer is left totally un-annotated with a developer defined attribute, such that the lack of annotations defines the at least one layer.
17. The method of claim 14, wherein annotations are performed at type and method levels.
18. The method of claim 14, wherein annotations at a containing type level apply to all the contained members.
19. In a computing environment, a computer readable medium configured to facilitate allowing access to APIs based on application context, the computer readable medium comprising:
computer executable instructions that when executed by one or more processors implement a base class library, the base class library comprising a plurality of APIs, wherein the base class library is divided into layers by dividing the APIs into the layers, wherein the APIs are divided into layers by developer defined attributes associated with one or more of the APIs at method and class levels and wherein the layers limit access by application context such that only applications appropriate for given APIs can access layers to which those APIs belong.
20. The method of claim 19, wherein developer defined attributes are associated with types by annotations at a type level, and wherein annotations at a containing type level apply to all contained members in the containing type level.
US12/815,018 2010-06-14 2010-06-14 Selectively exposing base class libraries based on application execution context Expired - Fee Related US8424107B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
US12/815,018 US8424107B2 (en) 2010-06-14 2010-06-14 Selectively exposing base class libraries based on application execution context
CN201110170841.3A CN102279761B (en) 2010-06-14 2011-06-13 Perform context based on application program and optionally show BCL
US13/855,558 US8813258B2 (en) 2010-06-14 2013-04-02 Selectively exposing base class libraries based on application execution context

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
US12/815,018 US8424107B2 (en) 2010-06-14 2010-06-14 Selectively exposing base class libraries based on application execution context

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US13/855,558 Continuation US8813258B2 (en) 2010-06-14 2013-04-02 Selectively exposing base class libraries based on application execution context

Publications (2)

Publication Number Publication Date
US20110307959A1 true US20110307959A1 (en) 2011-12-15
US8424107B2 US8424107B2 (en) 2013-04-16

Family

ID=45097375

Family Applications (2)

Application Number Title Priority Date Filing Date
US12/815,018 Expired - Fee Related US8424107B2 (en) 2010-06-14 2010-06-14 Selectively exposing base class libraries based on application execution context
US13/855,558 Expired - Fee Related US8813258B2 (en) 2010-06-14 2013-04-02 Selectively exposing base class libraries based on application execution context

Family Applications After (1)

Application Number Title Priority Date Filing Date
US13/855,558 Expired - Fee Related US8813258B2 (en) 2010-06-14 2013-04-02 Selectively exposing base class libraries based on application execution context

Country Status (2)

Country Link
US (2) US8424107B2 (en)
CN (1) CN102279761B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120159522A1 (en) * 2010-12-16 2012-06-21 Udo Klein Application Level Contexts
US10585727B1 (en) * 2015-06-08 2020-03-10 Google Llc API manager
CN112181804A (en) * 2020-08-31 2021-01-05 五八到家有限公司 Parameter checking method, equipment and storage medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8424107B2 (en) 2010-06-14 2013-04-16 Microsoft Corporation Selectively exposing base class libraries based on application execution context
US9882854B2 (en) * 2015-09-01 2018-01-30 Microsoft Technology Licensing, Llc Email parking lot
US10387209B2 (en) * 2015-09-28 2019-08-20 International Business Machines Corporation Dynamic transparent provisioning of resources for application specific resources

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050172126A1 (en) * 2004-02-03 2005-08-04 Microsoft Corporation Security requirement determination
US20060101442A1 (en) * 2004-11-04 2006-05-11 Jens Baumgart Reusable software components
US20070136392A1 (en) * 2005-12-12 2007-06-14 Electronics & Telecommunications Research Institute Apparatus and method for managing application context
US20080127069A1 (en) * 2006-10-13 2008-05-29 Aspect Software, Inc. Reusable class library for multi-threaded application
US20080196025A1 (en) * 2007-02-12 2008-08-14 Microsoft Corporation Tier splitting support for distributed execution environments
US7546602B2 (en) * 2001-07-10 2009-06-09 Microsoft Corporation Application program interface for network software platform
US20100058283A1 (en) * 2008-09-03 2010-03-04 Microsoft Corporation Flexible base class library
US20100083238A1 (en) * 2008-09-30 2010-04-01 Microsoft Corporation Binary manipulation of intermediate-language code
US7814184B2 (en) * 2000-08-12 2010-10-12 Sony Deutschland Gmbh High-level interface for QoS-based mobile multimedia applications
US20110016514A1 (en) * 2009-07-17 2011-01-20 Phil De Carlo Methods for monitoring and control of electronic devices
US20110016199A1 (en) * 2009-07-17 2011-01-20 Phil De Carlo System for electronic device monitoring

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7426734B2 (en) * 2003-10-24 2008-09-16 Microsoft Corporation Facilitating presentation functionality through a programming interface media namespace
US8112383B2 (en) * 2004-02-10 2012-02-07 Microsoft Corporation Systems and methods for a database engine in-process data provider
US8181219B2 (en) * 2004-10-01 2012-05-15 Microsoft Corporation Access authorization having embedded policies
US8424107B2 (en) 2010-06-14 2013-04-16 Microsoft Corporation Selectively exposing base class libraries based on application execution context

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7814184B2 (en) * 2000-08-12 2010-10-12 Sony Deutschland Gmbh High-level interface for QoS-based mobile multimedia applications
US7546602B2 (en) * 2001-07-10 2009-06-09 Microsoft Corporation Application program interface for network software platform
US7743423B2 (en) * 2004-02-03 2010-06-22 Microsoft Corporation Security requirement determination
US20050172126A1 (en) * 2004-02-03 2005-08-04 Microsoft Corporation Security requirement determination
US20060101442A1 (en) * 2004-11-04 2006-05-11 Jens Baumgart Reusable software components
US7664786B2 (en) * 2005-12-12 2010-02-16 Electronics And Telecommunications Research Institute Apparatus and method for managing application context
US20070136392A1 (en) * 2005-12-12 2007-06-14 Electronics & Telecommunications Research Institute Apparatus and method for managing application context
US20080127069A1 (en) * 2006-10-13 2008-05-29 Aspect Software, Inc. Reusable class library for multi-threaded application
US20080196025A1 (en) * 2007-02-12 2008-08-14 Microsoft Corporation Tier splitting support for distributed execution environments
US20100058283A1 (en) * 2008-09-03 2010-03-04 Microsoft Corporation Flexible base class library
US20100083238A1 (en) * 2008-09-30 2010-04-01 Microsoft Corporation Binary manipulation of intermediate-language code
US20110016514A1 (en) * 2009-07-17 2011-01-20 Phil De Carlo Methods for monitoring and control of electronic devices
US20110016199A1 (en) * 2009-07-17 2011-01-20 Phil De Carlo System for electronic device monitoring

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120159522A1 (en) * 2010-12-16 2012-06-21 Udo Klein Application Level Contexts
US8621492B2 (en) * 2010-12-16 2013-12-31 Sap Ag Application level contexts
US10585727B1 (en) * 2015-06-08 2020-03-10 Google Llc API manager
US11068327B1 (en) 2015-06-08 2021-07-20 Google Llc API manager
CN112181804A (en) * 2020-08-31 2021-01-05 五八到家有限公司 Parameter checking method, equipment and storage medium

Also Published As

Publication number Publication date
US20130219523A1 (en) 2013-08-22
CN102279761B (en) 2016-08-24
US8424107B2 (en) 2013-04-16
US8813258B2 (en) 2014-08-19
CN102279761A (en) 2011-12-14

Similar Documents

Publication Publication Date Title
US20220398109A1 (en) Dynamically Loaded Plugin Architecture
US8813258B2 (en) Selectively exposing base class libraries based on application execution context
US8954929B2 (en) Automatically redirecting method calls for unit testing
Frey et al. Automatic conformance checking for migrating software systems to cloud infrastructures and platforms
US7743423B2 (en) Security requirement determination
US8990839B2 (en) Controlling runtime access to application programming interfaces
CN103718155A (en) Runtime system
JP5244826B2 (en) Separation, management and communication using user interface elements
Martineau et al. Assessing the performance portability of modern parallel programming models using TeaLeaf
US9766883B2 (en) Mechanism for compatibility and preserving framework refactoring
US20070074156A1 (en) Componentization of software computer programs
JP6255420B2 (en) Immutable object type
US9971578B2 (en) Reference attribute annotation signifying no external reference
US9141356B2 (en) Process for generating dynamic type
US8146109B2 (en) Version resiliency for a host application and custom code
US9122461B2 (en) Method and system for iteratively partitioning and validating program trees into environments at visibility space granularity
US9063758B2 (en) Population of dynamic objects representing static namespace hierarchies
Albert et al. Systematic testing of actor systems
CN112068814A (en) Method, device, system and medium for generating executable file
Xu Analyzing large-scale object-oriented software to find and remove runtime bloat
US7917893B2 (en) Using a system of annotations to generate views and adapters
Strittmatter et al. Identifying Semantically Cohesive Modules within the Palladio Meta-Model.
CN118051421A (en) Injection method and device for IO time delay fault, electronic equipment and storage medium
CN117978712A (en) IVI cross-application route processing method, electronic device and route architecture
Aljuraidan Information-Flow Control in Modern App Platforms: Modeling, Formal Verification, and Controlled Declassification

Legal Events

Date Code Title Description
AS Assignment

Owner name: MICROSOFT CORPORATION, WASHINGTON

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:SINGH, YASHWARDHAN;NADIMPALLI, SRINIVAS;KIDAMBI, SRIVATSAN;REEL/FRAME:024532/0344

Effective date: 20100608

FEPP Fee payment procedure

Free format text: PAYOR NUMBER ASSIGNED (ORIGINAL EVENT CODE: ASPN); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

STCF Information on status: patent grant

Free format text: PATENTED CASE

AS Assignment

Owner name: MICROSOFT TECHNOLOGY LICENSING, LLC, WASHINGTON

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:MICROSOFT CORPORATION;REEL/FRAME:034544/0001

Effective date: 20141014

FPAY Fee payment

Year of fee payment: 4

FEPP Fee payment procedure

Free format text: MAINTENANCE FEE REMINDER MAILED (ORIGINAL EVENT CODE: REM.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

LAPS Lapse for failure to pay maintenance fees

Free format text: PATENT EXPIRED FOR FAILURE TO PAY MAINTENANCE FEES (ORIGINAL EVENT CODE: EXP.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

STCH Information on status: patent discontinuation

Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362

FP Lapsed due to failure to pay maintenance fee

Effective date: 20210416