Tattat
Tattat

Reputation: 15778

How to design a data structure?

I am developing a note taking program for my school project. The note including some drawing and text. It is easy to code with some basic programming skills, but the note is need to be saved and read again. So, that I need a data structure to store the data, and read back the data. What should I do first? How to store it in database? Any recommendations? Thank you.

Upvotes: 0

Views: 154

Answers (3)

Nick Weaver
Nick Weaver

Reputation: 47241

I would even go so far as to save your notes as html, you could embed css in the same file. Don't invent the wheel twice ;)

Upvotes: 0

Ekkehard.Horner
Ekkehard.Horner

Reputation: 38775

Given the nature of your data, I would use XML to store and retrieve the information.


Why not a database: notes are documents, not records/structures

Why not a picture: you probably want to edit the notes

Upvotes: 4

The GiG
The GiG

Reputation: 2611

Make a new table in your database that has the column id (auto increase).

Make a new folder for each id(on insert) that in it you will save the picture(all with the same name and format), and the text(.html).

Then your getPicture(id) will go to the folder id and get the picture, same with the text.

Upvotes: 0

Related Questions