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

The Archive Base Latest Questions

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

I have an application that has database connectivity and although there are obviously objects

  • 0

I have an application that has database connectivity and although there are obviously objects that correspond to data in my database, I find that all my data processing methods could be static as there is no real need for an instance of the object as my classes simply operate on the data and spit something out, no need to store anything outside the method’s scope. If I can make a method or class static should I?

Also I use a utility singleton class for common (single instance) “global data”. I want to have a good design, but are these frowned upon?

Let me give you an example of what I’m doing. I load some data from my database using a static method to place it into a global varaiable in my Singleton class (a list of a custom object)

So my singleton class has something like

List<MyCustomObject> SomeList

and my static class has

static void LoadData()
foreach(data in database something or other)
singletonClass.SomeList.Add()

So the code above might load in some records from the database into SomeList, where each item in SomeList is of type MyCustomObject, which contains a single record of information.

Is this good implementation? Is this how you would code it?

Then in my presentation layer I would make calls to another static class of methods to get data from the singleton class in to a format required.

It doesn’t feel very OOPey. But I can’t really think how to do it another way you do it.

  • 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-18T22:51:11+00:00Added an answer on May 18, 2026 at 10:51 pm

    Statics and singletons are frowned upon somewhat. But only the same way as starting a sentence with “but” — bad when overused, but sometimes it’s what works best.

    In your example, why have separate classes, one a singleton and one static? A singleton is in many ways equivalent to a class with only static data and methods. If you already have a singleton, I’d say you should add the methods to load the data to it rather than to a separate class. A class with static methods would be more appropriate if, say, you have utility code common to all of your stored data types.

    (Also, I wouldn’t worry too much about what’s OOPey and what’s not. Overengineering in the blind service of OOP principles can be a serious problem, speaking as someone who’s had to wade through the Eclipse code base …)

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

Sidebar

Related Questions

I have a database that has lots of data and is all neat, normalized
We have an application that has a database full of polygons (currently stored as
I have an application that has a status table see Database best practices -
I have a customer that has an application that uses an Advantage Database. I
I have an application in XCode using the sqlite/coredata database and that has already
I have a web application that has a requirement to take data from an
I have an application that has a Database of vehicles with multiple fields. I
I have an application that has two distinct parts, one operation that process data
I have a PHP application that has grown in size. The database used to
I have an application that stores data in database. I need search functionality to

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.