amount of monthly overtime hours). When the
employee is working outside with his superior the
usual procedure consists of the employee sending a
fax or an email (and then someone fills in the
requirement form for them) and their superior
making a phone call or sending a fax authorizing the
overtime hours. Due to organizational security
procedures no one can electronically authorize
overtime hours without a proper password. When
the superior is outside and cannot access the system,
the system cannot accept overtime hours. The
solution adopted by the organization was to remove
the requirement, which stated that all records of the
overtime hours’ authorization table should always
have the superior’s ID.
The important aspect of the previous example is
that, because of one atypical situation (which
nevertheless happens several times) an important
requirement was abandoned (the overtime
authorization control is now made manually, where
previously it was validated by the database). That
happened because the requirement was inflexible.
The paper is organized as follows: in section 2
we present some relevant related work; in section 3
we analyze the related work presented in (Ramos,
2008), and in section 3 we introduce its limitations,
our counterproposal and the plugin we developed for
the automatic generation of OCL, Views and
Triggers. Some concluding remarks are presented in
the last section
2 RELATED WORK
There are already some tools that generate code
based on OCL constraints (Loecher and Ocke,
2010), (Briand, 2005). These tools haven’t yet
reached a final stage, some limitations were found
during their testing. Also, they do not support
graphical notation. Graphical notation is critical
when we want to support the daily work of database
designers in organizations. OCL(Warmer and
Kleppe, 2003) hasn’t yet become a common
language, even in the database community. Its use
requires a deeper knowledge than UML Class
Diagrams.
We follow the work presented in (Ramos, 2008)
where the author, based on deontic notions, already
proposes a flexible notion of the mandatory
property. However, the author does not support his
approach on a computational implementation.
Furthermore, we have detected that the solution
presented in (Ramos, 2008) has some serious
limitations, which can be avoided. Moreover, in
(Ramos, 2008) the role of OCL seems useless since
the author does not present any guidelines regarding
the automatic generation of OCL expressions based
on the UML Class Diagram. In this paper we present
an integrated solution that generates OCL
expressions and SQL scripts based only on the Class
Diagram. Unlike the approach proposed in (Ramos,
2008), we don’t need to extend the relational model
with odd tables. In our approach the relational model
is generated based only on standard rules. Additional
knowledge is stored in triggers and views. In the
next section this work is analyzed with more detail.
Borgida, in his work with exceptions in
information systems (originally in (Borgida, 1985)
with further extensions, e.g., (Borgida et. al., 1999))
considers that exceptional situations arise when
some constraints are violated, and that exceptions
are considered as violations. In his proposal, the
occurrence of a violation is signaled by the creation
of an object in a class called ANY_VIOLATION.
The author proposes an exception handling
mechanism to specify failure actions. Again, this
author also recurs to an odd class (more precisely, he
uses two classes: one for the violations as such and
another for the violation constraints). Borgida
proposes a much more general mechanism to deal
with exceptions handling in object oriented
programming languages. Our approach, apart from
being only oriented on one particular constraint (not
considered in Borgidas work), is focused on the
database generation. Borgida, contrary to us,
explicitly rejects triggers approach, because he
wants to maintain the control in a middleware
software level. What we call Contrary-To-Duties
constraints isn’t addressed in Borgidas work.
The distinction between violable requirements and
mandatory ones is similar to the so called Soft and
Hard constraints. The Semantics of Business
Vocabulary and Business Rules (SBVR), an adopted
standard of the Object Management Group (OMG)
for a formal declarative description of business
rules, considers the deontic modal operators
obligation and necessity (www.omg.org/). Those
operators also intend to deal with the distinction on
hard and soft constraints. The idea is to use them in
computer systems in the context of the
OMG’s Model Driven Architecture (MDA).
3 DEONTIC CONSTRAINTS
In (Ramos, 2008) the author addresses a specific
subject: the mandatory property in relational models
tables attributes. The proposed approach is inspired
DeonticDatabaseConstraints-FromUMLtoSQL
103