0

In my system each member will have an address and so do no other entity. I choosed to put address in a seperate entity but there exists two inconsistencies.

1- While the one and onlt entity which address is being used in is member, why should I consider it as an independent entity?

2- My adress fields are address 1, address 2, ...., address 6 which I think the naming convention is not good enough. Any Suggestions?

AliAliAli
  • 23
  • 6
  • possible duplicate of [Best practices for storing postal addresses in a database (RDBMS)?](http://stackoverflow.com/questions/310540/best-practices-for-storing-postal-addresses-in-a-database-rdbms) – Forgotten Semicolon May 24 '11 at 14:44
  • Actually my second question has not been answered in the link u sent and my first question either... – AliAliAli May 24 '11 at 14:49

1 Answers1

1

It's commonly considered that a postal address is a "value" object, which means that it is an independant piece of data which is seperate from your other entities, and it does not change. Say you have a "Customer" entity.. it's true that a customer has an address, but the address also exists independantly of the customer. When a customer moves house for example, they do not change the address, they do not pick up the address and take it with them, instead they are given a new seperate address.

Therefore an address entity should be self contained, and (probably) immutable.

As for the data format of an address, it depends entirely if you need your application to be globalized. If you're working with addresses in only a specific country, you can name your fields appropriately, here's an example for a UK address:

Street name / Number,
[Suburb or village etc]
Town/City
County
Post code

or for a US address:

Street name / number
[Suburb or village etc]
Town/City
State
Zip Code.

When it comes to representing an address in a globalised form, you could have something like this:

Thoroughfare name / plot number
Locality
Municipality
Governing District
PostalCode

There have been attempts to create a global standard way of representing international addresses by the UPU, but no formal standard exists yet...

MattDavey
  • 8,897
  • 3
  • 31
  • 54