Best way to model Customer <--> Address

后端 未结 12 1633
被撕碎了的回忆
被撕碎了的回忆 2020-11-30 02:22

Every Customer has a physical address and an optional mailing address. What is your preferred way to model this?

Option 1. Customer has fo

12条回答
  •  粉色の甜心
    2020-11-30 02:51

    I'd go for the first option. In these situations I'm very weary of YAGNI (you aren't going to need it). I can't count the number of times I've looked at schemas that've had one-to-many tables "just incase" that are many years old. If you only need two, just use the first option; if the requirement changes in the future, change it then.

提交回复
热议问题