Welcome

  • This is the blog for Intentional Software Corporation. We keep it open for comments as we seek a dialog with the community. Each participant will be trusted to participate with integrity, decency and respect for others.
  • Visit Intentional Software Corporation

« The long tail of programming languages | Main | Hello out there »

May 02, 2005

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83451741069e200d83458bdca69e2

Listed below are links to weblogs that reference Notations and Programming Languages:

» Aspect limits second time from Thoughts of Oz
Although this blog was opened six months ago, I've discovered its existence only recently. Interestingly, Charles' contribution little formalizes an idea I mentioned six months ago. [Read More]

Comments

Shane Clifford

I have had experience with the importance of matching the “degrees of freedom” to the problem and the effect it has on success that I would like to share. Reading Charles’ post has led me to a conclusion that I had never reached before. At a former employer, I had the opportunity to lead a team developing a pair of domain specific IDEs. Both of these tools used structured code and both used diagrams based on UML for the visual representation of the systems. However, as I will discuss further, one of them was very successful and the other only marginally so.

Our first editor was very domain specific. It was intended to implement an “abstraction-layer”—mapping transactions from a low-level communications protocol into a higher-level protocol that made development of the rest of our distributed systems easier and more generic. We used UML activity diagrams as the visual representation of the transactions, but they were not free-form. Every activity diagram contained three swim-lanes (one for the client, one for the abstraction layer, and one for the server that supported the low-level protocol.) Developers could only construct the transactions using predefined “chunks” of activity diagram (I’ll call them super-activities) that represented possible transaction behavior. The super-activities automatically positioned themselves in the correct swim-lanes and their transitions could only be connected to other activities in a valid swim-lane. Each of the super-activities could then be configured to some extent through a dialog to perform its correct role in the transaction. All of this information was stored in XML and interpreted by a server at runtime.

This editor, after some initial deployment hiccups, was quite successful. The target developers learned to use it very quickly and it filled its niche quite nicely. I hope that my description above was good enough to illustrate that the environment had “degrees of freedom” very closely matched to its domain. Therefore, people who were experts in that domain readily adopted it. In fact, the runtime server was eventually replaced with a third-party product, but a new code generator was written for our editor to produce configuration for the new system so that developers could use our editor rather than the tools shipped with the purchased software.

Our next editor was intended to be much more powerful. Its target domain involved developing the clients of the servers that the first editor produced. These systems were intended to control business process and required state-full, active objects—a system with more apparent complexity than the transaction processing servers. For this editor, we chose to employ more concepts from generative programming and introduced “domain engineering” and “application engineering” roles. The visual representation of these systems was UML class diagrams, hierarchical state diagrams, and feature diagrams (see Generative Programming, by Krzysztof Czarnecki and Ulrich W. Eisenecker, for an overview of feature diagrams, as well as domain and application engineering.) The “Domain Engineers” had complete freedom to design classes of objects for the system family that had very complex hierarchical state machines. It was up to them to model the attributes and behavior of each of the objects in their domain. “Application Engineers” would then pick and choose classes and features to meet the requirements of their specific customer and generate a specific system instance to deploy. This editor also stored the system description in XML, but it included a code generation step that produced a C++ server rather than interpreting the XML at runtime.

This editor met with mixed success. People adapted to the “Application Engineering” role very easily and we were able to fill that role with people that were skilled more as requirements analysts than as expert coders. Unfortunately, the learning curve for becoming a “Domain Engineer” in our environment was very steep. The freedom to create a system using a complex hierarchical state diagram meant that people in the role had to have a VERY good understanding of how those diagrams worked. Plus there was added complexity of doing additional configuration of each of the features. A developer that understood was able to rapidly develop using our IDE. Unfortunately, we were only able to train a handful of engineers outside of our original development team to fill the “Domain Engineer” role. I have been referring to the roles in quotes, by the way, because I am not convinced that our implementation was close enough to the spirit of what is intended by those roles.

It has always bothered me that the second editor was not as well received as the first (my team and I definitely considered it to be the superior product; we actually even considered dropping the first one because the second was quite capable of generating the same systems.) I never had a good feel for why it had worked out that way, but I think Charles’ post has cleared some of that up for me. The first editor directly addressed its problem space with appropriate degrees of freedom. Our second attempt overshot the mark and moved too far into the general purpose realm. Rather than producing a tool that directly addressed the problem domain, we had simply created a visual programming tool with the same learning curve as any other general purpose language. Nice—even fun to use, but without enough benefit to sway a developer to embrace it rather than something they already knew.

Johannes Link

There's one thing about the "degrees of freedom" that has not been discussed: In most if not all cases a new level of abstraction (a DSL, a new PL, MDA or whatever) actually has too few degrees of freedom even for the intended range of problems. Consider Java as a PL which abstracts away manual memory handling. This is a good thing in 99.9% of the cases, but once in a while I'd like to have more degrees of freedom as for whent to claim and release memory from/to the OS. In those cases I have to struggle VERY hard to get what I need. Maybe I even have to call in someone who knows about the abstraction layer beneath, i.e. the details of Java's GC algorithms and configuration options.

My personal view is that there exists a threshold for every abstraction (what percentage of all targeted problems can be solved using it) below which the abstraction brings more burden than relief. The concrete value of the threshold depends on many things; some are domain-specific, some tool-specific and some differ for the individual user or team. However, we must be aware that such a threshold exists when choosing a development approach. My feeling is that current approaches like MDA or AOP haven't reached that threshold yet for most people (and are not even close). The need to debug and find bugs within a certain abstraction layer pushes the threshold even further towards the 100% mark.

Charles Simonyi

Johannes’ post is an important reminder of the problem of “too few degrees of freedom” that I did not address adequately. With most computer languages one can always “manufacture” degrees of freedom, so we have seen Lisp programming implemented in Fortran arrays and the like but as Johannes points out this is always a struggle and not competitive with a natural implementation in the right language. So the ability to adjust the degrees of freedom using the appropriate notation, appropriate naming and the desired run-time implementation is important in both directions: more toward the domain and more toward the implementation. These roughly correspond to the less or more degrees of freedom, or higher or lower level of programming abstractions.

Pranab Das

Hi,

I wrote to one of the Amigos about a simple scheme of AOP. If we use token, line #, or pattern matching, we can instrument source codes with extra functionality, which can then be used in lieu of aspect, albeit only after compilation with the same language compiler (no specific AOP compiler is needed). The instrumented code need not modify the original source. The scheme is outwardly comparable with how AOP works at this time. This can be dynamically extended to runtime objects, as well.

This way, with some additional hurdles, AOP can provide a solution to the problem of creating interface anywhere and also it is possible to recurse through cross-cutting concerns to any level.

Shall be grateful to have an opinion from you. Also, please ask me if I am not clear about my intentions. The topic, is 'N-dimensional programming to replace current AOP'.

Regards,

Pranab

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment