1

need your advice what to use... I have a task. Create an application, where u could see the list of current employers, plus buttons remove add employer...

Should I use database or somehow can read just information from file....

1
  • 4
    Do you plan on having 10, 10 thousand or 10 millions employers ? Commented Nov 25, 2010 at 18:13

6 Answers 6

8

If you don't need persistence (information about employers doesn't need to survive between application restarts); keep all employers in memory.

If you've got, let's say, 10000 employers at most, use a text file.

If you've got many more, use sqlite as others have already suggested.

If you've got a few hundred million, use PostgreSQL and a dedicated server if your machine doesn't have enough RAM. Since I really doubt you have that many employers, you can safely skip this step.

Sign up to request clarification or add additional context in comments.

Comments

4

If it's homework, you'll probably be able to get away with just a plaintext file. Database will only complicate your task.

3 Comments

I need windows application, otherwise I could skip it
What does this answer have to do with windows?
You can write a Windows application that holds data in a plaintext file. I don't really understand what the problem is.
2

One of the greatest advice of programming I could give you is K.I.S.S. (Keep It Simple Silly/Stupid).

Don't raise the complexity of the program unless you need to. Use the most simplest approach that merits the application. Darioo's comment sums it up.

For your purposes, if you need to persist your data then use a text file. The C functions fprintf and fscanf are your friends. Or you can use the C++ streaming functions. A homework assignment does not merit use of a database (which adds extra complication) unless its specifically about using a database API (which I doubt).

Hope this helps.

Comments

1

if project small and local you can use sqllite, if it larg you must think for real db

Comments

1

Find and use sqlite.

It is free, easy to use, cross-platform, and gives you a pretty complete SQL implementation.

1 Comment

sounds interesting... will try
1

Should I use database or somehow can read just information from file....

Programming is a trade-off. You can generally optimize for one:

  • Ease of programming
  • Robustness
  • Scalability
  • Cost
  • Ease of installation

Furethermore if you're optimizing for ease-programming, for example, then it also depends on what you have already: do you know how how to program with databases? Do you have a database you can use?

For your application, you might use a combination database-plus-UI like Microsoft Access.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.