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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:44:19+00:00 2026-05-23T22:44:19+00:00

In Java, is having ~50 data fields in a class of about 1000 lines

  • 0

In Java, is having ~50 data fields in a class of about 1000 lines a bad thing?

Edit: Thanks for the feedback. Has really opened my eyes and I’ll try to delegate functionality across more classes rather than have a single do-everything class. 🙂

  • 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-23T22:44:20+00:00Added an answer on May 23, 2026 at 10:44 pm

    The question is very vague. The answer can be both yes and no. Yes, it’s a bad thing if you can break the functionality cleanly into more classes. No, it’s not a bad thing if the class is well focused and the only reason you got 50 fields is because you NEED them all there.

    I have, for example, a class of 900 lines with 70 fields, but that’s because the class implements a bit of artificial intelligence and the parameters the AI algorithm uses are a lot of behaviors and thresholds which need to be defined there so that child classes tweak them. In my case, I would say that it’s not a bad architecture, and my 14 years of software development seem to agree ::- ).

    Sure, if the class would go over 1000 lines, I could break it down further into 2: movement AI and attack AI, but for now, it really makes sense in the context of my project to have it together because movement AI and attack AI are never applied independently: they work together, they should be in the same class. If I ever have to make an object which ONLY needs movement AI, then by all means, I’d break it apart into 2.

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

Sidebar

Related Questions

am having problem in Saving some data in my Java code. I have like
What reason is there for C# or java having lambdas? Neither language is based
I'm having a problem using the java.text.MessageFormat object. I'm trying to create SQL insert
I'm having a small problem in Java. I have an interface called Modifiable. Objects
I'm having some trouble navigating Java's rule for inferring generic type parameters. Consider the
I'm having trouble searching for a decent Java library that provides Markov chains, and
I'm having an issue where I've written a Java App that works perfectly on
I've compiled a java project into a Jar file, and am having issues running
I'm working on a simple 2D game engine in Java, and having no trouble
Java has generics and C++ provides a very strong programming model with template s.

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.