Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 763633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:35:38+00:00 2026-05-14T16:35:38+00:00

Let’s say I’m modeling phone numbers. I have one entity for PhoneNumber , and

  • 0

Let’s say I’m modeling phone numbers. I have one entity for PhoneNumber, and one for Person. There’s a link table that expresses the link (if any) between the PhoneNumber and Person. The link table also has a field for DisplayOrder.

When accessing my domain model, I have several Use Cases for viewing a Person.

  1. I can look at them without any PhoneNumber information.
  2. I can look at them for a specific PhoneNumber.
  3. I can look at them and all of their current (or past) PhoneNumbers.

I’m trying to model Person, not only for the standard CRUD operations, but for the (un)assignment of PhoneNumbers to a Person. I’m having trouble expressing the relationship between the two, especially with respects to the DisplayOrder property. I can think of several solutions but I’m not sure of which (if any) would be best.

  1. A PhoneNumberPerson class that has a Person and PhoneNumber property (most closely resembles database design)
  2. A PhoneCarryingPerson class that inherits from Person and has a PhoneNumber
    property.
  3. A PhoneNumber and/or PhoneNumbers property on Person (and vis-a-versa, a Person property on PhoneNumber)

What would be a good way to model this that makes sense from a domain model perspective? How do I avoid misplaced properties (DisplayOrder on Person) or conditionally populated properties?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T16:35:38+00:00Added an answer on May 14, 2026 at 4:35 pm

    Option 1 has the most advantages since this is a many to many relationship. Each person will have a list of PhoneNumberPerson objects and each Phone Number will have a list of PhoneNumberPerson objetcs effectively creating two one to many relationships.

    Managing the two one to many relationships will prove easier in the long run.

    A person with no phone will then be a person whose PhoneNumberPerson list is empty. The inheritance option looks like a difficult one to maintain.

    Additionally the PhoneNumberPerson class can carry information like the date that the person started using the phone and stopped using the phone so that it is easy to tell if it is a current phone or not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a link in a table like: <td class=ms-vb width=100%> <a
Let's say I have a table that looks something like this: ------------------------------- id|column2|column3 |column4
Let's say I have a JS in one file that creates a Viewport :
Let's say we have a simple function defined in a pseudo language. List<Numbers> SortNumbers(List<Numbers>
Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,
Let's say I have a user defined table type: create or replace type SrcCodeTbl
Let's say that I have an arbitrary string like `A man + a plan
Let's say I have a class like this: public class Person { private String
Let's say i have an android device that has some extra buttons on it,
let's say i have three tables, each one relates to another, when i need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.