Clinica1 - AlbertProfe/Java_AppWeb_Spring_2021 GitHub Wiki

Clinica1

Now we are going to add some complexity, so we will have got 10 classes. Two branches of inherence: student and employee, under employee we will be got two more classes: teacher and doctor.

Test got two more static methods to test: testObjectsStudent and testUtilitiesInherence and a new Utilities class with three new utilities: printList, printListExtended and printListExtendedClassicArray

public static void testObjectsStudent()

let's create and test some student and Course Objects and add these courses to that student at courses ArrayList student's field

public static void testUtilitiesInherence()

let's create and test the inherence structure person > student and person > employee and create new Class Utilities to home print utilities so we may study how array Person got all kind of objects

  1. Clinica.java
  2. Course.java
  3. Employee.java
  4. MainApplication.java
  5. MyDate.java
  6. Person.java
  7. Student.java
  8. Teacher.java
  9. Test.java
  10. Utilities.java

Basic model

Just inherence with two branches: student / employee Clinica1.1

Simple model

Just inherence with two branches and one more deep level from employee: student / employee-teacher Clinica1.1.1

Linked model

With courses that link employee-teacher and student (we will study next weeks many-to-many relationships) Clinica1

public Class Utilities

We also create a Utilities Class just to be able to store and be called static methods that solve particular situations like printing arrays. These static methods will be reusable from many spots of the program many times as we need.

Utilities Class

Utlities