Older blog entries for cerquide (starting at number 52)

Since I am going again through my UML course, I am reading again and thinking again about use cases, layers, UML, classes, objects and GUIs stuff.

My main objective is to find a way that I can show in simple examples how to model a small problem using UML and then go and implement this design into a program respecting a clear separation of concerns and keeping a reasonable object oriented model. The problem is always the GUI.

I have been looking at some XUL frameworks, but they are not object oriented at all.

However, I have found two interesting frameworks to check:

Both of them construct a GUI from a domain model.

Obtaining a design with separation of concerns puts the GUI code "close to" the GUI code and the model code "close to" the model code. Patterns such as MVC do that. However, those patterns (even PAC) end up with a lot of data flowing through the objects, contrarily to what would be expected in a nice OO design (I mostly do agree with most of Holub opinions as expressed in his Javaworld articles). A nice OO design will ask for putting code "close to" the data it needs to execute.

I think that the main problem as of today is with current programming languages and the idea of "close to". Current programming languages rely for their design in the concept of file. It should be possible to express a program or system as a set of files. If two things appear in the same file, it means they are somehow "mixed" or "close to" each other. Think of the ".h"-".c" stuff in C, or the "1 class"-"1 file" java stuff.

Usually, in any reasonable programming language, the environment for a piece of code is determined by the set of "files-packages-modules" that are "included-imported". This is a kind of 1-dimensional dependency relationship that allows us to structure our code into a "package dependecy tree". However, there is no possibility that the same class is present into several packages. There is no possibility (in the sense of the programming language making it simple) for a package to export several different APIs for its usage by different kinds of users. There is no direct structuring of the packages (in Java, classes import classes, but no dependency between packages can be expressed).

I think that, in order to organize code in a way that I will be proud to show my students I will need a programming tool (not language, the concept of language is too tied to the expression of programs as a set of words instead of as a set of diagrams for example) which allows me to express these ideas. A tool that allows me to describe the system architecture and the go on and fill in the details. I have to think of a way of structuring the following fundamental concepts into a software system:

  • Layers
  • Classes
  • Packages (or modules)
  • Interfaces
  • Objects
so that every piece of code is located and has dependencies exactly on what it needs.

I think that the only reasonable result is that code resides in a database where it can be accessed from several perspectives and is edited by a tool instead of residing in a set of files and being edited by a (however advanced) file editor.

The WAI group site I have been working on is in beta stage. Can be accesed at its definitive location WAI

Finally I hacked a bit into the basilic php and python and constructed a small system that goes easily from a bibtex file to a publications site (including the automatic download of pdf files if the url field is defined in the bibtex entry). That was fun.

I have been testing some PHP frameworks for CMS. I have selected xoops to build my research group website. It is a nice piece of work with many different modules. I am also going to use the basilic publications manager.

In order to put the website in place I have been learning xoops and hacking LAMP for the last two days. PHP is an order of magnitude faster development than Java (and I have been hacking Java for some years).

18 Oct 2004 (updated 18 Oct 2004 at 17:26 UTC) »

Happily (and sometimes unhappily) hacking Ocaml. Today I had a problem with the Ocaml binding for gsl that took me about 6 hours to fix. Now it is done!

I keep up with the idea of rewriting Durin in Ocaml. My (inefficiently coded) Perl code is about 40 times slower. Running a set of experiments was about 1 day and a half in a cluster of 20 computers. The Ocaml version is about two ours on my desktop computer. Anyhow, I still have some problems to write Ocaml code that looks clean and easily readable.

After meeting Marcus Hutter in Padova, I got interested in his theory of universal artificial intelligence. I have ordered the book and in order to prepare for it I am reading An Introduction to Kolmogorov Complexity and Its Applications.

Writing from Padova. I am in Discovery Science 2004.

I am running two student projects that use PNL. I have to prepare a quick introduction to Probabilistic Graphical Models for undergrads.

After talking to esteve I have decided to propose a project in Learning in Games, concretely centered in repeated games. The main idea is to develop software that supports in making research in learning in repeated games. That means that the software should be able to:

  • allow the easy definition of a repeated game (including Bayesian games, if possible)
  • allow the easy definition of one (or a set of) players of a repeated game. This includes a library of well known players such as fictitious players.
  • allow the easy definition of an experiment (sampling games from a probability distribution over games).
  • run experiments and show graphs that are illustrative of whether there is convergence, computes averages of performance for different sets of players, etc.
The second step would be to think about creating new players, programming them and making experiments to evaluate their efficiency.

Interesting resources for the topic are:

6 Aug 2004 (updated 6 Aug 2004 at 19:31 UTC) »

I am learning Ocaml by trial and error. I have decided to drop Durin development in Perl and I have migrated most of it to Ocaml refactoring some pieces for consistency. That way ODurin has been born.

