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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:36:40+00:00 2026-05-28T18:36:40+00:00

I am not too familiar with classes and stuff so I am asking for

  • 0

I am not too familiar with classes and stuff so I am asking for some simple help here.. I’ve got a lot of database functions which I use a lot so I thought I’d put this into a class which I can call from other classes which require data from the database.

For example I’ve got a window that outputs a list of people, I’ve got the same code in the edit person window and I am repeating the same code for both of them.

What class to a I use ? I am very confused. I’ve implemented it as a static class but I wasn’t sure if it was working correctly.

If someone could just give a simple primer on what classes are which I would very much appreciate it.

Thanks

  • 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-28T18:36:40+00:00Added an answer on May 28, 2026 at 6:36 pm

    A static class is basically a dressed up global variable. You don’t create instances of a static class. All the methods must be static and if it holds onto any data, the data fields must be static. This means that all code that uses this class will be using the same data.

    If your intent is to centralize db access pain points like login and session, a static class might be appropriate. Just always keep in mind that calls from different clients will see the same details from the static class.

    A non-static class, or instance, is something that stores different data in each instance. You have to create an object instance of the class before you can do anything with it. The advantage of creating an object is that each consumer that constructs its own instance is isolated from any other consumers of that class. If window A constructs an instance of your db class and does operation abc, and window B constructs its own instance of your db class and does operation xyz, abc and xyz will not cross paths – they do not share any data between them.

    In general, object instances are usually preferred over global/static classes because the shared nature of static classes creates data dependencies and side effects that the consumer may not be aware of.

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

Sidebar

Related Questions

I'm not too familiar with Java and need some help with an enumeration lookup
Not too familiar with GSA here so hopefully someone can help me. Have a
I'm not too familiar with pascal but I got a script going that currently
I am not too familiar with database triggers and/or views. I am currently using
This is some old code that I am not too familiar with : RequiredFieldValidator
I am not too familiar with regex and so I been having some getting
I am not too familiar with regex and hope someone could help. example: This
I'm not too familiar with networking in JAVA but what i'm basically trying to
I am not too familiar with python and have to write a script to
I'm not too familiar with Linux/Bash, so I can't really find the right terms

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.