计算机专业外文资料翻译--对象持久化和java-深入的了解面向对象语言中的对象持久的讨论(编辑修改稿)内容摘要:
with the rest of the Java system. Vendors are encouraged to write an API that is more strongly typed than ODBC, which affords greater static typechecking at pile time. Here39。 s a description of the most important JDBC interfaces: handles the loading of drivers and provides support for new database connections. represents a connection to a particular database. acts as a container for executing an SQL statement on a given connection. controls access to the result set. You can implement a JDBC driver in several ways. The simplest would be to build the driver as a bridge to ODBC. This approach is best suited for tools and applications that do not require high performance. A more extensible design would introduce an extra level of indirection to the DBMS server by providing a JDBC work driver that accesses the DBMS server through a published protocol. The most efficient driver, however, would directly access the DBMS proprietary API. Object databases and Java persistence A number of ongoing projects in the industry offer Java persistence at the object level. However, as of this writing, Object Design39。 s PSE (Persistent Storage Engine) and PSE Pro are the only fully Javabased, objectoriented database packages available (at least, that I am aware of). Check the Resources section for more information on PSE and PSE Pro. 5 Java development has led to a departure from the traditional development paradigm for software vendors, most notably in the development process timeline. For example, PSE and PSE Pro are developed in a heterogeneous environment. And because there isn39。 t a linking step in the development process, developers have been able to create various functional ponents independent of each other, which results in better, more reliable objectoriented code. PSE Pro has the ability to recover a corrupted database from an aborted transaction caused by system failure. The classes that are responsible for this added functionality are not present in the PSE release. No other differences exist between the two products. These products are what we call dribbleware software releases that enhance their functionality by plugging in new ponents. In the notsodistant future, the concept of purchasing large, monolithic software would bee a thing of the past. The new business environment in cyberspace, together with Java puting, enable users to purchase only those parts of the object model (object graph) they need, resulting in more pact end products. PSE works by postprocessing and annotating class files after they have been created by the developer. From PSE39。 s point of view, classes in an object graph are either persistentcapable or persistentaware. Persistentcapable classes may persist themselves while persistentaware classes can operate on persistent objects. This distinction is necessary because persistence may not be a desired behavior for certain classes. The class file postprocessor makes the following modifications to classes: Modifies the class to inherit from or . Defines the initializeContents() method to load real values into hollow instances of your Persistent subclass. ObjectStore provides methods on the GenericObject class that retrieves each Field type. Be sure to call the correct methods for the fields in your persistent object. A separate method is available for obtaining each type of Field object. ObjectStore calls the initializeContents() method as needed. The method signature is: public void initializeContents(GenericObject genObj) Defines the flushContents() method to copy values from a modified instance (active persistent object) back to the database. ObjectStore provides methods on the GenericObject Be sure to call the correct methods for the fields in your persistent object. A separate method is available for setting each type of Field object. ObjectStore calls the flushContents() method as needed. The method signature is: public void flushContents(GenericObject genObj) Defines the clearContents() method to reset the values of an instance to the default values. This method must set all reference fields that referred to persistent objects to null. ObjectStore calls this method as needed. The method signature is: 6 public void clearContents() Modifies the methods that reference nonstatic fields to call the () and () methods as needed. These methods must be called before the contents of persistent objects can be accessed or modified, respectively. While this step is not man。计算机专业外文资料翻译--对象持久化和java-深入的了解面向对象语言中的对象持久的讨论(编辑修改稿)
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。
用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。