Use Case CRUD Formats

One of the most common questions students and inexperienced practitioners ask when creating a use case model is how to write CRUD (create, read, update and delete) use cases. There are several options to represent these functions:

  1. Not representing it as a use case (Bittner; Spence, 2002; Lily, 2000)
  2. Create one “manage” use case.
    1. Create, update, and delete functions are represented as alternative flows (Cockburn, 2000)
    2. The use case has several basic flows (Övergaard; Palmkvist, 2004)
  3. Create each use case separately.
    1. Use the extends relationship from a “read” use case.
    2. The create, update, and delete use case has a includes relationship with a “read” use case.
    3. Use a precondition to specify specific CRUD use cases from a base use case (Cockburn, 2000)
    4. Represent the use cases without any relationships.

Even though this is a common issue, there is no correct answer for this question. It is a matter of preference. In fact, this is one of the main problems of the use case technique: there is no single method. Each author proposes different terminology, concepts, semantics, templates, rules, and guidance on how to create them (another post presents the result of a survey on use case concepts). Continue reading

JUnit error when testing an Xtext DSL

As part of a research idea, I’m now creating a language to write Use Cases, using Xtext. It is also a good opportunity to analyze more deeply this framework for building textual DSLs in Eclipse.

But this is not why I’m writing this post. After I wrote the language specification, I wanted to create some tests. I followed the very brief tutorial and wrote a simple test. However, It didn’t work. The failure trace in JUnit always presented an error:

org.eclipse.xtext.parser.ParseException: java.lang.IllegalStateException: Unresolved proxy sure the EPackage has been registered.

at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(

... Continue reading

Crítica – Livro "VHDL – Descrição e Síntese de Circuitos Digitais"

Decidi escrever, em português, algumas críticas de livros que estou lendo e, a primeira delas é sobre o livro “VHDL – Descrição e Síntese de Circuitos Digitais” de Roberto d’Amore (2ª Edição, LTC, 2012). Gostaria de deixar claro que não tenho nenhuma relação com o autor ou com a editora e, portanto, a crítica representa simplesmente a minha opinião sobre o livro. Esse livro apresenta a linguagem de descrição VHDL, enfatizando o seu uso para a síntese de circuitos digitais.
Continue reading

Inheritance in QVTo

An interesting feature in QVT Operational Mapping language (QVTo) is mapping reuse. Differently from QVT Relations (QVTr), the QVTo language has some concepts that allow reusing mappings easily, and, more importantly, in an organized way. One of these concepts is mapping inheritance.

When I first saw this concept, I expected (or hoped) it would allow specializing an existing mapping similar to what happens in a object-oriented language – maybe because I am an OO programmer/designer. To my frustration, it does not… Moreover, I think it has a strange semantics that is more similar to an “include”. Yet, a truly “inheritance” can be an interesting and useful concept to allow mapping reuse in QVTo.

Before discussing what I think would be a more interesting semantics, let me explain how it works in QVTo. Continue reading

Using black box implementations in Eclipse QVTo

In QVT, it is possible to execute external code in a transformation. According to the standard, it has some benefits (QVT, 2009, p.10):

  • It allows complex algorithms to be coded in any programming language with a MOF binding (or that can be executed from a language with a MOF binding).
  • It allows the use of domain specific libraries to calculate model property values. For example, mathematical, engineering, bioscience and many other domains have large libraries that encode domain-specific algorithms which will difficult, if not impossible to express using OCL.
  • It allows implementations of some parts of a transformation to be opaque.

The external code is called a “black box implementation”.

Using this concept, in Eclipse QVTo it is possible to execute an external Java code. In this post I will describe how you can easily create a black box implementation to execute a math sine operation. Continue reading

PhD Thesis

Here it is, finally, my PhD thesis in Computer Engineering. It is in Portuguese and its original title is “Transformação de um Modelo de Empresa em um Modelo de Casos de Uso seguindo os Conceitos de Engenharia Dirigida por Modelos” – which can be translated to “Transforming an Enterprise Model into a Use Case Model using Model-Driven Engineering Concepts”. Continue reading

Essential Use Case Meta-model

There are several meta-models and templates for use case textual description. These representations have different goals and viewpoints, thus proposing different concepts, or different relationship between concepts, or even different semantics for a concept.

Because some MDE works need to use a basic use case meta-model as part of the transformation, in this paper in WER 2011; I proposed an essential use case meta-model. This meta-model was based on a survey on existing meta-models and templates (the analysis of these concepts is available in this post).

Due to space limitations, the paper only presents part of the meta-model abstract syntax and semantics (textually). In this post I will make available the full abstract syntax and concrete syntax using XML (for the semantics, please refer to the original paper).

The meta-model’s abstract syntax is presented next, using a MOF class diagram. The Ecore file is available here. The original meta-model was adapted to include three meta-classes: UseCaseModel, Agent and Subject. Agent and Subject were included to represent who executes a Step – if a Subject (the System) or an Actor – an Agent is simply a generalization of Subject and Actor.

Essential Use Case Meta-model Continue reading

Common Elements in a Use Case

I’ve published a paper in WER 2011 that analyzes the most common elements of a use case textual representation and proposes a meta-model considering them. Due to lack of space, it wasn’t possible to include the original tables used in the analysis. During the workshop I’ve promised that I would make it available somewhere… and I’m finally fulfilling this promise. Here it is the first table, analyzing the main concepts proposed by some templates and meta-models.

Continue reading