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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:07:02+00:00 2026-05-28T19:07:02+00:00

I had this idea and my first reaction after having it was That’s a

  • 0

I had this idea and my first reaction after having it was “That’s a great idea, but why have I never seen/heard it talked about before??” So I’m hoping you can tell me if there is some framework out there that already does this, or if there is some reason why I should avoid it.

The idea is to create a base business object class with methods to dynamically write CRUD sql queries based on the name of the derived class and its properties (or aliases specified in attributes).

My thinking is that once I do this I could just create a new class like so:

class Customer: BusinessObjectBase
{
    int Id {get;set;}
    string Name {get;set;}
    string Phone {get;set;}
}

and my Customer class, having access to BusinessObjectBase’s CRUD methods, would be done.

Somethings to keep in mind when answering this: For the sake of this question I’m highly interested in the design goals of decreased development time and low maintenance, and security is about a 3 on a scale of 1 to 10. In other words, I’m not interested in hearing answers telling me I should be using stored procedures to access data because they are more secure, or anything along those lines.

I know the users here are pretty liberal with the close votes when it comes to overly broad questions… so just to be safe let me reiterate the question, which is not too broad:

Are there any existing frameworks to do this or is there any compelling reason why I should not?

  • 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-28T19:07:03+00:00Added an answer on May 28, 2026 at 7:07 pm

    It has been done before; many times, many ways. The basic concept your thinking of is called ‘model first’ development. You can do model first in Entity Framework, NHibernate, Subsonic and many other ORM style-frameworks. Another incarnation of this line of thinking is LINQ-to-SQL where LINQ knows what queries to generate, whether or not you have CRUD stored procs.

    Before ORM’s were mainstream we use code files (codified in T4 style templates these days) to write out what your describing. The whole idea was based on ‘convention’ meaning if a field is named ID then it must be the clustered-PK and so on.

    Disclaimer

    With that said, there is a down side to this line of thinking. In your typical web app (or insert your app style here) you have three layers to work with— client, middle, and DB. With model/code-first development you are effectively ignoring one of the three layers. Modern hardware has gotten quick enough that you can do this for most sites. When your site grows in volume & complexity, however, you will often find yourself working around this auto-crud setup for your most complex/frequently-used scenarios.

    Anyway, hope that helps.

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

Sidebar

Related Questions

I had this nasty bug that disappeared in the past but now after quite
So I have this idea that I've had since I started programming. I wanted
I've had this idea of a music project that I want to do. But
I had this working fine yesterday, made some changes and I have no idea
I have this idea that I should switch over from cmd.exe to powershell. It's
I am in the middle of developing an application when I had this idea
I was wondering if anyone had a better idea how to do this. atm
I just got this question on an interview and had no idea how to
Hey guys i had an idea yesterday. Can you help me with this. Here
I had this doubt for sometime now, some people say that there's no such

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.