Crítica – Livro "Algoritmos em linguagem C"

Capa do livro "Algoritmos em linguagem C"

Fiz a disciplina de Algoritmos e Estruturas de Dados com o prof. Paulo Feofiloff durante a graduação na Poli – é, já faz um bom tempo… Foi nessa disciplina que realmente aprendi a programar. Mas não foi só isso: aprendi a ensinar durante essa disciplina. Tive ótimos professores na graduação, mas o prof. Feofiloff foi o melhor deles. Ele era dedicado: quase toda aula tinha exercícios e ele os corrigia invariavelmente para a aula seguinte. Ele era objetivo: a aula não tinha enrolação e o conteúdo era em um nível adequado para a sala. Ele era sistemático: o material da aula estava disponível no site dele e a aula seguia o planejamento. Ele era acessível e interessado: ele se esforçava ao máximo para responder todas as perguntas, seja durante a aula ou após ela. Ele era rígido: as correções eram duras, mas honestas. Só não me lembro de ele ser engraçado, mas a minha memória pode estar me enganando…

Por tudo isso, eu fiz questão de ler o livro dele: “Algoritmos em linguagem C” (Campus/Elsevier, 2009). Comprei logo quando foi lançado, mas só agora tive tempo e motivação de lê-lo por completo. E o livro me lembra bastante a aula dele – até pelo conteúdo. É um ótimo livro sobre o tema, direto e objetivo. Continue reading

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 http://wwww.levysiqueira.com.br/MyLanguage.ecore#//Element.Make sure the EPackage has been registered.

at org.eclipse.xtext.parser.antlr.AbstractAntlrParser.doParse(AbstractAntlrParser.java:105)

... 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