Encapsulation of Operations and Persistence of Objects


Encapsulation of Operations

Encapsulation of operations refers to the behavior of objects in object−oriented database systems(ODBS)through the responsibilities that can be carried out. Objects can be created, changed, retrieved, or deleted by the use of encapsulation of operations. Customers simply receive knowledge of the operations like interface or signature and aren't made privy to how those operations are honestly achieved.

The implementation includes the specification of any hidden internal information systems in addition to the common sense that determines the operations, while the interface presents the call and parameters of each action.

ODBs offer a sure stage of abstraction that permits users to interact with objects without being aware of the implementation details with the aid of encapsulating the activities of gadgets. The development procedure is made easier and facts.

Visible and Hidden Attributes

Database applications may not always need complete encapsulation of objects. Visible and hidden attributes are formed from the division of objects. Visible attributes are visible to users and can be accessed by the high−level query language. These query languages allow users to retrieve and manipulate data without exposing the underlying implementation. Hidden attributes are encapsulated and are only accessed by predefined operations.

Persistence of Objects

The capability of processes or items to continue existing even after systems are shut down is referred to as persistence in databases. It makes sure that data is safe and accessible for users in the future.

Traditional relational database management systems (RDBMS) store persistent data in the form of records and tables but faces some issue in the case of complex objects and relationships. Specialized databases, such as object−oriented database management systems (OODBMS) and object−relational database management systems (ORDBMS), are created to help with the complex parts. This database preserves objects and provides characteristics like encapsulation, inheritance, and polymorphism.

Data that is reliable, recoverable, and long−lasting across various hardware and software are stored in persistent databases. They make sure that data is protected even when a system is shut down or has problems. This is accomplished through techniques such as naming and reachability.

Persistent data is crucial as it ensures data durability by allowing it to survive system shutdowns and update conditions. Persistent databases enable data manipulation across multiple transactions, providing data consistency and reliability which allow storage and retrieval of complex objects and maintain integrity by preserving their relationship.

The two types of persistence are:

Object Persistence: The long−term storage of items in memory is referred to as object persistence. When objects need to be removed from memory, they are erased in ODBs first. As a result, objects can continue to exist even after their parent processes have ended.

Process Persistence: The capability of processes to continue operating even after other processes have been stopped is referred to as process persistence. To ensure the effective operation of the system, necessary procedures in computers are persistent.

Conclusion

This article consists of two parts containing encapsulation of operations and persistence of objects. Encapsulation of objects refers to the behavior of an object by creating, changing, retrieving, or deleting it. Visible and hidden attributes are present which decide the operations to access the objects. Persistence of objects refers to the capability of objects to exist even after the parent processes are terminated. Types of persistence are object and process persistence in which objects persistence keep the item for a long term and process persistence make the processes continue even after other process stops.

Updated on: 13-Jul-2023

353 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements