Montag, 15. August 2011

Extension of my thoughts concerning the "multi verb in identifiers "-dilemma

Today I discussed my preceding blogpost and the two introduced strategies to solve it with some colleagues. During this discussion I realized that there is an important precondition for both strategies. In my last post I discussed the identifier "generate and send invoice" and I described two ways to refactor this identifier:

  • Generalize (and merge) the verbs: "charge invoice"
  • Specialize the adjective: "send ready-to-print invoice"

Both strategies rely strongly on the semantic of the noun "invoice" (the accusative object if you read the identifier as an imperative sentence). This noun is a business term and it implies a business meaning: a message which lists the ordered articles or services and the amount of money the recipient has to pay for them.

I asked myself if the strategies would work in case of a noun without such a business semantic, e.g. "generate and send mail". The verb "to charge" implies to provide an invoice, but it won't make sense for any message. So the identifier "charge mail" would lead into serious trouble because one could understand it in a way that the recipient has to pay for the mail (because the mail is charged). Applying the second strategy would cause a similar case: "send ready-to-print mail" does no tell the whole story since the content of the mail is not characterized. A mail could also just be a simple covering letter.

This means that both described strategies have a strong precondition: an accusative object with a specific meaning in the operation's domain. This leads to the following refactoring algorithm for operation identifiers with two predicates:

1) Specialize the accusative object as precise as possible.
2a) Generalize the two verbs.
2b) Specialize the accusative with an adjective.

I would like to thank my colleagues Gerwin Abbing (Blue Carat AG) and Stefan Jockenhövel (Paragon Systemhaus GmbH) for the interesting and inspiring discussions on this topic.

Keine Kommentare:

Kommentar veröffentlichen