Method, software and apparatus for referencing a method in object-based programming
First Claim
1. A method for operating a computer using object-based computer code, comprising using a computer to perform the steps ofrepresenting an instance and a first method of a class by a delegate value that can be assigned to variables and passed from one procedure to another;
- and invoking the first method by calling a second method of an instance of a class using the delegate value, wherein the parameters supplied to the second method are supplied to the first method and the parameter list of the second method matches the parameter list of the first method, and further wherein the first method is identified by name and by matching the parameter list and result type of the first method with the parameter list and result type declared for the class.
2 Assignments
0 Petitions
Accused Products
Abstract
Method and apparatus for encapsulating a reference to a method in object-based programming systems and ensuring that the reference is safe are disclosed. The method of encapsulation provides for: a) defining an entity that defines the shape of the method to be referenced; b) obtaining a reference to a method; c) storing this reference in arbitrary data structures; d) passing the reference to code written by other parties; e) enabling invocation of the method by anyone holding the method reference; and f) enabling the holder of a method reference to determine the target object and method being referenced. These objectives are achieved in a strongly typed manner, making it possible for: a) developers to learn of type mismatch problems early (at compile-time) rather than late (at run-time); and b) development tools to present information to developers about the shape of components that use delegates. In addition, a model of event based programming is disclosed, wherein event-related code can be encapsulated in delegates.
-
Citations
38 Claims
-
1. A method for operating a computer using object-based computer code, comprising using a computer to perform the steps of
representing an instance and a first method of a class by a delegate value that can be assigned to variables and passed from one procedure to another; - and
invoking the first method by calling a second method of an instance of a class using the delegate value, wherein the parameters supplied to the second method are supplied to the first method and the parameter list of the second method matches the parameter list of the first method, and further wherein the first method is identified by name and by matching the parameter list and result type of the first method with the parameter list and result type declared for the class. - View Dependent Claims (2, 3, 4, 5, 6)
- and
-
7. An object-based computer program product comprising computer program code embodied in a computer-readable form on a physical carrier wherein the program code causes a computer to perform the steps of
representing an instance and a first method of a class by a delegate value that can be assigned to variables and passed from one procedure to another; - and
invoking the first method by calling a second method of an instance of a class using the delegate value, wherein the parameters supplied to the second method are supplied to the first method and the parameter list of the second method matches the parameter list of the first method, and further wherein the first method is identified by name and by matching the parameter list and result type of the first method with the parameter list and result type declared for the class. - View Dependent Claims (8, 9, 10, 11, 12)
- and
-
13. An object-based programming system comprising
a computer adapted to represent an instance and a first method of a class by a delegate value that can be assigned to variables and passed from one procedure to another; - and
invoke the first method with a call to a second method of an instance of a class using the delegate value, wherein the parameters supplied to the second method are supplied to the first method and the parameter list of the second method matches the parameter list of the first method, and further wherein the first method is identified by name and by matching the parameter list and result type of the first method with the parameter list and result type declared for the class. - View Dependent Claims (14, 15, 16, 17, 18, 19, 20, 21, 22)
- and
-
23. A method for programming a computer in object-based computer code, comprising using a computer to perform the programming steps of:
-
a) defining a first class having a first method to be used to reference a second method of a second class;
b) representing an instance of the first class and the first method with a delegate value, wherein an instance of the second class and the second method are identified as parameters of the instance of the first class; and
c) invoking the second method by calling the first method on the instance of the first class using the value to reference the instance.
-
-
24. A method for operating a computer using object-based computer code, comprising using a computer to perform the steps of
representing an instance and a first static method of a class by a delegate value that can be assigned to variables and passed from one procedure to another; - and
invoking the first static method by calling a second method of an instance of a class using the delegate value, wherein the parameters supplied to the second method are supplied to the first method and the parameter list of the second method matches the parameter list of the first method, and further wherein the first method is identified by name and by matching the parameter list and result type of the first method with the parameter list and result type declared for the class.
- and
-
25. An object-based computer program operative to cause a computer to:
-
1) receive the following program statements in computer readable;
a) a program statement declaring a first class to be used to invoke a method of an instance of another class, wherein the first class is declared with a parameter list and result type, and wherein the first class includes a method to be used to invoke the method of the other class;
b) a program statement instantiating an instance of the first class with the method name and the name of the instance of the other class supplied as parameters, wherein the instance and method of the first class are represented as a delegate value that can be assigned to variables and passed from one procedure to another;
c) a program statement calling the method of the instance of the first class using the delegate value and including parameters to be provided to the method of the other class; and
2) search other program statements supplied to the computer for the method of the other class and identifying it by comparing its parameter list and result type with the parameter list and result type of the first class. - View Dependent Claims (26)
-
-
27. An object-based computer program product including the following program statements encoded in computer-readable form on a physical carrier:
-
a) a program statement declaring a first class to be used to invoke a method of an instance of an another class, wherein the first class is declared with a parameter list and result type, and wherein the first class includes a method to be used to invoke the method of the other class;
b) a program statement instantiating an instance of the first class with the method name and instance of the other class supplied as parameters, wherein the instance and method of the first class are represented as a delegate value that can be assigned to variables and passed from one procedure to another; and
c) a program statement calling the method of the instance of the first class using the delegate value and including parameters to be provided to the method of the instance of the other class. - View Dependent Claims (28)
-
-
29. A computer-implemented method of calling a target method in an object-based computer program comprising
calling a first method on an instance of a first class wherein the parameters supplied to the first method include a delegate reference to the target method and instance on a second class, and wherein the first method calls the target method using the delegate reference, and wherein the delegate reference can be assigned to variables and passed from one procedure to another, and further wherein the instance of the first class is instantiated in a third class having a set of security permissions, the second class has a set of security permissions, and the set of security permissions of the third class are compared to the set of security permissions for the second class in order to determine if the third class can instantiate the instance of the first class.
-
31. A data structure recorded on a computer-readable medium comprising
a plurality of class definitions in an object-based computer language and a plurality of security permissions each associated with at least some of the classes, wherein the security permissions associated with the classes are structured so that they may be compared with one another to determine if an instance of a class used to call to a method of an instance of another class may be instantiated in yet another class using a delegate value, wherein the delegate value represents a method and instance of the another class that can be assigned to variables and passed from one procedure to another.
-
32. A computer program product comprising a computer program encoded in computer-readable form on a physical carrier, comprising:
-
one or more computer program modules for reading and processing an object-based computer program to prepare it for execution; and
wherein one or more of the modules checks security permissions associated with one or more classes to determine if an instance of a class used to call to a method of an instance of another class may be instatiated in yet another class using a delegate value, wherein the delegate value represents a method and instance of the another class that can be assigned to variables and passed from one procedure to another.
-
-
33. A method of operating a computer, comprising:
-
reading and processing an object-based computer program to prepare it for execution; and
checking security permissions associated with one or more classes to determine if an instance of a class used to call to a method of an instance of another class may be instantiated in yet another class using a delegate value, wherein the delegate value represents a method and instance of the another class that can be assigned to variables and passed from one procedure to another. - View Dependent Claims (34)
-
-
35. A computer program product comprising a computer program encoded in computer-readable form on a physical carrier, comprising:
-
one or more computer program modules operative on a computer for reading and processing an object-based computer program to prepare it for execution; and
wherein one or more of the modules;
1) receives the following object-based program statements in computer readable form;
a) a program statement declaring a first class to be used to invoke a method of an instance of another class, wherein the first class is declared with a parameter list and result type, and wherein the first class includes a method to be used to invoke the method of the other class;
b) a program statement instantiating an instance of the first class with the method name and the name of the instance of the other class supplied as parameters, wherein the instance and method of the first class is represented as a delegate value that can be assigned to variables and passed from one procedure to another;
c) a program statement calling the method of the instance of the first class using the delegate value and including parameters to be provided to the method of the other class; and
2) searches other program statements supplied to the computer for the method of the other class and identifying it by comparing its parameter list and result type with the parameter list and result type of the first class.
-
-
36. A computer program product comprising a computer program encoded in computer-readable form on a physical carrier, comprising:
-
one or more computer program modules operative on a computer for reading and processing an object-based computer program to prepare it for execution; and
wherein one or more of the modules receives in computer readable form a program statement, in an object-based computer language, declaring a class to be used to invoke a method of an instance of another class, wherein the instance and method of the other class are represented by a delegate value that can be assigned to variables and passed from one procedure to another, and wherein the first class is declared with a parameter list and result type, and automatically creates a method on the first class to be used to invoke the method of the instance of the other class using the delegate value. - View Dependent Claims (37)
-
-
38. A method comprising
a computer receiving a computer readable program statement, in an object-based computer language, declaring a class to be used to invoke a method of an instance of another class, wherein the class is declared with a parameter list and result type, and representing the method and instance of the another class by a delegate value that can be assigned to variables and passed from one procedure to another; - and
in response to the declaration of the class automatically creating a method on the first class to be used to invoke the method of the instance of the other class, using the delegate value.
- and
Specification