Patent ID: 7685567

Claim:
A computer-implemented method of extending data model and operations without needing to modify existing codes, the method comprising: receiving a static type for extension processing; extending the type by adding an extension method to the static type, wherein the extension method is declared using declaration syntax providing a compiler with sufficient information to statically process invocation of the extension method; statically processing invocation of the extension method by treating the extension method as a normal instance method of the type the extension method extends rather than as a method having declaration syntax; determining whether normal processing of invocation includes any applicable instance methods; when there are no applicable instance methods, proceeding to normal processing; and when there are applicable instance methods: rewriting the applicable instance methods with identifiers followed by a parenthetical containing at least one expression; and processing the rewritten applicable instance methods as a static method invocation, except for resolving of the identifier, which has special identifier processing, the special identifier processing includes namespace processing that begins with a closest namespace declaration and successively processes the rewritten applicable instance methods using a method group that includes all accessible extension methods having a name given by the identifier.