[ Team LiB ] Previous Section Next Section

Interactions

Figure 2.4 portrays what happens when an application instantiates a single ActiveDomainObject. The ActiveDomainObject issues an appropriate read or query operation to the database and populates its own contents based on this operation's results. Once it is initialized, the application can readily access its attributes and invoke subsequent operations.

Figure 2.4. An application instantiates an ActiveDomainObject, which populates itself based on physical data. Once the ActiveDomainObject is initialized, the application can readily access its attributes.

graphics/02fig04.gif

Figure 2.5 illustrates what happens when an application sets one of an ActiveDomainObject's attributes. You can define set operations to update physical data immediately, but it is more common to update only an object's working copy in memory. This enables the application to set several attributes and save them at once, reducing the overall frequency of data access. In this scenario, the save operation writes any attribute changes by issuing a physical insert or update database operation.

Figure 2.5. An application sets an attribute and saves an ActiveDomainObject, which updates the corresponding physical data.

graphics/02fig05.gif

    [ Team LiB ] Previous Section Next Section