The Recipe For
Anything

It is probably better to do data definitions early, if you possibly can, because the operations you want to design will usually follow naturally from the shape of the data.
But sometimes thinking through a specific task may help you design the data and templates.
For a simple example, if you know you want to do a database of customer data, and that you're going to want to "search for phone numbers", you may realize at that point you need a list, with at least names and phone numbers.
And finally if you are doing a task with basically no data structures, and only one or two pieces of simple data, and the data doesn't fall into cases,you can omit defining data. An exaple of this would be "find the area of a circle given its radius."