80 likes | 203 Views
Payilagam provides excellent Job Oriented Java training in Chennai. to know more, please visit www.payilagam.com
E N D
Core Java - Introduction OBJECT ORIENTATION
Attending Class – An Example I have a problem to solve • I am teaching this class • After you finished with my class, you have another to attend • You do not know where that class is located • I must make sure you know how to get to your next class www.payilagam.com
The Functional Approach • A functional solution to the problem • Get list of people in class • For each person on the list • Determine next class they need to attend • Determine location of the class • Formulate directions from my class to the next class • Tell the person the instructions • Implementing this approach would require • A procedure to get the list of people • A procedure to get each person’s schedule • A program to give directions • A controlling program to execute these functions for each person www.payilagam.com
An Alternative • An alternative solution • Post directions to classroom locations on the wall • Tell people in class where directions are and to go to their next class • Implementing this approach would require • People that • Know how to read directions • With directions, can get to next class • A control program to • Post the instructions and tell people that class is over • Implementing this approach would require • With the functional approach • The Control program is responsible for everything • With this alternative, students are responsible for themselves www.payilagam.com
How Does It work? • People are responsible for themselves • They do their own work • They know what type of person they are • Control Program • Communicates with all people as if they are the same • Does not care how people get from one class to another • Does not care if people need to take special steps www.payilagam.com
Object Orientation • Objects are responsible for themselves • Objects tell each other to do things at a conceptual level • Objects • State, • Behaviour • REAL TIME ENTITY www.payilagam.com