• No se han encontrado resultados

CAPÍTULO II: ESTUDIO DE MERCADO

2.1 Aspectos generales del estudio de mercado

2.1.4 Análisis del sector industrial

vtemp = iter.next(); if ((vtemp.getLastname().equals("Wagner")) && (vtemp.getFirstname().equals("Frank"))) { vtemp.setSalary(vtemp.getSalary() * 1.2); vtemp.update(); ... vtemp.delete(); break; } }

We can now achieve transparent processing by employing CRUD representa- tions of remote data and remote operations and thereby enable operation-oriented processing as well as data-oriented processing. Right now, we have seen operation- oriented processing on VT objects in CRUD representation independent of the em- ployed adapter technology and remote system. In the next section we show how data-oriented processing is achieved by means of VTQL requests on VT objects in CRUD representation.

4.3

VTQL Requests

VTQL is based on OQL, which in turn is based on SQL. OQL only provides a re- trieval part, i.e. SELECT queries (also see [CBB+00]). We additionally include the

three other CRUD principles in VTQL, i.e. create, update and delete requests, anal- ogously to SQL. Thereby, VTQL requests provide a data-oriented way of accessing the VT.

4.3.1

Read Requests

A VTQL read request retrieves remote data entities using a VTO operation structure if necessary analogous to the operation-oriented way shown in Section 4.2.1. For example, data-oriented access to VTEmp (see definition on page 73) uses VTO operation structure getEmpsOfDept(...) to properly access the CRM system in a data-oriented way:

SELECT *

FROM VTEmp.getEmpsOfDept("AS")

WHERE lastname = ’Wagner’ AND firstname = ’Frank’

Note that this is possible although the CRM J2EE connector only provides operation-oriented access! The FROM clause now contains the suitable VTO oper- ation structure initialization, i.e. VTEmp.getEmpsOfDept(”AS”), that is the basis for the read VTO access operation. The read VTO access operation is implicitly executed by the FROM clause so that one or more VTEmp instances are retrieved from the CRM system as output for the FROM clause. The selection and projection in the WHERE and SELECT clauses then perform as usual.

4.3.2

Create Requests

A VTQL create request creates one or more new remote data entities and corre- sponding VT object instances using a VTO operation structure if necessary. For example, data-oriented instantiation of VTEmp can use VTO operation structure

addEmp(...) to properly access the CRM system in a data-oriented way:

INSERT INTO VTEmp.addEmp(’check was okay’) VALUES (’Wagner’, ’Frank’, 2000)

The INSERT INTO clause contains the proper VTO operation structure initial- ization, i.e. VTEmp.addEmp(”check was okay”), which is the basis for the create VTO access operation. The VALUES clause specifies the attribute values of the new VTEmp instance to be created so that the overall INSERT statement can be executed as a create VTO access operation.‡

4.3.3

Update Requests

A VTQL update request writes one or more modified VT object instances to the associated remote data entities. For example, data-oriented modification of VTEmp can use VTO operation structures getEmpsOfDept(...) and replaceEmp(...) to properly access the CRM system in a data-oriented way:

UPDATE VTEmp.getEmpsOfDept("AS")

SET salary = salary * 1.2

WHERE replaceEmp("good guy") AND lastname = ’Wagner’ AND firstname = ’Frank’

The UPDATE clause does not contain the initialization of an update VTO op- eration structure, but requires a read VTO operation structure, which is respon- sible for retrieving the VTEmp instances to be changed in the CRM system, e.g.

VTEmp.getEmpsOfDept(”AS”). VTO operation structure getEmpsOfDept(...) al-

lows the UPDATE clause to perform a corresponding read VTO access operation and to retrieve a set of VTEmp instances, which are further selected by the WHERE clause, i.e. lastname = ’Wagner’ AND firstname = ’Frank’. The selected VTEmp instances are then changed corresponding to the SET clause, i.e. salary = salary *

1.2. The last step is the use of an update VTO operation structure in the WHERE

clause, e.g. replaceEmp(”good guy”), which provides the necessary information for the update VTO access operation that is finally performed by the overall UPDATE statement.

The values in the VALUES clause are mapped by the VT object manager to a corresponding

4.3 VTQL Requests

4.3.4

Delete Requests

A VTQL delete request deletes one or more VT object instances and the associated remote data entities. For example, data-oriented deleting of VTEmp can use VTO operation structures getEmpsOfDept(...) and removeEmp(...) to properly access the CRM system in a data-oriented way:

DELETE FROM VTEmp.getEmpsOfDept("AS") WHERE removeEmp(true)

AND lastname = ’Wagner’ AND firstname = ’Frank’

The DELETE FROM clause does not contain the initialization of a delete VTO operation structure, but refers to a read VTO operation structure, which is respon- sible for retrieving the VTEmp instances to be deleted from the CRM system, e.g.

VTEmp.getEmpsOfDept(”AS”). The VTO operation structure allows the DELETE

FROM clause to perform a corresponding read VTO access operation and to retrieve a set of VTEmp instances, which are further selected by the WHERE clause, i.e.

lastname = ’Wagner’ AND firstname = ’Frank’. Finally, a delete VTO operation

structure is suitably initialized in the WHERE clause, i.e. removeEmp(true), and the delete VTO access operation is performed by the overall DELETE statement.

4.3.5

Data-Oriented Data Usage

The CRUD representation of the DBS tables, i.e. VTEmployee and VTDepartment, integrated by the DBS SQL wrapper as shown in Section 4.1 of course allows us to access them in a data-oriented way, too:

INSERT INTO VTEmployee.insertEmps() VALUES (’Wagner’, ’Frank’, 2000) SELECT *

FROM VTEmployee.selectEmps()

WHERE lastname = ’Wagner’ AND firstname = ’Frank’ UPDATE VTEmployee.selectEmps()

SET salary = salary * 1.2 WHERE updateEmps()

AND lastname = ’Wagner’ AND firstname = ’Frank’ DELETE FROM VTEmployee.selectEmps() WHERE deleteEmps()

AND lastname = ’Wagner’ AND firstname = ’Frank’

First, we create a new VTEmployee instance, then we retrieve all VTEmployee instances, next we perform an update and finally we delete one or more VTEmployee instances.

We can syntactically simplify the VTQL requests since VTEmployee has only one VTO operation structure for each VTO access operation type and since all VTO operation structures are empty. Therefore, we can omit the VTO operation structure names as well as the parameters so that we come up with a semantically equivalent, but syntactically simplified form of VTQL requests:

INSERT INTO VTEmployee

VALUES (’Wagner’, ’Frank’, 2000) SELECT *

FROM VTEmployee

WHERE lastname = ’Wagner’ AND firstname = ’Frank’ UPDATE VTEmployee

SET salary = salary * 1.2

WHERE lastname = ’Wagner’ AND firstname = ’Frank’ DELETE FROM VTEmployee

WHERE lastname = ’Wagner’ AND firstname = ’Frank’

Actually, the syntactically simplified form is identical to the original syntax shown in Section 4.1.

The result of the last two sections is that VTEmployee and VTDepartment as well as VTemp and VTDept can be accessed in an operation-oriented way as well as in a data-oriented way since they conform to the CRUD representation independent of the employed adapter technology or the underlying remote system. Now, we have shown how operation-oriented remote systems and adapter technologies as well as data-oriented remote systems and adapter technologies can be mapped to VT objects in CRUD representation. The CRUD representation of a VT object, i.e. its VTO access operations and VTO operation structures, enables transparent processing, i.e. operation-oriented processing as well as data-oriented processing on the same VT object, so that the access paradigm of a client system becomes independent from the access paradigm of an adapter or remote system.