2.2 Flexible Data Access
Data access API of an ERP system highly depends on
internal details of the system. Not all architectures
can efficiently support data access from outside of the
system. In fact, most of the systems never allow such
access.
2.2.1 State of the Art
A straightforward approach to data access can be
to use SQL. Since ERP systems rely on relational
databases, SQL statements could be issued directly
against the databases to retrieve required data. Al-
though SQL is natively supported by the underlying
databases, this approach is unlikely to deliver the ex-
pected results. SQL statements need to be written
against an actual schema of a database. The problem
with this approach is that it violates the data encapsu-
lation principle. Basically SQL exposes too much of
control over the underlying database and greatly in-
creases the risk of corrupting data in the system. An
ERP system is not only a collection of structured data,
but also a set of business rules that apply to the data.
Generally these rules are not a part of the system’s
database. Direct access to the database circumvents
the rules and implies data integrity violation. There-
fore, to enforce the rules the direct access to data by
any means is strictly prohibited.
An alternative to SQL can be data as a service ap-
proach. In this case a system exposes a number of
Web services with strictly defined semantics. This ap-
proach has an advantage of hiding internal organiza-
tion of data. Instead of a data schema a set of oper-
ations that return data are exposed by a system. By
choosing operations and calling them in an appropri-
ate sequence required data can be retrieved. Because
of using Web services this approach is platform inde-
pendent. However, this method has a serious disad-
vantage: lack of flexibility. Although an ERP system
vendor can define many data accessing operations,
they will never cover all possible combinations of data
pieces of an ERP system. Often these operations are
limited to one business object. ECAs on the other
hand address very specific or fine-granular needs and
deliver value by assembling information coming from
different locations of a system. Therefore, the granu-
larity of data services does not match the granularity
of ECAs’ operations and the services cannot provide
adequate support for the ECAs. For this reason ECAs
need to issue multiple service calls and combine a re-
sult set on their own. This greatly complicates the
development of ECAs and undermines their perfor-
mance. This situation clearly demonstrates the ad-
vantage of the SQL approach. The ability to construct
fine-granular queries that fully match the information
needs of ECAs makes SQL a much more flexible API
than data as a service.
As one can see both approaches have advantages
and disadvantages. SQL as a data access API gives
great flexibility by allowing to construct queries that
match the granularity of a user’s information needs.
However, SQL exposes too much control over the
database, circumvents business logic rules and binds
ECAs to a specific implementation platform. The data
as a service approach on the other hand enforces busi-
ness rules by exposing a set of Web operations which
encapsulate data access and hide data organization.
However, the granularity of the exposed operations
does not match that of a user’s needs, which creates
inflexibility and hits performance.
2.2.2 Business Object Query Language
In this subsection we contribute with an idea of
how to combine the advantages of discussed ap-
proaches while eliminating their disadvantages and
propose a concept called business object query lan-
guage (BOQL).
It is clear that accessing raw data directly and
circumventing business logic contradicts with data
encapsulation. For this reason business objects ap-
peared. They fully control the access to the data and
protect the integrity of data. From external perspec-
tive business objects are simply a collection of seman-
tically related data, e.g. invoice, bill of material, pur-
chase order, and a number of business operations that
can be performed on the data, e.g. read, create, etc. A
business object can be represented as set of data fields
or attributes, e.g. id, count, name, and associations or
links with other business objects, e.g. a SalesOrder
is associated with a Customer and Product business
objects.
Despite the diverse semantics of business objects
they all have the same structure (an array of attributes
and associations) and behavior (a set of operations).
After a number of experiments we have found that
the most important operations to support by a busi-
ness object are Create, Retrieve, RetrieveByAssocia-
tionChain, Delete and Update. Therefore, all busi-
ness objects can be derived from the same base class
featuring the mentioned arrays and operations. Such
uniform behavior and structure allow to introduce a
query language for business objects very much like
SQL for relational entities. We propose the following
scenario:
1. A programmer composes a query, the description
of what to retrieve from the system, according to
some SQL-like grammar and sends the query as
ICSOFT 2010 - 5th International Conference on Software and Data Technologies
18