Tutor HuntResources Java Resources

Java`s Oop & Ooad (object-oriented Programming & Object-oriented Analysis And Design)

Java`s Object-oriented programming & Object-oriented analysis and design

Date : 27/11/2013

Author Information

Muhammad

Uploaded by : Muhammad
Uploaded on : 27/11/2013
Subject : Java

Understanding Java`s Object-Oriented Programming (OOP)

Java is object-oriented. What does that mean? Unlike languages, such as FORTRAN, which focus on giving the computer imperative "Do this/Do that" commands, object-oriented languages focus on data. Of course, object-oriented programs still tell the computer what to do. They start, however, by organizing the data, and the commands come later.

Object-oriented languages are better than "Do this/Do that" languages because they organize data in a way that lets people do all kinds of things with it. To modify the data, you can build on what you already have, rather than scrap everything you`ve done and start over each time you need to do something new. Although computer programmers are generally smart people, they took awhile to figure this out. Objects and their classes

In an object-oriented language, you use objects and classes to organize your data.

Imagine that you`re writing a computer program to keep track of the houses in a new condominium development (still under construction). The houses differ only slightly from one another. Each house has a distinctive siding color, an indoor paint color, a kitchen cabinet style, and so on. In your object-oriented computer program, each house is an object.

But objects aren`t the whole story. Although the houses differ slightly from one another, all the houses share the same list of characteristics. For instance, each house has a characteristic known as siding color. Each house has another characteristic known as kitchen cabinet style. In your object-oriented program, you need a master list containing all the characteristics that a house object can possess. This master list of characteristics is called a class.

So there you have it. Object-oriented programming is misnamed. It should really be called "programming with classes and objects."

Notice that the word classes was listed first? Think again about a housing development that`s under construction. Somewhere on the lot, in a rickety trailer parked on bare dirt, is a master list of characteristics known as a blueprint. An architect`s blueprint is like an object-oriented programmer`s class. A blueprint is a list of characteristics that each house will have. The blueprint says, "siding." The actual house object has gray siding. The blueprint says, "kitchen cabinet." The actual house object has Louis XIV kitchen cabinets.

A year after you create the blueprint, you use it to build ten houses. It`s the same with classes and objects. First, the programmer writes code to describe a class. Then when the program runs, the computer creates objects from the (blueprint) class.

This resource was uploaded by: Muhammad