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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:21:08+00:00 2026-05-17T17:21:08+00:00

I have an application that requires mappings between string values, so essentially a container

  • 0

I have an application that requires mappings between string values, so essentially a container that can hold key values pairs. Instead of using a dictionary or a name-value collection I used a resource file that I access programmatically in my code. I understand resource files are used in localization scenarios for multi-language implementations and the likes. However I like their strongly typed nature which ensures that if the value is changed the application does not compile.

However I would like to know if there are any important cons of using a *.resx file for simple key-value pair storage instead of using a more traditional programmatic type.

  • 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-17T17:21:08+00:00Added an answer on May 17, 2026 at 5:21 pm

    There are two cons which I can think of out of the blue:

    • it requires I/O operation to read key/value pair, which may result in significant performance decrease,
    • if you let standard .Net logic to resolve loading resources, it will always try to find the file corresponding to CultureInfo.CurrentUICulture property; this could be problematic if you decide that you actually want to have multiple resx-es (i.e. one per language); this could result in even further performance degradation.

    BTW. Couldn’t you just create helper class or structure containing properties, like that:

    public static class GlobalConstants
    {
        private const int _SomeInt = 42;
        private const string _SomeString = "Ultimate answer";
    
        public static int SomeInt
        {
            get
            {
                return _SomeInt;
            }
        }
    
        public static string SomeString
        {
            get
            {
                return _SomeString;
            }
        }
    }
    

    You can then access these properties exactly the same way, as resource files (I am assuming that you’re used to this style):

    textBox1.Text = GlobalConstants.SomeString;
    textBox1.Top = GlobalConstants.SomeInt;
    

    Maybe it is not the best thing to do, but I firmly believe this is still better than using resource file for that…

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

Sidebar

Related Questions

I have an application that I'm currently building that requires me to display a
I have a Android application that requires a splash screen. I have a simple
I'm building my first application that requires a calendar. I have it working great
I have a C++ application that executes test cases. It is possible that some
I have two distinct databases as a source for a Silverlight RIA application. They
I have a Rails 3 engine gem that is for basic user authentication and
I am in the process of trying to make an app that has most
I am very new to WPF and am trying to set up an application
In Ninject there's automatic implicit self-binding for concrete types. So without further configuration I
Is there any way to create a clickonce deployment where certain assemblies or files

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.