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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:50:09+00:00 2026-05-11T17:50:09+00:00

I have a Person Class and based on some help I received in this

  • 0

I have a Person Class and based on some help I received in this post.

MonoState, Singleton, or Derived Forms: Best approach for CRUD app?

I have a CurrentPerson class around(??) it and I access the data thru that.

I think I understand how this is supposed to work but it seems that I don’t have it quite right.

Questions:

  1. For starters, shouldn’t Person and all it’s member variables be private?

  2. Why is Person, when declared in CurrentPerson, static? Is that right?

  3. Person actually has child objects Address, Enrollment, and CaseNote. How do I incorporate them? A CurrentEnrollment wrapper around Enrollment?

I am fairly new to OOP as an applied science so some of these concepts are hard for me to visualize.

The code is long, I apologize.


class Person
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
    public string MiddleName { get; set; }
    public string SuffixID { get; set; }
    public string TitleID { get; set; }
    public string SocialSn { get; set; }
    public string Gender { get; set; }
    public string DlNumber { get; set; }
    public string DlStateID { get; set; }
    public string PrimaryRace { get; set; }
    public string SecondaryRace { get; set; }
    public string EmailAddress { get; set; }
    public string MaritalStatus { get; set; }
    public string InsertProgram { get; set; }
    public string InsertUserID { get; set; }
    public string UpdateProgram { get; set; }
    public string UpdateUserID { get; set; }
    public string LockID { get; set; }

    public int PersonID { get; set; }
    public int ClientID { get; set; }
    public int ResidencyCountyID { get; set; }
    public int ResponsibilityCountyID { get; set; }

    public bool HispanicOriginFlag { get; set; }
    public bool CitizenFlag { get; set; }
    public bool VeteranFlag { get; set; }

    public DateTime BirthDate { get; set; }
    public DateTime DeathDate { get; set; }
    public DateTime InsertDateTime { get; set; }
    public DateTime UpdateDateTime { get; set; }



}

class CurrentPerson
{
    public static Person Person { get; set; }

    public string FirstName
    {
        get { return CurrentPerson.Person.FirstName; }
        set { CurrentPerson.Person.FirstName = value; }
    }

    public string LastName
    {
        get { return CurrentPerson.Person.LastName; }
        set { CurrentPerson.Person.LastName = value; }
    }

    public string MiddleName
    {
        get { return CurrentPerson.Person.MiddleName; }
        set { CurrentPerson.Person.MiddleName = value; }
    }

    public string SuffixID
    {
        get { return CurrentPerson.Person.SuffixID; }
        set { CurrentPerson.Person.SuffixID = value; }
    }

    public string TitleID
    {
        get { return CurrentPerson.Person.TitleID; }
        set { CurrentPerson.Person.TitleID = value; }
    }

    public string SocialSn
    {
        get { return CurrentPerson.Person.SocialSn; }
        set { CurrentPerson.Person.SocialSn = value; }
    }

    public string Gender
    {
        get { return CurrentPerson.Person.Gender; }
        set { CurrentPerson.Person.Gender = value; }
    }

    public string DlNumber
    {
        get { return CurrentPerson.Person.DlNumber; }
        set { CurrentPerson.Person.DlNumber = value; }
    }

    public string DlStateID
    {
        get { return CurrentPerson.Person.DlStateID; }
        set { CurrentPerson.Person.DlStateID = value; }
    }

    public string PrimaryRace
    {
        get { return CurrentPerson.Person.PrimaryRace; }
        set { CurrentPerson.Person.PrimaryRace = value; }
    }

    public string SecondaryRace
    {
        get { return CurrentPerson.Person.SecondaryRace; }
        set { CurrentPerson.Person.SecondaryRace = value; }
    }

    public string EmailAddress
    {
        get { return CurrentPerson.Person.EmailAddress; }
        set { CurrentPerson.Person.EmailAddress = value; }
    }

    public string MaritalStatus
    {
        get { return CurrentPerson.Person.MaritalStatus; }
        set { CurrentPerson.Person.MaritalStatus = value; }
    }

