I'm working on School Management System using Java and database.

I have classes like: personBase, student, teacher, subject. The are base classes. Now i have to create few more, like specialization and others that I will invent later.
My biggest problem for now is to connect these classes to each other.
For example:
- Student should have subjects that he claim to learn and in each of subject he should have grades,
-subject should had teacher that will led it.
-specialization should have students, years etc.

I am capable to do what's above, to write it in java, but I can't think hard enough to organise it's structure, how it should be done, connected.
Sorry if my post is quite of mess, but I tried to explained it as clear as I could.

Thanks for help in advance.

1 Answers

0
Bentaye On

When you have a definition such as Object1 has a Object2, then we are talking about Composition.

Lookup articles about Composition, such as this one

https://www.c-sharpcorner.com/UploadFile/3614a6/is-a-and-has-a-relationship-in-java/

It is a very common topic and you should be able to find loads of examples.