[stringtemplate-interest] v4 ST

Graham Wideman gwlist at grahamwideman.com
Wed Oct 7 22:12:43 PDT 2009


Thanks Zenaan for the agreeable comments.

Answering your question:

>Brings to mind the verb 'post', such as on a blog/ bulleting board.
>So what would be the complement of myST.post(att) ??

Well the subject of complement came up when you were working backwards from Gerald's mention of .getAttribute to suggest .putAttribute as a candidate for setAttribute.

However, in this case you're starting with the candidate for setAttribute, suggesting "post", and the complement is a lot less important, since it's primarily a read-back of data that the app provided in the first place.

However, by analogy to a message board, I guess the corresponding "gimme access to previously posted thing" operation would be "read" or "edit".

That said, I'm not too hot on introducing a metaphor when a concrete term can be used *I* think unabashedly: Ie: Since any explanation of StringTemplate has to include the idea of "Attribute", then for the API method that allows adding an Attribute, why avoid naming that method "addAttribute"?

The short version "add" is not bad if users can be expected to know what is being added to what.  A minor risk is that since an ST is in the business of basically combining *two* data sources (template text and app data) it's not 100% obvious what plain "add" pertains to.  One might mistakenly imagine that "add" adds a template text.  Of course arguments might make that more clear, though one of the overloaded methods is a straight string.

You can 100% guarantee that if the method is *not* called addAttribute, you will find in the method doc the phrase "adds an attribute to the ST's attribute list". :-)

-- Graham


More information about the stringtemplate-interest mailing list