Blessed from its origins with an ideal location, Dundee has had its share of bad luck in recent centuries.

Successive industries - whaling, jute-weaving, print news, jam-boiling, watch-making - all flourished on the sunny side of the Firth of Tay, then failed to deliver on promises of permanent mass employment.

But when considering their 19th and 20th century setbacks, Dundonians of the future might weigh up a countervailing piece of good fortune in the 21st. It is luck the city helped to make for itself, and which explains its air of steady self-confidence, despite the recession and subsequent fragile recovery.

For all the economic carnage of the last few years, Dundee has better prospects than at any time in the last half century. How did that happen?

Click here to read our four page supplement on the £1bn revival of Dundee

It helped that Scotland's fourth biggest city entered the slump in 2008 on a rising wave. For about a decade previously, Dundee had been surprising fellow-Scots by fostering a renaissance in life science research and medical entrepreneurialism, in the arts and culture, pioneering new digital industries, and asserting itself as an embryonic hub for the offshore renewables industry.

Although never likely to challenge Aberdeen's oil-based boom, Dundee can point to the list of diverse and dynamic companies that want to be here - Alliance Trust, Michelin, Axis Shield, Cyclacel Millipore and Waracle, as evidence of unarguable business advantages.

The city has also played to its academic strengths: the life science hub at the University Of Dundee, which has recently undergone a £200 million campus redevelopment, Duncan of Jordanstone College Of Art And Design, and the University Of Abertay Dundee, a national leader in digital games. More than 35,000 people study here, one of the highest gown-to-town ratios in the UK.

Resilient morale, at least in some parts of the city, has not saved Dundee from the recession. Far from it. The downturn has as hard as anywhere else in Scotland (see graph "change in employment by sector 2008-2011").

But having a plan and sticking to it, has encouraged outsiders to invest in the city's future, despite the loss of thousands of jobs in the present.

It must be said this momentum has been achieved in defiance of mild but pervasive prejudice against this city, whose disproportionate rates of multiple deprivation are the residue of those previous busts.

According to the city council, at 27.5% Dundee has 4.4% more economically inactive people of working age than the Scottish average. Its claimant unemployment rate in April was 5.8%, against a Scottish average of 4%. The biggest employer, with 23% of all jobs, is health and social work, which is almost twice as large as the next category (retail, at 12.6%), and still growing.

That a city with stats like these can still be seen as a potential showcase is largely due to the commitment of £1billion in public and private money for a 30-year programme to transform the city's eight-kilometre waterfront, divided into five separate development zones, Riverside, Seabraes, Central Waterfront, City Quay and Dundee Port (see map).

This is backed by a programme of regeneration in other parts of the city, some of it, like Page\Park [sic] architects' spectacular refurbishment of the McManus Gallery and surrounding Tay Square, and the current £2m remodelling of City Square Unlike past visions of Dundee's future, this one is intended by city development director Mike Galloway, to be future-proof as well as recession-proof.

As in Glasgow with its well-timed Commonwealth Games regeneration, massive public investment in Dundee has kept the cement mixers churning since 2008, where elsewhere demand has dried up.

The slump may have slowed progress, and made private investment hard to come by, but visitors can't fail to spot dramatic differences, as the city tears down (or even better, blows up) its legacy of post-war eyesores and a stream of good news forces Scots to re-examine their prejudices about the City Of Discovery.

"Dundee seems to me to be perfect example of how public money should be spent to the good. All the money spent over the last 10 years, has made the city think about what it can be," says Steven Garry, a partner at Unicorn Property, one of the city's leading commercial and residential property developers, at the forefront of the rebirth of the city's slow but steady regeneration. Since 2005 the firm has developed 250,000 square feet of grade A office space, as well as 350 residential units.

"The cash is not being frittered away on any fanciful projects, but on very carefully-conceived and skilfully executed engineering works, it's all been very efficient and dynamic"

"The fact all this money has been committed when the recession started has been a great blessing. The current Scottish Government and its predecessor have committed to this vision, the money has stayed robust, and we are starting to see the benefits, as we get out of the downturn. We are never going back to over-enthusiasm of the past, but Dundee has weathered the worst of the recession very well."

So far more than £500m has been spent on readying the infrastructure for the new, river-oriented Dundee, much of it literally sunk costs, such as strengthening the 575 metre Dock Street Rail Tunnel (£5.9m) and building the 2.2m litre "attenuation tank" (£4.3m) by the Tay that will insure the city against the remote threat of future flooding.

The mini spaghetti junctions previous planners interposed between the city and its waterfront (the medieval-to-Victorian harbour was landfilled with the rubble of historic buildings), have been removed.

A new grid system has been laid out reconnecting city centre streets with the Tay shore, and monstrosities such as Tay House, the Olympia Swimming Baths and the Hilton Hotel have been reduced to rubble or are set for the wrecking ball.

With these foundations laid, the pace of transformation of the city is poised to enter a far more visible phase, one developers hope will actively promote a virtuous circle of investment, as increased footfall attracts shops, restaurants and service businesses, which in turn attract more visitors.

The top project at the centre of the 240-hectare riverside regeneration is the £45.5m V&A Dundee, designed by Japanese architect Kengo Kuma. With about 70% of its funding now in place, the V&A, which will showcase Scotland's under-valued design heritage, it is due to start construction next year.

More than 500,000 people are projected to visit Dundee in the first year after it opens, settling to 300,000, which would make it Scotland's fifth biggest attraction. Forecasters expect £1bn to be spent by visitors to between 2015 and 2025.

The V&A, which features in most enquiries from interested investors according to Unicorn, was described at the city's recent economic summit as "a potential connectivity machine" by a speaker from Bilbao passing on tips about her city's Guggenheim museum-led regeneration.

Before its foundations have been laid, it has already opened up world of opportunities beyond those of more customers - many of them arriving via a rebuilt Dundee railway station - for the city's hotels, restaurants and shops.

The upmarket Malmaison chain is completing the refurbishment of the old Tay Hotel and Acor Hotels MGallery brand will operate a 38-suite five-star hotel in the old Custom House building. Both owe their existence, in large part, to the V&A factor.

To date, Dundee's enviable international reputation as a centre of academic research and innovation has not translated into palpable buzz on the streets, certainly not in poorer pockets of the city such as Lochee, the Glens or Whitfield.

However, the new waterfront development will make the city's claims as a showcase for modern Scotland more concrete, as would its hopes of a successful bid to become UK City Of Culture 2017. This might seem a potential eyebrow-raiser given that city's SNP leadership presumably expects Scotland to be out of the UK by that date, but in the new Dundee, pragmatism trumps ideology.

No doubt the vision of the city as a showcase for Scotland's future will be subject to many qualifications and corrections. Nevertheless visitors to the city are likely to conclude that, for the foreseeable future, Dundee's luck is in.