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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:27:58+00:00 2026-05-23T20:27:58+00:00

I know that it is poor programming and architecture when you have a class

  • 0

I know that it is poor programming and architecture when you have a class object that is only to be used in one place. But I’ve also been warned about creating an object that is all powerful and that can do too much. So how do I break this down? Here is an example of what I mean – please don’t take these things literal as this is only an example.

Anyway I have an object that I am working with which is rather complex. A lot of information is stored in this object and it can perform much manipulation on the data. So, let’s call this object Earth.

Public Class Planet
Private _population As UInteger = 0
Public ReadOnly Property Population() As UInteger
    Get
        Return _population
    End Get
End Property

Public Overridable Sub CreatePerson(Optional ByVal numberOfPeople As Integer = 1)
    _population += numberOfPeople
End Sub
End Class

Simple enough so far. But I could go on and on with the many things that object could possibly perform. So, in order to keep things from getting too complex I broke down “activites” that would happen during the day and during the night by creating two other Objects: Day and Night (these two are not shown). So now I have an updated Planet class.

Public Class Planet

Private _population As UInteger = 0

Private _day As New Day
Private _night As New Night

Public ReadOnly Property Day() As Day
    Get
        Return _day
    End Get
End Property

Public ReadOnly Property Night() As Night
    Get
        Return _night
    End Get
End Property

Public ReadOnly Property Population() As UInteger
    Get
        Return _population
    End Get
End Property

Public Overridable Sub CreatePerson(Optional ByVal numberOfPeople As Integer = 1)
    _population += numberOfPeople
End Sub

End Class

Now, these two classes – Day and Night – will never be used outside of the Planet class. Is this a good way to organize my methods and attributes for this “parent” class Planet? How else would I neatly organize similar?

I’ve read about refactoring but I don’t think this helps my case. I like the idea that I can call on an Planet object like this: Earth.Night.BlowUpMoon.

  • 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-23T20:27:59+00:00Added an answer on May 23, 2026 at 8:27 pm

    Think in terms of discoverability. If someone else were to use your object would they know that they have to go to a specific time of day to blow up the moon, which is the same as BirthdayCard.September25th.Send()? Any by “someone else” I also include you in 6 months. Are you organizing for the sake of organizing or are you putting similar methods and properties together in a way that makes sense?

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

Sidebar

Related Questions

I know that |DataDirectory| will resolve to App_Data in an ASP.NET application but is
I know that .NET is JIT compiled to the architecture you are running on
I know that IList is the interface and List is the concrete type but
In SQL Server assuming one has columns that need to have the same data
I am college student (computer science) and have just started a C# programming class.
This is a really irritating problem to have that springs from poor process, I
Actually i have used following two methods for image resize but my client says
I know that I can do something like $int = (int)99; //(int) has a
I know that default cron's behavior is to send normal and error output to
I know that you can insert multiple rows at once, is there a way

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.