发明名称 System and method for mutating polymorphic object components
摘要 Embodiments of the present invention provide for techniques for enabling mutation of an instantiated object between multiple underlying object types at run time. The object may alter its behavior from one object type to another at anytime without requiring a new object to be instantiated. The object's behavior may be implemented by other objects which are retrieved at run time, thus disconnecting the direct link between the object's behavior and the object.
申请公布号 US8793281(B2) 申请公布日期 2014.07.29
申请号 US201313849665 申请日期 2013.03.25
申请人 Oracle International Corporation 发明人 Nama Vivek;Mora Chandra
分类号 G06F17/30 主分类号 G06F17/30
代理机构 Kilpatrick Townsend & Stockton LLP 代理人 Kilpatrick Townsend & Stockton LLP
主权项 1. A method for accessing a data store, the method comprising: instantiating, with one or more processors associated with one or more computer systems, an entity object based on an entity class definition, the entity object including a plurality of attributes defined by the entity class definition, the plurality of attributes including a superset of all attributes of a set of underlying object types allowed to mutate from one class to another, the plurality of attributes further including a discriminator attribute having a value, the value determining which type of the underlying object types the entity object should behave as; setting, with the one or more processors associated with the one or more computer systems, a value for the discriminator attribute based on an object type that the entity object should behave as; retrieving, with the one or more processors associated with the one or more computer systems, an instance of a helper object for the object type that the entity should behave as, the instance of the helper object determined by the value of the discriminator attribute; passing, with the one or more processors associated with the one or more computer systems, the entity object to the helper object such that the helper object is allowed to access one or more attributes of the entity object; and invoking at least one method of the helper object to store values for the one or more attributes of the entity object into the data store.
地址 Redwood Shores CA US
您可能感兴趣的专利