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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:41:13+00:00 2026-05-10T22:41:13+00:00

This is often situation, but here is latest example: Companies have various contact data

  • 0

This is often situation, but here is latest example:

Companies have various contact data (addresses, phone numbers, e-mails…) when they make job ad, they have checkboxes where they choose how they want to be contacted. It is basically descriptive data. User when reading an ad sees something like ‘You can apply by mail, in person…’, except if it’s ‘through web portal’ or ‘by e-mail’ because then appropriate buttons should appear. These options are stored in database, and client (owner of the site, not company making an ad) can change them (e.g. they can add ‘by telepathy’ or whatever), yet if they tamper with ‘e-mail’ and ‘web-portal’ options, they screw their web site.

So how should I handle data where everything behaves same way except ‘this thing’ that behaves this way, and ‘that thing’ that behaves some other way, and data itself is live should be editable by client.

  • 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. 2026-05-10T22:41:14+00:00Added an answer on May 10, 2026 at 10:41 pm

    You’ve tagged your question as ‘language-agnostic’, and not all languages cleanly support polymorphism, but that’s the way I would approach this.

    Each option has some type, and different types require different properties to be set. However, every type supports some sort of ‘render’ method that can display the contact method as needed. Since the properties (phone number, or web address, etc.) are type-specific, you can validate the administrator’s input when creating these ‘objects’, to make sure that the necessary data is provided and valid. Since you implement the render method, rather than spitting out HTML provided by a user, you can ensure that the rendered page is correct. It’s less flexible, but safer and more user friendly.

    In the database, you can have one sparsely populated table that holds data for all types of contacts, or a ‘parent’ table with common properties and sub-tables with type-specific properties. It depends on how many types you have and how different they are. In either case, you would have some sort of type indicator, so that you know the type of object to which the data should be be bound.

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

Sidebar

Related Questions

Here's the situation. I have two sets of data. One is a list of
I have a situation which come in front of me very often but I
When I'm writing code with QtCreator (2.4.1), I'm very often in this situation: something
Situation: I often run into this problematic and never know how to solve it.
I've seen this question asked often, but none of the proposed solutions seem to
I don't see this problem too often but I've got a .cshtml that uses
I am often in a situation where I have a method where something can
This sort of situation comes up pretty often. You loop through an array, and
Here's my particular situation... I have a decent amount of experience with webforms, and
This situation happens a little often, your whole repository has 2MB and then someone

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.