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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:55:55+00:00 2026-05-24T21:55:55+00:00

While learning c#, I have picked up the implication from reading other people’s code

  • 0

While learning c#, I have picked up the implication from reading other people’s code that it’s good practice to separate certain classes from the program by use of a sort of “Proxy Class”. Namely those programs with private data.

For instance, say I have database class that performs just about all of my database interactions. It has both a “Send data” and “Read Data” method.

What I also have is a Manager class, in which I have placed a private instance of the Database class. In this Manager class, I have also included a “Read Data from Database” and “Send Data to Database” method. All these do is accept the required parameters and use them to run the Database’s Read/Write methods.

Other than a few misc methods whose code could easily be run from elsewhere, Manager’s only purpose’s to act as a messenger between the program and the Database class to prevent Database from needing to be instantiated directly in the form.

Am I on the right track here or am I just creating more work for myself by not simply creating a Database object in the form and running everything directly from there?

  • 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-24T21:55:56+00:00Added an answer on May 24, 2026 at 9:55 pm

    I’m with John Saunders on this – you’re using the class in some realm of “correctness”, but not for a real purpose.

    As described in your example, a proxy class is used as an abstraction. Your executing code doesn’t need to know anything about the data source – it just submits a request for data and gets data back as a response. The proxy hides this implementation detail from you – it could retrieve the data from a flat file, a database, a web service; it really doesn’t matter. This makes your code more flexible because it’s not tied to a specific database implementation, and it also makes it testable because you can inject some other class in there that provides test (“mock”) data.

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

Sidebar

Related Questions

While learning Sitecore I have found that the majority of Sitecore sample code on
query level: beginner As part of a learning exercise I have written code that
I have been learning python for some time now. While starting this learning python
I have been learning Python for a while, and now I'd like to learn
I have been learning to use Emacs for a little while now. So far
Have you ever tried learning a language while on a project? I have, and
I am beginner to freeswitch.While learning this I have seen the terms 'leg A'
I am trying to program (while learning JQuery) the following: I have a form
I have had to start to learning C as part of a project that
Have run into jquery question while learning ajax. $('div_hello'); --> answers an 'Object' document.getElementById('div_hello');

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.