In 1967 he taught for a year in an exchange position at Lyneham High School in Canberra, Australia, returning to New Zealand as head of department of social studies, geography and history at Freyberg High School in Palmerston North.
In 1972 Mr Barham became inspector of secondary schools, central region, based in Wellington.
As he explained later, he deliberately looked closely - with an intention to begin applications for principal roles - at "the different ways schools handled both policy and delivery of education" "to determine in particular what he would not want to do as a principal".
He was only in his third year in the inspectorate when he was appointed principal of the new high school to be built in Havelock North.
The population was blooming around the country, and this school was one of four built at that same time.
The others were Tamatea High School in Napier, Paraparaumu College and Awatapu College in Palmerston North.
Mr Barham quickly realised that "the strength of the school would be its community", and he enlisted the thoughts of "community, pupils, staff, and senior staff and management - in that order" in thoughtfully building a school for its time, especially over the five years a new school matures through successive class levels into, in this case, the largest school on the East Coast.
At the time of his retirement, Mr Barham said, "I used to think that in five years the school would be grown up and I could sit back - well, that's never happened. Since then there has been constant and steady change in education."
Constant change at Havelock North High School was driven by two quite different things.
The biggest changes all New Zealand schools had to face came from Tomorrow's Schools, which, driven politically, required many immediate changes, and many related changes as a result.
On his retirement in 1996 Mr Barham said he believed that "changes brought about by Tomorrow's Schools have been both positive and negative.
The pace of change has proved to be constant, reliance has been placed on teachers and people working in schools to make things work, and too much is expected of boards."
Mr Barham was chairman of the Hawke's Bay Secondary Schools Principals' Association for eight years during this period, and was always happy to share his educational thinking.
The second level of changes at Havelock North High School were subtle ones. Mr Barham, in his role, was constantly prepared to stand back and review his school and how it operated, to change things that needed change, and was always prepared to consider new things.
It is very easy for a principal in a successful school to move partly into retirement mode, and just keep things as they are.
If Mr Barham had been that sort of principal, his 25 years at Havelock North High School would have been much too long. But as those who taught at his school will vouch, he remained an active principal.
Back in 1974, his new school began without subject streaming, initially had had no written rules, had vertical form classes (ultimately mixing five levels within one form class), and within its first year broke away from the Hastings High Schools board that was responsible for four high schools to form a board of its own.
Over the years the school had a lot of success academically, in the arts and in sport.
Mr Barham appointed staff well, and the school and Havelock North communities benefitted.
As a principal, Mr Barham always managed to be both a strong leader and constant and supportive friend. He never forgot to compliment staff for special effort.
At the daily staff meetings, he often was able to use a good sense of humour to begin things on a happy note. He could tell amusing stories at his own expense.
On one memorable occasion, he began the staff meeting by reporting to staff that he had agreed to a school visit by Sir Howard Morrison who was visiting schools with a ministry-appointed group to motivate Maori students in particular, that he was coming that very day, that he would shortly enter the staffroom, and that he wanted the staff to make him welcome.
He said that after staff meeting he wanted all classes to go to the school gymnasium to meet Sir Howard.
At which point the door opened and in walked Sir Howard to rapturous applause. Staff bit their tongues, cast aside their plans for the first period, and headed their classes towards the gymnasium. Only David Barham could handle these sort of situations with such aplomb.
After leaving Havelock North High School, Mr Barham spent some years as a financial adviser, was an ex-president of Havelock North Rotary, was co-opted by the Ministry of Education on to several educational committees and mentored a number of new or struggling principals.
He is survived by wife Lynette, daughter Jenny, sons Michael and Hamish, and their families.
David Frank Barham, December 29, 1932-July 31, 2016