Annotations as language

3

I was just reading Mike’s post on software electricians. My gut response was that it’s not weird at all to be working primarily on tweaking annotations in a heavily frameworked Java app these days. In fact, I wouldn’t even agree in this case that the annotations are extra-syntacticular (according to the Webster definition). :)

Rather, I would say that the annotations used in the project form the language of the application. Some might call it a DSL. I wouldn’t, although I think that has the right connotations. Those annotations are likely more or as important than the code they annotate. I think that’s an interesting way to write an app. I’m not sure I’d like it, but I’d be willing to give it a shot.

I remember reading some post back when annotations were freshly released talking about experience using similar constructs in Smalltalk (IIRC). He was advocating judicious use of annotations because otherwise you build an application-specific dialect that can only be understood if you’re are an expert in your particular app. He had been down that path and found it ultimately problematic and come back to a more moderate use of annotations.

Now, the app Mike describes is actually based on some fairly widespread and standard annotations, so is probably not unapproachable for someone new to the project, but it certainly seems like the “wiring” is maybe serving as more than just wiring to me.

Comments

3 Responses to “Annotations as language”
  1. hi Alex,

    re: not weird at all. I didn’t convey the gist very well. My friend was commenting on the irony that the build is more complicated than the app, and that they are in a “new world” re: annotations.

    This new world _is_ weird (i.e. alien, different) for them, but not necessarily bad or wrong.

    I’ll have to think more on annotations as extra-syntacticular and/or wiring…. ;-)

    Mike

  2. Weiqi Gao says:

    Are you sure you checked the dictionary? This Google search result seems to indicate that Mr. Easter had just invented a word. ;-)

  3. Bill Shirley says:

    Flex, JavaFX, etc. are extending scripting languages to not only be functional languages but also “declarative languages” – which is a nice way of saying a configuration file is defining how this thing works.

    Annotations seem to be the same thing, a mixing of declarative/configuration with functional/oop. As it’s used in EJB, it’s basically moving XML configuration into the runtime-checked, compile-time checked code.

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!