Set up your document database

If you've followed the steps before, you are now ready to implement your document database.

A good example to demonstrate the implementation and usage of a document oriented model could be a university database with all its students, professors, lectures, maybe other persons like facility management, exams, rooms and so on.

Therefore, we've decided to show you some steps to implement such a database and test it with our provided code.

Main focus at a university lays on education. For education, we need professors. Professors are holding lectures for students in different subjects. Hence students are taking the courses. Each professor has an identification number, so has a student.

Hence it is obvious to declare a superclass called 'Person' with the main properties for each person at a university. Each subclass of 'Person' inherits properties, but there could be also an addition of extra properties for each subclass.

Class
Person Name Surname Birthday Picture Number

Special case in document databases is the fourth field 'Picture'. It is possible to load any type of binary data into a document database. Like pictures, copies of exams, certificates and so on. Also it is possible to store music files, videos or so. But this does not make sense in our case.

After that, we need our subclasses 'Professor' and 'Student'.

Class
Professor Name Surname Birthday Picture Number

'Professor' only inherits all properties of 'Person' for the moment. You are free to think about other properties!

Class
Student Name Surname Birthday Picture Number Courses taken

A Student takes courses in regular. Hence our class 'Student' gets an additional property for her/his courses, which will be references to our next class 'Lecture'.

Class
Lecture Name Number Credits Lecturer

The class 'Lecture' should contain a property with links/references to a professor which holds the lecture.

Now that we've done the theoretical part of the architecture of our database, we finally can start coding. Yea!

results matching ""

    No results matching ""