Monday, February 2, 2009

On Java EE complexity

Reading an article I remembered the words of one of my friends (Doru Girba) about the increasing complexity of Java, the language and technologies. And I must agree with him: EJB it's a nightmare (at least version 2), Java enterprise application start to add more and more complicated technologies, which add more complexity rather than to simplify things. I start to feel all this complexity myself, being involved in a massive enterprise project.
But there is also hope for better. Spring (a JEE application framework) simplified a lot the JEE landscape; it heavily influenced EJB version 3 with it's innovative ideas.
Another good sign is the development of more and more dynamic languages that run on JVM. The most promising (from my point of view) is Groovy: a dynamic version of Java (dynamic typing, closures, MOP, and others). Groovy also provides and web framework, inspired by the famous RoR, called Grails. Groovy's advantage over other dynamic languages is that it is compiled into Java bytecode, so it looks live ordinary Java classes.
Coming back to the article I mentioned in the beginning, it's about the recent acquisition of the company that develops Groovy and Grails by SpringSource (the company that develops Spring framework) - "More Weapons for the War on Complexity: SpringSource Acquires Groovy/Grails Leader". A combination of Spring and Groovy and Grails, running on a light-weight application server, based on OSGI, looks like a very promising idea. And the most interesting is the new SpringSource motto: "Weapons for the War on Java Complexity."

Conclusion: Keep it simple! Do not complicated things more than it has to be.
"Everything should be made as simple as possible, but not simpler." - Albert Einstein
"Perfection (in design) is achieved not when there is nothing more to add, but rather when there is nothing more to take away." - Antoine de Saint-Exupery

Saturday, February 16, 2008

The perfect definition for "Meta"

Defining the word "meta" is always hard, this includes programming.
Following is the Wikipedia definitions for "meta":
Meta is a prefix used in English in order to indicate a concept which is an abstraction from another concept, used to complete or add to the latter.
This way too abstract and hard to understand. A better definition for the word "meta" is given by Guy Steele in his OOPSLA'98 talk "Growing a Language" (video and paper), for the meaning used in programming but also for a more general meaning.
Meta means that you step back from your own place. What you used to do is now what you see. What you were is now what you act on. Verbs turn to nouns. What you used to think of as a pattern is now treated as a thing to put in the slot of an other pattern. A meta foo is a foo in whose slots you can put foos.
If you carefully analyze this definition you'll find a very deep meaning and you'll probably realize what "meta" means. And also if you truly understand this definition than you probably understand the whole meta-programming stuff. So just read that definition very carefully.


Friday, October 5, 2007

Software Visualization

Software visualization is defined as “the use of the crafts of typography, graphic design, animation, and cinematography with modern human-computer interaction and computer graphics technology to facilitate both the human understanding and effective use of computer software.”(John T. Stasko et. al.). It is a specialization of information visualization, whose goal is to visualize any kind of abstract data, while in software visualization the sole focus lies on visualizing software.


Software visualization and reverse engineering: Software visualization has been widely used by the reverse engineering research community during the past two decades. Many of the approaches provide ways to uncover and navigate information about software systems. The graphical representations of software used in the field of software visualization, a sub-area of information visualization, have long been accepted as comprehension aids to support reverse engineering. Software visualization has become one of the major approaches in reverse engineering, Koschke reporting that 80% of interviewed researchers consider visualizations as being important or absolutely necessary in software reverse engineering.

The enormous interest in visualization as an aid for reverse engineering and problem detection can also be inferred from the large number of tools that have been developed for this purpose: Rigi, SHriMP, CodeCrawler, Mondrian, etc.

My interest in this domain appeared during my visit to SCG, during my diploma thesis, when I created a set of new visualization for Lisp systems, developed to underline the differences of the language and to help understand and browse complex Lisp systems. For more information see my diploma thesis.

Friday, March 16, 2007

Going META!

Recently i am interested metaobject protocols.
Reading "The Art of the Metaobject Protocol" by Gregor Kiczales, Jim Des Rivieres, Daniel G. Bobrow (MIT Press) was a wonderful experience for me.
Like Alan Kay said: "The Art of the Metaobject Protocol is the best book written in computing in ten years" (Keynote OOPSLA 1997).

In a language based upon metaobject protocols, the language implementation itself is structured as an object-oriented program. This allows the power of object-oriented programming techniques to be exploited to make the language implementation adjustable and flexible. In effect, the resulting implementation does not represent a single point in the overall space of language designs, but rather an entire region within that space.

A metaobject protocol (MOP) is an interpreter of the semantics of a program that is open and extensible. Therefore, a MOP determines what a program means and what its behavior is, and it is extensible in that a programmer (or metaprogrammer) can alter program behavior by extending parts of the MOP. The MOP exposes some or all internal structure of the interpreter to the programmer. The MOP may manifest as a set of classes and methods that allow a program to inspect the state of the supporting system and alter its behaviour. MOPs are implemented as object-oriented programs where all objects are metaobjects.

The the best-known runtime MOP and the most powerful is the one described in the book "The Art of the Metaobject Protocol"; it applies to the Common Lisp Object System (CLOS) and allows full reflection (introspection and intercession) on every entity in CLOS (object, classes, methods, slots) and even on the mechanisms of inheritance, method dispatch, class instantiation and so on.

Even if your not interested in this meta-stuff, you should read this book because you will think differently after that, and you'll look at OO programming from another angle.
So my advice is: go META!

Saturday, February 3, 2007

Stratified design

This is an idea from the book "Structure and Interpretation of Computer Programs" by Hal Abelson, Jerry Sussman and Julie Sussman (an excellent computer science text used in introductory courses at MIT - a must read book).
They come with the idea of Stratified design (programming in a sequence of levels, one level based on another), giving the example of The picture language.


"We have obtained a glimpse of another crucial idea about languages and program design. This is the approach of stratified design, the notion that a complex system should be structured as a sequence of levels that are described using a sequence of languages. Each level is constructed by combining parts that are regarded as primitive at that level, and the parts constructed at each level are used as primitives at the next level. The language used at each level of a stratified design has primitives, means of combination, and means of abstraction appropriate to that level of detail. ... Stratified design helps make programs robust, that is, it makes it likely that small changes in a specification will require correspondingly small changes in the program."

There is also a paper by the authors of the book on this topic: "Lisp: A Language for Stratified Design" by Abelson and Sussman.

This idea is put to work in some of the newer trends in programming, like Language Oriented Programming (Sergey Dmitriev), Intentional Programming (Charles Simonyi), Language workbenches (Martin Fowler), Little Languages (Matthias Felleisen), Grammarware (Ralf Lammel), etc.