Windchill Foundation Interfaces
At the root of the hierarchy is the NetFactor interface. If an abstraction asserts itself as being an object of type NetFactor, it is classified as belonging to a Windchill system. One side effect of being a NetFactor type is that static factory (“new<Class>”) methods, along with supporting “initialize” methods replace constructors.
Classes that are asserted as being ObjectMappable can be written into and read from the database. All remaining abstractions in the foundation hierarchy are a kind of ObjectMappable abstraction. All subtypes of ObjectMappable are Externalizable, which gives an object the ability to use RMI for travel between the client and server. ObjectMappable adds readExternal and writeExternal APIs (similar to those of Externalizable) to support reading from and writing to the database. Windchill annotation processors generate the appropriate implementations for these APIs.
The PersistInfo interface contains information for each object that is stored in the database. PersistInfo does not implement Persistable; it is a structured attribute. It does, however, implement ObjectMappable. This means createStamp, modifyStamp, updateStamp, and updateCount will all be included in readExternal and writeExternal operations.
Links, object references, and query keys are generalized as interfaces as shown in the following figure.
Figure 1. Binary Links
The QueryKey interface specifies a qualification for a persistable object in the database, represented as a combination of a class(name) and identifier. The WTReference interface aggregates a single QueryKey and provides a corresponding “object” representing the (inflated) Persistable corresponding to the key. An attempt to inflate a key that results zero or multiple Persistent objects will result in an exception.
The Link interface specifies the concept of a container of roles and, in particular, the BinaryLink interface, a kind of Link, is an abstraction of an attributed member of an association between two persistable objects. The actual containment of the objects is done by aggregation of references for each role.
The Persistable interface gives an object a primary key (that is, the object identifier) as shown in the following figure, and a table in the database. It is this primary key that is the identifier for an ObjectReference, a WTReference implementation referring to a Persistable via its primary key.
Figure 2. Persistable Objects
First class objects implement the Persistable interface. As a result, a database table is generated for each class in which their objects will be stored. The structured attributes are stored in the database table of their associated first class object. All persistable objects, plus any structured attributes that must be written into or read from the database, must implement the ObjectMappable interface.
這是否有幫助?