    public string InsertProgram
    {
        get { return CurrentPerson.Person.InsertProgram; }
        set { CurrentPerson.Person.InsertProgram = value; }
    }

    public string InsertUserID
    {
        get { return CurrentPerson.Person.InsertUserID; }
        set { CurrentPerson.Person.InsertUserID = value; }
    }

    public string UpdateProgram
    {
        get { return CurrentPerson.Person.UpdateProgram; }
        set { CurrentPerson.Person.UpdateProgram = value; }
    }

    public string UpdateUserID
    {
        get { return CurrentPerson.Person.UpdateUserID; }
        set { CurrentPerson.Person.UpdateUserID = value; }
    }

    public string LockID
    {
        get { return CurrentPerson.Person.LockID; }
        set { CurrentPerson.Person.LockID = value; }
    }

    public int PersonID
    {
        get { return CurrentPerson.Person.PersonID; }
        set { CurrentPerson.Person.PersonID = value; }
    }

    public int ClientID
    {
        get { return CurrentPerson.Person.ClientID; }
        set { CurrentPerson.Person.ClientID = value; }
    }

    public int ResidencyCountyID
    {
        get { return CurrentPerson.Person.ClientID; }
        set { CurrentPerson.Person.ClientID = value; }
    }

    public int ResponsibilityCountyID
    {
        get { return CurrentPerson.Person.ResponsibilityCountyID; }
        set { CurrentPerson.Person.ResponsibilityCountyID = value; }
    }

    public bool HispanicOriginFlag
    {
        get { return CurrentPerson.Person.HispanicOriginFlag; }
        set { CurrentPerson.Person.HispanicOriginFlag = value; }
    }

    public bool CitizenFlag
    {
        get { return CurrentPerson.Person.CitizenFlag; }
        set { CurrentPerson.Person.CitizenFlag = value; }
    }

    public bool VeteranFlag
    {
        get { return CurrentPerson.Person.VeteranFlag; }
        set { CurrentPerson.Person.VeteranFlag = value; }
    }

    public DateTime BirthDate
    {
        get { return CurrentPerson.Person.BirthDate; }
        set { CurrentPerson.Person.BirthDate = value; }
    }

    public DateTime DeathDate
    {
        get { return CurrentPerson.Person.DeathDate; }
        set { CurrentPerson.Person.DeathDate = value; }
    }

    public DateTime InsertDateTime
    {
        get { return CurrentPerson.Person.InsertDateTime; }
        set { CurrentPerson.Person.InsertDateTime = value; }
    }

    public DateTime UpdateDateTime
    {
        get { return CurrentPerson.Person.UpdateDateTime; }
        set { CurrentPerson.Person.UpdateDateTime = value; }
    }


}

P.S. If Daniel Brückner happens to read this please take no offense as I am not second guessing your answer; I just need deeper clarification on some items in order to properly understand the use of monostate in my app.

  • 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-11T17:50:10+00:00Added an answer on May 11, 2026 at 5:50 pm

    Regarding whether the fields should be private, that’s just the new (C# 3.0?) way of declaring properties without having a backing variable. A common variation is

    public string SomeProperty { get; protected set }
    

    ‘Course, as soon as you want to do something like validation in the setter this doesn’t work and you have to go back to writing setters and getters, and declaring a backing variable.

    I’m not sure what the intent of the static CurrentPerson.Person() method is, or how it gets set.

    For the third question, if I understand you right you’d give the Person class a property of type Address and access it something like this:

    Console.WriteLine(somePerson.HomeAddress.City);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class Person which can have several Homes, each one with one
Here is the domain that I wish to have: public class Person { public
I have a Struts + Velocity structure like for example, a Person class, whose
I have the following classes: public class Person { public String FirstName { set;
For example I have a simple class like public class Person{ public int Age
Say I have a .NET class like so: public class Person { public string
I have models (simplified example): class Group(models.Model): name = models.CharField(max_length = 32) class Person(models.Model):
Let's say I have a class Person with properties name and age , and
Let's say I have the following two classes: public class Person { public string
(pardon the noob question in advance) I have 4 classes: class Person {}; class

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.