Friday, September 24, 2004

Object oriented programming - Example 1 continued...

Ok, So, there could be following questions that one auditor for school could be interested in knowing.
How many teachers are there in St. Thomas school?
How many students are there in St. Thomas school?

Well, the same auditor could be sent to some college. So, he would be interested in knowing following:

how many teachers (including professors, associate professors, lecturers ) are there in JNTU, college?
How many students are there in JNTU college?

What are we approaching towards?

Did you observe some pattern?

1. Educational institution such as School/College
2. Teachers who could be professor, associate professor, lecturer
3. Student

I am eager to say that we have come down to three imprtant classes. They are following:
1. EducationalInstitution
2. Teacher
3. Student

There are following inheritance relationships:
School, college inheriting from EducationalInstitution
Professor, associate professor, lecturer inheriting from Teacher

Base classes: EducationalInstitution, Teacher, Student

Whethar they should be abstract would be discussed a bit later.

The beauty of object oriented programming lies in the fact that it makes the problem really scalable, extensible and easily maintainable.

0 Comments:

Post a Comment

<< Home