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

  • Home
  • SEARCH
  • 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

I have often heard this term being used, but I have never really understood
I am often in a situation where I have a method where something can
Here's my particular situation... I have a decent amount of experience with webforms, and
I have found this example on StackOverflow: var people = new List<Person> { new
I have been using this website pretty often in order to solve small issues
I often run into a situation where I want to have a set of
This often comes up: your application has gotten extensive enough that it's time to
I see this often in the build scripts of projects that use autotools (autoconf,
Code like this often happens: l = [] while foo: # baz l.append(bar) #
I use a pattern that looks something like this often. I'm wondering if this

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.