Ali Essa
Ali Essa

Reputation: 29

Saving data in C#

I'm designing a banking system and I reached the step where I want to store the account's info so I can retrieve it easily when I close the system.

How can I store it? Should I use threads here or it is the time to use databases and linking the classes with a database?

Upvotes: 0

Views: 134

Answers (2)

Eric J.
Eric J.

Reputation: 150198

If you are designing a banking system, you need to have a thorough understanding of transactional integrity.

For example:

If you move money from one account to another, you do at least two steps

  1. Deduct money from one account
  2. Add that money to another account

It would be a very bad result if you completed Step 1 and then your program failed for some reason before completing Step 2.

Read about and fully understand transactions before proceeding.

Having said that...

Entity Framework provides a nice level of abstraction for data storage and allows you to manage database transactions. I suggest you look into that technology, along with how to use database transactions with Entity Framework.

Upvotes: 3

Dr. Rajesh Rolen
Dr. Rajesh Rolen

Reputation: 14285

Create a database in sql server or oracle... Use Entity framework for data manipulation. i will recommend you to create WCF service (which will do your all db transactions) and use that wcf service in your application.

If you wants to make your application better then i would suggest to use Dependency Injection (structuremap , ninject or any other such..) .. it will help you to make your code clean, maintainable and testable..

Upvotes: 1

Related Questions