Business rules do not get the attention they deserve in Software Engineering. They are mostly ignored in the specification phase and implemented in an adhoc manner in the target platform. We discuss why this is not going to work anymore
6. • Grady Booch – history of softwre engineering
The entire history of software engineering is that of
the rise in levels of abstraction
- Grady Booch
Goal: Write less and less code
10. Model
Rapid prototyping
Static analysis
Code generation
Automated testing
Refactoring/
Transformation
Documentation
[Illustration by Bernhard Rumpe]
MDE = Models as key elements in all aspects of
Software Engineering
13. What is a model
13
City of Nantes = “system” to be
modeled
A map is a model of this system
Its legend is the grammar/
metamodel
Different maps can focus on
different “views” of the city
14. Not so different from languages
MDE Grammarware
MOF
(metametamodel)
UML
(metamodel)
ABank.uml
EBNF.g
Java.g
MyProgram.java
19. Definition
Business rule:
Statement that defines or constrains some
aspects of the business
Applied on business terms
Independent from programming languages
Defining Business Rules. "What Are They Really." The Business Rules Group, 2000, 1-77
20. Conceptual Schema Centric Development – Antoni
Olivé
It is both useful and
necessary to integrate
the business rules and
conceptual modeling
23. Why OCL (Object Constraint Language)?
23
No serious use of UML
without OCL!!! (limited
expressiveness of ALL
(graphical) notations
To learn OCL see http://modeling-
languages.com/ocl-tutorial/
24. OCL: Basic Concepts
• OCL is a rich language that offers predefined mechanisms for:
– Retrieving the values of an object
– Navigating through a set of related objects,
– Iterating over collections of objects (e.g., forAll, exists, select)
– Expressing conditions on those collections (sum, size,…)
• OCL includes a predefined set of types + operations
– Primitive types: Integer, Real, Boolean and String
– Collection types: Set, Bag, OrderedSet and Sequence
– 3 valued logic
26. OCL Example: Derivation Rules
context Customer::discount: integer
derive:
if not self.premium then
if self.rental.car.carGroup->select(c|c.category=’high’)-
>size()>=5
then 15
else 0 endif
else 30 endif
27. OCL Example: Contract
context Rental::newRental(id:Integer, price:Real, startingDate:Date,
endingDate:Date, customer:Customer, carRegNum:String)
pre: customer.licenseExpDate>endingDate
post: Rental.allInstances->one(r | r.oclIsNew() and r.oclIsTypeOf(Rental) and
r.endingDate=endingDate and r.startingDate=startingDate and ….
28. Relationship of OCL with other rule-based
languages? Very little research on this
39. Implementing OCL constraints
Triggers in a
database
Views on a
database
If-then
conditions in
Java methods Cabot, Teniente: Incremental integrity checking
of UML/OCL conceptual schemas. Journal of
Systems and Software 82(9):
Key point:
Incremental
checking
41. • Very few tools support it
• Even less generate code from OCL
Nobody uses OCL
• No explicit rule engine component
• Mixed with code
• Adhoc approaches are used (errors, incomplete and
inefficient)
Rule implementation is left to programmers
42. It is both useful and
necessary to integrate
the business rules and
conceptual modeling
49. “the goal of the project is to
make the promise of
open data a reality by
giving non-technical
users tools they can use
to find and compose the
information they need”
53. Web APIs as main citizen
… a.k.a. JavaScript Object Notation…
…a text-based open standard
designed for human-readable data
interchange…
…derived from the JavaScript
scripting language for representing
simple data structures and
associative arrays, called objects…
JSON
66. Many Challenges
• On the data (scope)
• On the quality of the data
• On the precision of the discovery process
• Propagation of uncertainty values
Uncertainty
• How to discover them
• Optimal paths considering non-functional trade-offs (e.g. price vs quality)
Non-functional properties
71. During the industrial
revolution, every machine got
an electrified version
The next revolution is the
cognificatin of everything via
cheap access to specialized
AIs
74. Cognifying Rules: 5 examples
Rule Modeling bot as virtual assistant
Rule inferencer to discover schema of unstructured data
A code generator that mimicks a company programming
style
A real-time rule reviewer
A morphing rule modeling tool that adapts to the user
profile (language, input format…)
77. Some sad stats (2009 – 2016)
0
2
4
6
8
10
12
RuleML Papers with
UML or OCL in the
title
RuleML Papers with
"Software" in the
title
Researchers
publishing also at
Models
Valerio Cosentino et al: MetaScience: An Holistic Approach for Research Modeling. ER 2016