Naming Convention for State / Region / Province [closed]
Asked Answered
R

7

23

I am building a class that represents a US State or Canadian Province. What should the class be called?

Some ideas:

  • Region: Problem with this is that .Net has a RegionInfo class that uses the term Region to represent a country (and not a State or Province).
  • State: Problem with this is that it could cause confusion with Application State, or Session State, etc...
  • Province: Could work, but very Canada-centric. Just doesn't feel right.

EDIT: GeographicalRegion seems like the way to go. It could even be used as a base class for other geographical region types (ie: Country) and still make sense.

Rogerrogerio answered 16/2, 2009 at 15:36 Comment(0)
A
13

GeographicalRegion would be my choice. Its pretty short and totally unambiguous, and it has no connotations with real types of area such as Province or State.

Advisable answered 16/2, 2009 at 15:39 Comment(3)
GeographicalRegion might be short but I'm not sure it's totally unambiguous. If you would see class called GeographicalRegion would you understand what it represent without looking at the code?Shirberg
Can I ask what you would mistake it for? I think it perfectly describes what it represents. And, as has been edited into the question, and as I have done in my own code, it is easily reused to represent any type of national or international division. What's not to love?Advisable
I do as lot of geocoding related stuff in my job. So anything that says geographic screams x,y or latitude,longitude to me. GeographicalRegion for me can be a class that represents geographic region as in series of points.Shirberg
C
13

Definitely don't go with "State" - way too confusing, and "Territory" has .ca implications too. Wikipedia suggests "Subnational" or "SubnationalDivision" would be good.

Calvano answered 16/2, 2009 at 15:41 Comment(2)
Do you have a link to the article?Trepidation
too late, but here it is, @Trepidation en.wikipedia.org/wiki/Administrative_divisionJilolo
R
7

A more generic name for State, that is applicable anywhere in the world, is CountrySubdivision, or just Subdivision.

Reube answered 16/2, 2009 at 15:59 Comment(0)
A
6

Google uses the term administrative_area_level_1 in their geocoder.

administrative_area_level_1 indicates a first-order civil entity below the country level. Within the United States, these administrative levels are states. Not all nations exhibit these administrative levels. administrative_area_level_2 indicates a second-order civil entity below the country level. Within the United States, these administrative levels are counties. Not all nations exhibit these administrative levels. administrative_area_level_3 indicates a third-order civil entity below the country level. This type indicates a minor civil division. Not all nations exhibit these administrative levels.

REF: http://code.google.com/apis/maps/documentation/geocoding/#Types

Airtight answered 10/9, 2010 at 13:45 Comment(0)
S
4

I see no problem with State; in the context you're using it in, I don't expect any confusion with application state. Everywhere you use it, you'll also be referring to Country, StreetName, and PostCode, right? Likewise if you choose to name it Region.

I don't like Region, though, because it's rather vague. All kinds of things are regions. If someone asked me what region I lived in, I might say the Midwest. Or the Western Hemisphere. Or Ramsey County. It all depends on context.

You and those working on your project should already know the context, so use a word that makes sense there. Don't worry about whether the word has meanings in other contexts; you're not working with those.

Shelah answered 16/2, 2009 at 15:51 Comment(0)
S
0

StateOrProvince

Shirberg answered 16/2, 2009 at 15:41 Comment(7)
OrTerritoryOrCountyOrCantonOrOblastOrDistrictCalvano
"I am building a class that represents a US State or Canadian Province". Reread the question.Shirberg
Like I didn't. So you're gonna bail on Nunavut, NWT, Yukon and future expansion from the get go? Designing for now isn't designing at all.Calvano
Then I'll rename the class. I don't see a reason to design for the whole world when developing an app that will be used in one specific country. Remember YAGNI.Shirberg
C'est la vie - I'd rather just go with a more general term that doesn't ask for refactoring later. We'll have to agree to differ.Calvano
I concur, Mexico=State, Canada=Province, US=State, Chile=Region. StateOrProvince has the advantage of showing that it's not country specific without the ambiguity of the accepted answer: GeographicalRegion. I don't really mind putting Chile's Regions into a property named StateOrProvince, because the intent of the property is clear to any English speaking person. Whereas if I come onto a project and find GeographicalRegion...I have no idea what the heck that is until I read through the code and see it associated with states.Glasgo
StateOrProvice is directly specified in X.500, but I think that reference is rather fundamental to this unexplained answer.Slipway
C
0

After some consideration, I realized that in my case the requirement was to specify a region to search, so I went with IAreaLocator. The idea is that the implemented area locators will allow specification of non-finite regions. They could be geo-fences, states, provinces, countries, etc..

Comprehension answered 5/4, 2019 at 16:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.