Object type in pl/sql, PL-SQL Programming

Object Type:

The object type is a user-defined composite datatype which encapsulates a data structure along with the functions and procedures required to manipulate the data. The variables which form the data structure are known as the attributes. The functions and procedures which characterize the behavior of the object type are known as methods.

We typically think of an object (like a car, person, or bank account) as having behaviors and attributes. For illustration, a baby has the attributes age, gender, and weight, and the behaviors drink, eat, and sleep. The Object types maintain this perspective when you sit down to write an application.

Whenever you define an object type using the CREATE TYPE statement, you create an abstract template for several real-world objects. The template specifies only those behaviors & attributes that the object which will require in the application atmosphere. For illustration, an employee has numerous attributes, but usually only a few are required to fill the requirements of an application.

172_Object Type in pl-sql.png

Figure: Form Follows Function

 

Assume that you should write a program to allocate the employee bonuses. Not all the employee attributes are required to solve this problem.Therefore, you design an abstract employee who has the problem-specific attributes as: name, job title, id_number, department, salary, and rank. Then, you can identify the operations required to handle an abstract employee. For illustration, you require an operation which lets Management change the rank of an employee.

Later, you define a set of variables to present the data, and a set of subprograms to perform the operations. Lastly, you encapsulate the methods and attributes in an object type. The data structure created by the set of attributes is public. Though, well-behaved programs do not influence it directly. Rather, they use the set of methods provided. In that way, the employee data is kept in an appropriate state.

At run time, if the data structure is filled with values, you have created an illustration of an abstract employee. You can create as numerous instances (usually known as objects) as you require. Each object has the name, job title, and number, and so on of an actual employee. This data is accessed or changed only by the methods related with it. Therefore, the object types let you create objects with the well-defined behavior and attributes.

2140_Object Type in pl-sql1.png

Figure: Object Type and Objects (Instances) of That Type

Posted Date: 10/6/2012 7:56:13 AM | Location : United States







Related Discussions:- Object type in pl/sql, Assignment Help, Ask Question on Object type in pl/sql, Get Answer, Expert's Help, Object type in pl/sql Discussions

Write discussion on Object type in pl/sql
Your posts are moderated
Related Questions
Effects of NULL Operator As a general rule-but not a universal one-if NULL is an argument to an invocation of a system-defined read-only operator, then NULL is the result of t

BEGIN Parameter Description in pl sql: BEGIN: This keyword signals the beginning of the executable section of a PL/SQL block, that contains executable statements. The execut

Authorisations - Privileges As relational theory is silent on the issue of authorisation, it offers nothing with which SQL's vast edifice in support of what it calls privilege

Using the Collection Methods The collection methods below help to generalize the code and make collections easier to use and also make your applications easier to maintain:

Write a cursor to open an employee database and fetch the employee record whose age is greater than 45

Using a join on 3 tables, select 5 columns and 10 rows from the 3 tables without the use of a Cartesian product Query: SELECT E.LAST_NAME, E.FIRST_NAME, S.BUILDING, S.BRAN

EXIT-WHEN The EXIT-WHEN statement permits a loop to complete conditionally. Whenever the EXIT statement is encountered, the condition in the WHEN clause is computed. When the co

Need Windows and Linux system Administrator We are seeking a part time system administrator to take care of our servers. Your things to do would add, but not limited to: -

Application to Export Excel Data to MSSQL Server table I am having a table available in excel format and features the subsequent: - Some text is in Arabic (e.g. UTF-8 encodin

THEO R Y OF PANSPERMIA - Arrhenius (1908) postulated the cosmic panspermia theory that claims that organisms existed throughout the universe, and their spores, etc., could