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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:10:16+00:00 2026-06-18T03:10:16+00:00

In the following scenario: A form based Windows application written in C# GUI contains

  • 0

In the following scenario:

  • A form based Windows application written in C#
  • GUI contains only interface related code but instantiates a class for functional logic
  • SQL class that stores and loads data from SQL
  • Data classes that store data in a format compatible with the database

I want to load data via the sql class and store it in the data classes. What would be the best way to do it?

  1. The functional class instantiates a SQL class, calls the query function and passes the contained values to a new data class instance using a constructor;
  2. The SQL class contains a function that converts the query to the data class and thus returns the data in the correct format to the functional class;
  3. The Data class contains a method to parse the query result directly so the functional logic only has to call the parse.

Option 1 seems to be the most fitting in this structure. My experience at writing larger applications is rather limited so I’ld like to know how someone with more experience thinks about this.

  • 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-06-18T03:10:17+00:00Added an answer on June 18, 2026 at 3:10 am

    Someone with more experience uses an ORM (object relational mapper) to do this for them.
    Or potentially writes a data access layer that encapsulates the database access and passes data transfer objects to the application code.

    Option 1 feels like the database is bleeding into the application. Separation of concerns is very important in large applications.
    Option 2 sounds like the start of writing your own Data Access Layer.
    Option 3 will pollute the data transfer objects with knowledge of the relational database structure.

    Think very hard about picking up an ORM.
    Entity framework. Nhibernate. Subsonic. Massive. Dapper. There are lots to chose from. The main thing is that this is a problem that has already been solved many times by many developers with a lot of experience. You can leverage their learning and speed up your development.

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

Sidebar

Related Questions

My scenario: Windows Forms Application with a base master (mdi) form. An Interface that
I am trying to use JQuery UI dialog (modal form) for the following scenario.
I'm having a issue with the following scenario on Windows Forms: I created a
Have the following scenario. I have a few form, which essentially have a few
I have the following scenario: I have a PDF document with no form fields.
I have a following scenario <form action= method=> < a href=XXXXX?name=> <textarea rows=3 columns=8
I have the following scenario in MVC2 /VS 2008: A user form with 2
In the following scenario, you have a business object called Employee that contains all
Consider the following scenario. I am clicking the submit button of a JSF form,
Consider the following scenario: My form model public class PersonForm { @NotNull private String

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.