From: Ray Z. <rz...@co...> - 2002-09-12 14:58:07
|
Here's the latest version of ESPOPS with a few minor changes. http://www.pserc.cornell.edu/ESPOPS/ESPOPS-0.52.tar.gz ESPOPS stands for Enhanced SPOPS. Where standard SPOPS (or more correctly, SPOPS::DBI) implements persistence for simple class of objects whose data is stored in a single table, ESPOPS implements persistence for a set of classes with inheritance relationships, where the attributes are distributed across several tables, one for each class in the inheritance hierarchy. (Similar to Tangram). Our hope is that this functionality (not necessarily this code) will eventually be included as part of the SPOPS distribution, along with the new has-a and links-to functionality proposed on the openinteract-dev list. From the Changes file, the updates since the last release (0.42) ... 0.52 Wed, Sep 11, 2002 - Updated to sync with SPOPS-0.68. Minor changes to fetch() and fetch_group(). Removed docs for refetch() and field_update() since they are now in SPOPS::DBI. 0.51 Mon, Aug 12, 2002 - Updated to sync with SPOPS-0.64. Minor changes to fetch() and save(). Removed refetch() and field_update() since they are now in SPOPS::DBI. 0.50 Sat, Aug 3, 2002 - Revamped the way objects are saved. Previously, the pre_save_action() method took care of getting things into the parent tables by creating parent objects and saving them (causing untold grief in implementing other pre_save_actions). The pre_save_action() method has been removed and a save() method has now been added. This method was copied directly from SPOPS::DBI::save() in SPOPS-0.61 and some small modifications made so that the object is successively blessed into each of the classes it inherits from (starting with ESPOPS::Object and ending with the class itself), and the appropriate _save_insert() or _save_update() is called. This eliminates the creation of parent objects via new and it eliminates the multiple calls to pre/post_save_action during a given object save. *** NOTE: THIS MAY CAUSE INCOMPATIBILITIES *** (e.g. the pre/post_save_action methods in Boat.pm in the tests had to be changed) - Replaced fetch() with one modified from the SPOPS::DBI::fetch() in SPOPS-0.61. - Replaced fetch_group() with one modified from SPOPS::DBI::fetch_group() in SPOPS-0.61. Unlike previous versions of ESPOPS::Object::fetch_group(), this version only does individual fetches for rows in the result of the initial db_select for which the 'class' field does not match the class used to call fetch_group(). So fetching many objects of the same class should be much faster if the correct class is used to call fetch_group. Fetching objects of different classes using a fetch_group called by a common base class will be done exactly as before. - Added e_has_a, and pre/post_fetch/save/remove_actions which handle forward direction auto fetching/saving/removing. - Added pm_fetch() method to do polymorphic fetch. Functionally identical to calling fetch_group with a where clause which is just an id clause. - Modified isa_classes() to return classes in order of proximity to current class in the inheritance tree. The calling class is always the first element and ESPOPS::Object is always the last element in the list. Modfied the order of tables in join created by fetch/fetch_group(). - Added fetch_group_by_field() and fetch_group_by_ids() methods. - Added refetch() and field_update() methods. Currently do NOT work for inherited fields. - Added create_unless_exists() method, implemented by Raj. -- Ray Zimmerman / e-mail: rz...@co... / 428-B Phillips Hall Sr Research / phone: (607) 255-9645 / Cornell University Associate / FAX: (815) 377-3932 / Ithaca, NY 14853 |