talk sac '12 - se track
TRANSCRIPT
Jcome Cunha, Joo Saraiva
Universidade do MinhoPortugal
Joo Paulo Fernandes
Universidade do Minho & Universidade do PortoPortugal
HASLab Talk, March 21, 2012
From Relational ClassSheets to UML+OCL
Jcome Cunha, Joo Saraiva
Universidade do MinhoPortugal
Joo Paulo Fernandes
Universidade do Minho & Universidade do PortoPortugal
SAC-SE 2012March 26-30, Riva del Garda (Trento), Italy
From Relational ClassSheets to UML+OCL
Agenda
IntroductionClassSheets
Extending ClassSheets: Relational ClassSheets
Mapping Relational ClassSheets to UML Class Diagrams + OCL
Conclusions and Future Work
Introduction
Spreadsheets are widely used
Image taken from http://www.flickr.com/photos/cosmosfan/2414002070/
Spreadsheets are widely used
Spreadsheets are widely used
Spreadsheets contain many errors
Image taken from http://www.computerrepairmaintenance.com/secrets-to-fixing-computer-problems/
Model-based approach promises good results
Images taken from http://www.getopt.org/ecimf/contrib/onto/REA/REA-UML.gif and http://www.telecom-lille1.eu/people/Vanwormhoudt/siteEMFOCL/tutoriel/TutorialEMFOCL1.htm and http://weblogs.asp.net/scottgu/archive/2006/07/12/Tip_2F00_Trick_3A00_-Online-Database-Schema-Samples-Library.aspx
Only after a model is done instances are created
Has been showing good results in other fields
Not only in CS, but in more stable areas like civil engineering
This approach is not followed when developing spreadsheets
ClassSheets Spreadsheet Models
ClassSheets to the Rescue!
Introduced by Engels and Erwig to model the business logic of spreadsheet data
They allow to model spreadsheets using object-oriented concepts
Vertically Expandable Tables
Spreadsheet Data
ClassSheet Model
Horizontally Expandable Tables
Relationship Tables
ClassSheet Model
Spreadsheet Data
Initial empty spreadsheet is generated
How does it Work?
From a ClassSheet an initial spreadsheet is generated
This generated spreadsheet guides users in introducing correct dataThe spreadsheet includes mechanisms that guarantee that the spreadsheet data always conforms to the model after an user update
Does not allow to specify several constraints
Specially database-like features
In fact, the example shown could not be completely characterized by the original version
We will show how to extend ClassSheets
Also, tools to further analyzes are missing (for example, test properties)
The mapping to UML Class Diagrams will make available an entire new set of tools
Limitations
Extending ClassSheets: Relational ClassSheets
Unique Values
Foreign Key
Mapping Relational ClassSheets to
UML Class Diagrams + OCL
Small Example
ClassSheet UML
Running Example (ClassSheet)
Running Example (UML)
context Pilots inv pkPilots : Pilots.allInstances-> forAll(a1, a2 | a1 a2 implies a1.id a2.id)
context planeskey : PlanesKey inv fkPlanesKey : Planes.allInstances-> exists(a | a.n-number = planeskey.planes_key)
Generated OCL Sample
(Part of) The Implementation
Baseado em haskell
Integrado no OO
Clicanca-se em botoes
Espetacular
Basic
Conclusions and Future Work
Conclusions
We have extended the original ClassSheets with relational features
With the extension we can now specify database-like spreadsheets
UML Class Diagrams + OCL can now be automatically derived from ClassSheets
A more broad specification language and tools are now available
Future Work
USE allows to add pre and post-conditions to on operation on UML model
This could be translated to formulas/macros in spreadsheets systems
Map existing UML Class Diagrams models to ClassSheets
Thank you!