Nice simple class. Does what it has to do. I've 2 remarks;
1. The city names are hard-coded into the class. I think there are better way's to implement that. (discuss ?)
2. The provinces have a code. I believe it's better to use coding according to ISO 3166-2:NL. With some small effort there is conformation to a international standardization. It can be discussed if it's the best standard ;-)
Ashraf Gheith - 2008-10-07 12:35:16 - In reply to message 1 from Vince
I am open to any new idea's, it was just a class I made and used in one project. What do you think, how can I make the cities list? Also do you have a link for province codes by ISO? I am not dutch, I do not know geography of the Netherlands :)
Vince - 2008-10-07 14:08:00 - In reply to message 2 from Ashraf Gheith
The main problem with hard coded information is: maintenance. If something in the data changes, the programmer has to update the program.
Better to get the information from external source. Mostly used are databases. This way you are making updating the information program independent.
Remains the problem of having the correct information. In this case the ISO is the organisation to look at. (http://www.iso.org) The maintain the list ISO 3166. ISO 3166-2 is a subset of this list and gives you information about divisions in a country.
The best way (IMHO) is to retrieve information from the source. This way your class can concentrate on updating/retrieval and presenting the information. This will make live a bit more easy to programmers/sysops and users.
An example list of the ISO 3166-2:NL can be found on: