Tuesday, April 27, 2010

On Symbolic Integration

Writing Code in a GPL (General Purpose Language), elements are referenced by name. Say we do have a Class UserService. If I'd like to instantiate an Object of type UserService, I have to write something like:

UserService userService = new UserService();

Renaming the Class UserService enforces me to rename:

  • All references in the code
  • All comment where UserService occurs
  • UML Diagrams
  • User Documentation
  • SW Architecture
  • ...
As Martin Fowler states in his groundbreaking Article Language Workbenches: The Killer-App for Domain Specific Languages?:
"The second big plus of a language workbench is that you get symbolic integration. The ability to take an excel-like formula language, and just plug it into your own specialized language is pretty nifty. As is the ability to change symbols in one language and have those changes ripple through the whole system, which is a plausible thing to consider with a language workbench (I'm not sure if any of them can do that yet.)"

-- Martin Fowler
Starting actifsource 5 years ago, we agreed that names can be changed anytime. This tasks becomes even more complex if you want to change names on a conceptual level. Imagine to build up a Service Infrastructure. It seems obvious that our Software Architecture describes how to implement Services.

As it almost ever happens, requirements may change due to market demands. Let's say that the Service Concept shall be broaden to a general Component Concept and therefore Services shall be renamed to Component.

If you have done this before in a Larger Scale Software Project, you will agree that renaming conceptual elements is a very hard task. This is because a conceptual name is used widely by its very nature.

For this reason, we decided that we will never reference any element by its name but by a GUID:

"A globally unique identifier or GUID (pronounced /ˈɡuːɪd/ or /ˈɡwɪd/) is a special type of identifier used in software applications to provide a unique reference number. The value is represented as a 32 character hexadecimal character string, such as {21EC2020-3AEA-1069-A2DD-08002B30309D} and usually stored as a 128 bit integer."

-- wikipedia
Using GUIDs instead of names will do the trick: Using actifsource, you are able to rename any element easily. No matter if it has a conceptual or a specific nature.

Technically, a name is just an attribute, which is identified by its GUID. Renaming an actifsource Resource just means to notify all listeners.

To change names easily, make sure that you always reference you Domain Model using the actifsource Content Assist to insert a Model Reference (blue underlined). Even when writing comments.

No comments:

Post a Comment