US 7,596,576 B2
System and method for providing user defined types in a database system
Ramachandran Venkatesh, Bellevue, Wash. (US); Jun Fang, Sammamish, Wash. (US); Jose A. Blakeley, Redmond, Wash. (US); Beysim Sezgin, Redmond, Wash. (US); Balaji Rathakrishnan, Sammamish, Wash. (US); and Peter A. Carlin, Seattle, Wash. (US)
Assigned to Microsoft Corporation, Redmond, Wash. (US)
Filed on Feb. 14, 2005, as Appl. No. 11/57,475.
Application 11/057475 is a continuation of application No. 10/775282, filed on Feb. 10, 2004, granted, now 6,976,029.
Prior Publication US 2005/0177585 A1, Aug. 11, 2005
This patent is subject to a terminal disclaimer.
Int. Cl. G06F 7/00 (2006.01); G06F 17/00 (2006.01)
U.S. Cl. 707—102  [707/4; 707/200; 717/106; 717/114] 19 Claims
OG exemplary drawing
 
1. A computer-implemented method for creating a user-defined type in a database system, comprising:
receiving code that executes on a processing unit and that implements a class defining the structure of a user-defined type and methods that can be invoked on instances of the user-defined type;
enforcing a contract against the class to ensure that the user-defined type will act like any scalar type of the database system, the contract comprising:
a first requirement that the class specify one of a plurality of different formats for persisting instances of the user-defined type in a database store, the plurality of different formats comprising at least a first format in which an instance of the user-defined type is automatically serialized in accordance with a native format of the database system and a second format in which an instance of the user-defined type is serialized in a manner defined by the class;
a second requirement that the class be capable of returning a null value for the user-defined type; and
a third requirement that the class provide a method for converting the user-defined type to another type;
storing metadata about the user-defined type for subsequent use by the database system in creating instances of the user-defined type; and
creating instances of the user-defined type only when the class meets the requirements of the contract.