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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:25:15+00:00 2026-06-12T18:25:15+00:00

Currently, we have an business entity can be represented both as an enum or

  • 0

Currently, we have an business entity can be represented both as an enum or as a class.

The class implementation is easier and make business logic more clear. But there is probability of 50% that the requirements will change and an enum representation will make our life easier.

Concrete example

An entity has title and color. Color is editable, so there 2 ways

  1. entity is an enum – there is another class with mapping from entity to its color.
  2. entity is a class – just one more fiels for color, no problems.

Future change requirement – there should be rules associated with each entity

  1. entity is an enum – the rules are hard coded in the code
  2. entity is a class – there are needed few more classes for mapping and also an UI that will allow user to specify them.

In case the set of rules is static, the second option is an overkill.

So, in case we will need to transform the class to enum, are there any recommendations about this process ?

EDIT

The set of entities is limited and unlikely to be changed by user.

Thank you in advance.

  • 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-06-12T18:25:16+00:00Added an answer on June 12, 2026 at 6:25 pm

    In case you want some functionality from enums and some from classes, then you could use mix of these:

      public class ColoredTitle
        {
    
            private String color;
            private Title title;
    
            public ColoredTitle(String color, Title title)
            {
                this.color = color;
                this.title = title;
            }
    
            public String getColor()
            {
                return color;
            }
    
            public void setColor(String color)
            {
                this.color = color;
            }
    
            public String getHeading()
            {
                return title.heading;
            }
    
            enum Title
            {
                FRONT_PAGE("Front Page"),
                FOOTER_TITLE("Footer Title");
    
                private String heading;
    
                Title(String title)
                {
                    this.heading = title;
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently working on a silverlight business application, so I have come across
I currently have one project that currently contains multiple packages. These packages make up
What I'm attempting to do is have a Super entity class for saved products.
I have a base class DomainObject for all my business objects I am using
The Scenario Currently I have a c# silverlight business application. The application is hosted
Background Currently I have a C# Silverlight business application which uses RIA Services. The
Background Currently I have a C# Silverlight business application which uses RIA Services. The
We currently have a quite complex business application that contains a huge lot of
I currently have a POCO class in my ASP.NET MVC project that handles all
I have a self-referencing entity, Department , which can have child Departments (n-level deep).

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.