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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:09:19+00:00 2026-05-18T00:09:19+00:00

I have tried to trawl through an amazing amount posts – really valuable, because

  • 0

I have tried to trawl through an amazing amount posts – really valuable, because there are other aspects that you can absorb even though it’s not directly linked to the primary question.

In my case, as the title says, I really want to try to understand the “real world” pros/cons of using static classes/methods for data access.

A little more info of what I am using.

  1. I am using the Patterns/Practices Enterprise Library 5.0 for the data access blocks (and
    caching and so on).

  2. My actual “business object” is a static class, with a static method to say “getContacts”
    in turn that returns say an XML string etc.

So the question really is
Given the structure above, is it “better/more efficient/good practice” to use a static class to return the XML string – again given that I do not need any instance relationship – just a one of “give me the data” and leave.. or is it more accepted to use an instance base class??

I realise the fact there is circumstances for each method, but just trying to get feedback to give me directions to pursue.

Thanks!
David.

  • 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-18T00:09:20+00:00Added an answer on May 18, 2026 at 12:09 am

    Its not a dumb question at all.First I’ll point you to When to Use Static Classes in C#, as there is a lot of great advice there.

    Using when to use a static method/class is really all down to the design of your application.

    Even so, I would feel its better to use instances rather than just static methods for the long term design. If you’re ever going to use any OO concepts in your application, then static methods will limit you straight away. You can generally create a more flexible system using instances etc.

    You also need to be very careful with using static methods in regard to static fields. I’ve seen plenty of examples of developers not understanding exactly what the difference is between a static field and an instance one, and its led to all sorts of problems.

    So, to give you a straight answer, I would think you should try to avoid the static methods if you can, since in the long term, it will pay off by going down the OO route.

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

Sidebar

Related Questions

I have tried SQL Server 2008 Management Studio and other third party tools to
I have a big mysql query which needs to trawl through 4 tables to
I have tried to rewrite my url so that it removes php extention and
I have tried <ul id=contact_list> <li id=phone>Local 604-555-5555</li> <li id=i18l_phone>Toll-Free 1-800-555-5555</li> </ul> with #contact_list
I have tried this... Dim myMatches As String() = System.Text.RegularExpressions.Regex.Split(postRow.Item(Post), \b\#\b) But it is
I have tried what seems like everything - I've done similiar things many times
I have tried the following two statements: SELECT col FROM db.tbl WHERE col (LIKE
I have tried to integrate the Picasa API on iPhone, compiles fine, but I
I have tried to find how to create DLL-s on linux using google, but
I have tried different examples to filter a gridview by dropdownlist, but is it

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.