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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:50:13+00:00 2026-05-23T09:50:13+00:00

Possible Duplicate: Efficient way to implement singleton pattern in Java I have a singleton

  • 0

Possible Duplicate:
Efficient way to implement singleton pattern in Java

I have a singleton class that acts as a state saver for my application. For instance if I have a view that has some data, I just pacakge the data to a saved state serializable object and pass it to my singleton for retrival later. This all seems natural and proper, but I have deviated from the singleton example on Wiki. Intead of having a get instance method that will let me retrieve the instance and call methods though the instance, I instead just set every method to static and use the class statically.

Is this bad form? Is there a performance lose?

Thanks for any tips ~Aedon

  • 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-23T09:50:14+00:00Added an answer on May 23, 2026 at 9:50 am

    If static use fulfills your needs, I don’t see any evil in it.

    The only downside is that it’s slightly less flexible. If you designed it as an actual singleton, you could have an interface for managing state, and instantiate a particular implementation for a specific situation. This object could then be passed into your application as an argument.

    Using a strictly static class, there’s not object to pass, so you’d have to resort to passing around Class objects and accessing the functions through that interface.

    Of course, all of that only matters if there’s any chance this would ever expand beyond the reasonable capabilities of your current class.

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

Sidebar

Related Questions

Possible Duplicate: Efficient way to implement singleton pattern in Java I was reading this
Possible Duplicate: The most efficient way to implement an integer based power function pow(int,
Possible Duplicate: Implement Stack using Two Queues I want the most efficient way in
Possible Duplicate: More efficient way of updating UI from Service than intents? I have
Possible Duplicate: The most efficient way to implement an integer based power function pow(int,
Possible Duplicate: Most efficient implementation of a large number class Suppose I needed to
Possible Duplicate: .NET - What’s the best way to implement a catch all exceptions
Possible Duplicate: What is the most efficient way to clone a JavaScript object? I
Possible Duplicate: What is the most efficient way to clone a JavaScript object? How
Possible Duplicate: Efficient way to test string for certain words I want to check

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.