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 6655081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:28:12+00:00 2026-05-26T01:28:12+00:00

I saw some threads on this already on Stack, but wanted a little more

  • 0

I saw some threads on this already on Stack, but wanted a little more clarification.

I have seen many apps where there is a product model and category category model. This is a has and belongs to many association, or a has_many through association.

I have also seen many apps where there is a user model and an email_address model. Email_address belongs to user, but user can have many email addresses.

My question is, would there ever be a situation where you can lump all the email addresses or categories into the user and product models, respectively? So in your user model, you will have email_one, email_two, etc?

What are the pros and cons of breaking it into different models? Thanks.

  • 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-26T01:28:12+00:00Added an answer on May 26, 2026 at 1:28 am

    If the attribute is simple, it’s almost certainly best to keep it in a single model – you can even serialize the attribute so that it takes, for example, and array of email_addresses. BUT (big but) you may well want to add a lot more information to an email address – which one is the primary one, when was it last profiled, email last sent to .. etc etc. This of course is much easier to handle if you have a separate email address model. So perhaps the question is really ‘when should i use serialized attributes?’. My own answer would be ‘only if I’m sure that I am storing something in that field that I never want to add further attributes to’. Usually that means it is something pretty peripheral to the main application, and about which no-one cares very much …

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

Sidebar

Related Questions

I saw some handwarmer apps and I guess it's very easy to make something
I saw some code on an unrelated question but it got me curious as
I saw some code like this: try { db.store(mydata); } finally { db.cleanup(); }
const static int foo = 42; I saw this in some code here on
I saw this script in another thread on stack overflow and tried to play
I saw in WCF they have the [OperationContract(IsOneWay = true)] attribute. But WCF seems
I saw this thread on Stack Overflow regarding converting between DBNull and nullable types
this morning I saw some strange code from one of my coworkers. In an
I have a solid idea how GCD works, but I want to know more
I just saw this question: Understanding .NET’s SecurityAction parameter for permissions And I have

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.