The approach we took with Windward is that everything is in the template file. There is no code tied to a template. There’s no associated properties file. It’s all in the template.
This is a decision I made partially at the start, and then on an ongoing basis. At the start I was (and still am) focused 100% on making this a product non-developers can easily use. And that means no code.
This has lead to what I view as a major advantage of Windward - the business logic of a template is in the tags in the template. That puts that logic right there front and center making it easy for the template designer to both implement and see the business logic for a template.
If instead it was hidden in code, special data queries for a template, etc. then the template designer would be working on a black box in places. When that black box works as expected - it’s great (simpler). But when it is not as expected, or worse as assumed, then you have a giant problem.
Next came the no associated file(s) issue. This first came up with the initial chart tag (when the tag itself was a text tag, not a chart). The tag content was so long, we considered having an associated properties file. But we surveyed our customers and they were unanimous that a single template was better - even at the cost of very long tags. So we continued with keeping everything in the template.
As time has gone on, we’ve improved things to make this work elegantly. Chart and bitmap tags are now actually charts & bitmaps and so those long tags are completely hidden (and shorter as many of the properties are now chart & bitmap properties, not tag properties).
And for most of our customers, they have one method in their application that is used to generate documents. It is passed the template, output stream, generally a couple of properties, and sometimes a datasource (many have a single datasource for everything).
And from that we have two gigantic wins. First, when working on a template, it’s all right there. You have total visibility of what is going into the template.
Second, adding or editing a template means there’s no code change. Nothing! It’s just uploading the template. And that means no testing, no staging, no anything around pushing up a new version of the program.
And this includes the case of a template using parts of the datasource that were never originally envisioned. All of the data is available for any template.
This is an architecture decision I think we got perfect.