Re: Best practices for Freemarker templates and UI development
There's no ultimate answer for that, and it depends on the project
(how complex the UI will be, how reusable in needs to be, etc) and the
One approach is that developers start to develop the application with
a very very basic UI (just plain HTML) that they write, not the
designers. That basic UI should contains all the information that
needs to be displayed. That means that when the UI developer comes,
the FreeMarker data-model will already contain the data that need to
be displayed (even if it's just mock data). The important thing here
is that there's a mutual understanding in what exactly the data model
contains (and what's still missing from it). Then you can just switch
between visual design iterations (or back to the basic "plain HTML"
design) as you wish.
But it's an important question what backround the UI developers have.
If they know nothing about programming, probably they can only use the
most basic FTL features without doing horrid things. Then maybe they
should just create some static example pages, and then a developer
with some HTML/CSS knowledge FTL-ises them later. Of course, this
makes design iterations more expensive...
Friday, November 28, 2014, 11:34:51 PM, shivani maheshwari wrote:
> I am new to the Freemarker and want to know what are the best
> practices related to UI development, when using templates.
> Are UI developers supposed to work directly with Freemarker
> templates(coding in FTL) or they work in their own repository(using
> their own tools) and then port changes to templates.
> Also, how changes in templates are tested by UI developers, are
> they supposed to change Java objects too?
> I am new to the Freemarker and want to know what are the best practices related to UI development, when using templates.
> Are UI developers supposed to work directly with Freemarker templates(coding in FTL) or they work in their own repository(using their own tools) and then port changes to templates.
If possible designers should add FreeMarker directives in the markup. For example in a Dreamweaver HTML page.
There are things that you want to keep separate (specially macros), and these should be saved in a separate file and imported in your template.
> Also, how changes in templates are tested by UI developers, are they supposed to change Java objects too?
The Java objects are changed by the application, what do you mean?
If the application is not finished you can feed the template with values from a JSON or XML file.