Instance interfaces and mix-ins for dynamic languages

US9910681B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-9910681-B2
Application numberUS-201615145064-A
CountryUS
Kind codeB2
Filing dateMay 3, 2016
Priority dateAug 1, 2007
Publication dateMar 6, 2018
Grant dateMar 6, 2018

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

Various technologies and techniques are disclosed for using contracts in dynamic languages. For example, a contract can be directly associated with an object. The contract can then be used to provide type safety for the object. As another example, contracts can be used with mix-ins. A declaration for a contract is provided with a mix-in. The contract is associated with a target object at runtime when applying the mix-in. Conditions can be assigned to mix-ins that must be met before the mix-in can be applied to the target object. At runtime, if the target object meets the one or more conditions, then the mix-in can be applied to the target object.

First claim

Opening claim text (preview).

What is claimed is: 1. A method, comprising: receiving a method call to register a mix-in, the method call including as a parameter a set of base mix-ins from which the mix-in inherits; at runtime of a target object, before applying the mix-in to the target object, determining whether the target object meets at least one constraint contract that constrains objects to which the mix-in can be applied; if the target object meets the at least one constraint contract, at runtime, applying the mix-in to the target object; and if the target object does not meet the at least one constraint contract, at runtime, throwing an exception. 2. The method of claim 1 , wherein the method call further includes as a parameter at least one of an interface implementation provided by the mix-in or a set of types the mix-in is able to extend. 3. The method of claim 1 , further comprising: associating with the mix-in the at least one constraint contract that constrains objects to which the mix-in can be applied and that must be met by the target object before the mix-in can applied to the target object. 4. The method of claim 1 , wherein the target object is an instance of a class. 5. The method of claim 1 , wherein determining whether the target object meets the at least one constraint contract is performed using reflection. 6. The method of claim 1 , wherein the at least one constraint contract defines a condition. 7. A memory having computer-executable instructions for causing a computer to perform steps comprising: receiving a method call to register a mix-in, the method call including as a parameter a set of base mix-ins from which the mix-in inherits; at runtime of a target object, before applying the mix-in to the target object, determining whether the target object meets at least one constraint contract that constrains objects to which the mix-in can be applied; if the target object meets the at least one constraint contract, at runtime, applying the mix-in to the target object; and if the target object does not meet the at least one constraint contract, at runtime, throwing an exception. 8. The memory of claim 7 having further computer-executable instructions for causing the computer to perform steps comprising: associating with the mix-in the at least one constraint contract that constrains objects to which the mix-in can be applied and that must be met by the target object before the mix-in can be applied to the target object. 9. The computer storage memory of claim 7 , wherein the target object is an instance of a class. 10. The memory of claim 7 , wherein determining whether target object meets the at least one constraint contract is performed using reflection. 11. The memory of claim 7 , wherein the at least one constraint contract defines a condition. 12. A system for restricting the use of mix-ins based on meeting of conditions comprising: a computer comprising a processing unit coupled to a memory, the memory storing computer-executable instructions which, when executed, cause the processing unit to perform the steps of: receiving a method call to register a mix-in, the method call including as a parameter a set of base mix-ins from which the mix-in inherits; at runtime of a target object, before applying the mix-in to the target object, determining whether the target object meets at least one constraint contract that constrains objects to which the mix-in can be applied; if the target object meets the at least one constraint contract, at runtime, applying the mix-in to the target object; and if the target object does not meet the at least one constraint contract, at runtime, throwing an exception. 13. The system of claim 12 , wherein the method call further includes as a parameter at least one of an interface implementation provided by the mix-in or a set of types the mix-in is able to extend. 14. The system of claim 12 , the memory storing further computer-executable instructions, which, when executed, cause the processing unit to perform the step of: associating with the mix-in the at least one constraint contract that constrains objects to which the mix-in can be applied and that must be met by the target object before the mix-in can be applied to the target object. 15. The system of claim 12 , wherein determining whether the target object meets the at least one constraint contract is performed using reflection. 16. The system of claim 12 , wherein the at least one constraint contract defines a condition. 17. The system of claim 12 , wherein the target object is an instance of a class.

Assignees

Inventors

Classifications

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US9910681B2 cover?
Various technologies and techniques are disclosed for using contracts in dynamic languages. For example, a contract can be directly associated with an object. The contract can then be used to provide type safety for the object. As another example, contracts can be used with mix-ins. A declaration for a contract is provided with a mix-in. The contract is associated with a target object at runtim…
Who is the assignee on this patent?
Microsoft Technology Licensing Llc
What technology area does this patent fall under?
Primary CPC classification G06F9/4433. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Mar 06 2018 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 8 related publications on this page (citations in our corpus or others sharing the same primary CPC).