Hacking Ocaml provided me mixed feelings. From Ruby, I have noticed a lack of commodity, that turns out in more time developing for the same task. IMHO Ruby is the best programming language I have tried yet. A pitty the interpreter/compiler is not more efficient. Apart from that, I like Ocaml. I feel like there are two kind of languages: C, C++ or Java make it difficult to refactor and freeze your design. Perl is somewhere inbetween. Ocaml and Ruby allow you to quickly modify your design. This means that a single developer can maintain a much bigger project with dynamic specs in Ocaml than in C. Since in research programming specs change a lot. I have decided to stick with Ocaml for a while.

And Ocaml is efficient!!! It really is!!

I have integrated Ocaml with the NTL package using Swig. I spent a whole day until I found out that C++ references are not that simple to work with in the Ocaml-C++ Swig interface and I dropped them all to use pointers.

I am back hacking C++ (migrated from Ruby) due to efficiency reasons. The language has changed fundamentally in the last few years (while I was fundamentally hacking Java and MSWord). STL has established as a fast standard library. The community seems lo be geared towards metaprogramming with heavy use of templates. I have ordered a copy of "Modern C++ Design" by Alexandrescu which seems to be the new "reference book" on C++ style. I have been testing some of the Boost libraries, such as lambda, that gives C++ a functional style, but at the moment I think it is abusing the language.

I am decided to learn Ocaml, because the language seems to provide a good mix of programmability and efficiency.

1 May 2004 (updated 1 May 2004 at 09:56 UTC) »

Many things to note, grouped by categories

Object Oriented Design and Layers

Nowadays everybody knows that a well architectered application consists in a set of layers (such as UI - Model - Database)and a well designed object oriented model. Even I do! Since I am teaching Programming Methodology I have tried to put together some nice tiny examples of object oriented layered architectures, and I have found that actual programming languages are not well suited for this need. If you do a good object oriented analysis, you will end up with an object model. This object model reappears at the three different layers. That, let's say I am implementing a TODO-list management program. I will have a UI layer Task and a Model layer Task, both containing the description of the task. Furthermore, if I make an inheritance hierarchy such that ImplementationTask inherits from Task and so does DesignTask, I have to repeat this inheritance hierarchy at every layer. Sure there will be objects specific for each layer, but most domain model objects will be present in all of them.

After thinking for a while I see two solutions to this:

  • Using a programming language that allows open classes. In Ruby you can think of having one (or a set of) .rb file for each layer. Since we can add functionality to objects, the UI layer will just reopen the model layer objects and add the UI related functionality. Since the model is implemented in separate files, there is no dependence between the model and the UI, but the UI shares the model object model. Drawbacks are that classes are to be open at every layer.

  • Providing usual OO languages such as Java with a construct and semantics to deal with layers and create an IDE that works with such constructs. While decoupling more and more from the filesystem, our way of programming and thinking of independence in programs is still very much influenced by how we store our code into files. In Java, for example, many times we assume everything under the same .java file as interdependant. We can break this by introducing (for example) a layer keyword that separates the different parts of the object that implement services for the different layers. So we will have something like

    public class A {

    layer Model

    //Model functionality

    layer UI

    //UI functionality


    Plus a file layers.xml for the complete application, describing the dependencies between the layers.

    The IDE will know which layer we are working in and will show :

    • The underlying layers as blackbox services (just the methods we can call, not the code)
    • The code of the layer we are working in
    • Nothing about layers that we do not depend on

Mass spectrometry classification

Finally I have found some GNU software and a reasonably well written article about mass spectrometry classification.

Network programming

J2EE sucks.


I have been reviewing papers for several conferences and workshops this week. Undoubtedly, GTDT04 papers were the most interesting and high quality. I will be really sad if I am not able to be in NY.

Family matters

Next Thursday I am driving to Seville to see my little niece. I will be back on Barcelona on Monday.

ZF inconsistent

fxn, I cannot reach the paper. Do this means we can now positively confirm my long time unproven theorem that 2+2=5? :o)

I have done the Dante´s Inferno Test. Here come the results

The Dante's Inferno Test has banished you to the Second Level of Hell!

Here is how you matched up against all the levels:

Level | Score

Purgatory | Very Low

Level 1 - Limbo | Very Low

Level 2 | Very High

Level 3 | High

Level 4 | High

Level 5 | High

Level 6 - The City of Dis | Very High

Level 7 | High

Level 8- the Malebolge | Very High

Level 9 - Cocytus | High

Level descriptions: http://www.4degreez.com/misc/dante-inferno-information.html

Take the test: http://www.4degreez.com/misc/dante-inferno-test.mv


I have spent all Saturday morning cleaning. What a stupid way to start holidays!


Lots of work, as usual.

I have to prepare my UML course at f2i.

The course at Sony was really a nice experience.

I am trying to stablish a reasonable research framework with Oryzon genomics. I think the software we are developing could be interesting both from a research and from a commercial point of view.

I have been asked by Geoff Webb to coauthor a paper about TBMATAN, AODE and other classifiers based on improving TAN. I have accepted

I have been asked to review papers for IEEE SMC and IEEE Intelligent Systems.


In a few days I will have my nieces here sharing the holidays with us.

43 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!