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?
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:
or for a US address:
When it comes to representing an address in a globalised form, you could have something like this:
There have been attempts to create a global standard way of representing international addresses by the UPU, but no formal standard exists yet…