Why don't we have a simple data persistence interface?

Status
Not open for further replies.

andrewbb

Member
Joined
Jun 6, 2017
Messages
15
Programming Experience
10+
For example:

Database.Store(object), Load & Delete.
 
I think this has everything.

The SQL script creates 5-6 SP's and a SQL function.

To use:
1. using System.Persistence;
2. Connection string called "Persistence" in Web/App.config
3. Attribute on the class: Persistable[table, primaryKey]

That's it.
 

Attachments

  • Persistence.zip
    33.3 KB · Views: 50
Last edited by a moderator:
15 years ago. 2001.
So it's not .Net?
I think this has everything.

The SQL script creates 5-6 SP's and a SQL function.

To use:
1. using System.Persistence;
2. Connection string called "Persistence" in Web/App.config
3. Attribute on the class: Persistable[table, primaryKey]

That's it.
You claim "No Config" and #2 literally has you using a config, how does that work?

The nice thing about the other methods mentioned (DataSet, Entity Framework) is that they support any data source you can have a connection to, but to keep this question simple does yours work with Access database, Oracle, & MySql? Since Access doesn't support SP's, hopefully you have a work around for that, and only the couple of newest versions of MySql support SP's (no functions yet).
 
It was originally written in Java, ported to VB6, then .NET. It's designed for SQL Server. Plug-ins for Oracle should be simple. It supports direct SQL, so Access and MySql should work, but I didn't design it for Access.

It's designed for serious development of enterprise applications.
 
Last edited:
I didn't know MySql doesn't support SP's. That explains a lot. No wonder we have security problems in IT.
 
Honestly I don't want to be rude but you don't seem to know what you are talking about... The reason people use ORM's like entity framework is that it has all the features you need to abstract your code from the underlying database. You generate a model of your database and work with the generated entities, which means you have intellisense, type information, navigation properties for foreign keys, change tracking, transactions (and rollbacks), etc... If you decide to port your database to a another database engine, you get its EF-compatible database provider and port the database, and then just regenerate the model. And literally all the config it takes is a model you can generate from an existing database in 5 minutes, and a connection string in your app config, which you need anyway. And what does MySql not supporting SP's have to do with security?
 
Honestly I don't want to be rude but you don't seem to know what you are talking about... The reason people use ORM's like entity framework is that it has all the features you need to abstract your code from the underlying database. You generate a model of your database and work with the generated entities, which means you have intellisense, type information, navigation properties for foreign keys, change tracking, transactions (and rollbacks), etc... If you decide to port your database to a another database engine, you get its EF-compatible database provider and port the database, and then just regenerate the model. And literally all the config it takes is a model you can generate from an existing database in 5 minutes, and a connection string in your app config, which you need anyway. And what does MySql not supporting SP's have to do with security?

Herman, did you join the thread just to tell me I'm an idiot? You obviously didn't read a word I wrote.


System.Persistence is more secure and easier to use than all other options. It creates a division between data and application.
 
Last edited:
Add a "Persistence" connection string to your config file and this is the only code:

PersistenceDemoPersonCode.png
 
Status
Not open for further replies.
Back
Top Bottom