• Complain

Grey - Turbo Pascal: object oriented programming guide

Here you can read online Grey - Turbo Pascal: object oriented programming guide full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2021, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

No cover
  • Book:
    Turbo Pascal: object oriented programming guide
  • Author:
  • Genre:
  • Year:
    2021
  • Rating:
    3 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 60
    • 1
    • 2
    • 3
    • 4
    • 5

Turbo Pascal: object oriented programming guide: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Turbo Pascal: object oriented programming guide" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Turbo Pascal: object oriented programming guide — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Turbo Pascal: object oriented programming guide" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make

Turbo Pascal Object Oriented Programming

Dean Grey


c H A


p T E R

All about OOP Object-oriented programming is a method of programming that - photo 1


All about OOP

Object-oriented programming is a method of programming that closely mimics the way all of us get things done. It is a natural evolution from earlier innovations to programming language design: It is more structured than previous attempts at structured programming; and it is more modular and abstract than previous attempts at data abstraction and detail hiding. Three main properties characterize an object-oriented programming language.

Encapsulation : Combining a record with the procedures and functions that manipulate it to form a new data type: an object.

Inheritance: Defining an object and then using it to build a hierarchy of descendant objects, with each descendant inheriting access to all its ancestors' code and data.

Polymorphism: Giving an action one name that is shared up and down an object hierarchy, with each object in the hierarchy implementing the action in a way appropriate to itself.

Turbo Pascal S.S's language extensions give you the full power of object-oriented programming: more structure and modularity, more abstraction, and reusability built right into the language. All these features add up to code that is more structured, extensible, and easy to maintain.

The challenge of object-oriented programming (OOP) is that it sometimes requires you to set aside habits and ways of thinking about programming that havebeen considered standard for many years. Once that is done, however, OOP is simple, straight-

forward, and superior for solving many of the problems that plague traditional software programs.

A note to you who have done object-oriented programming in other languages: Put aside your previous impressions of OOP and learn Turbo Pascal 5.5' s object-oriented features on their own terms. OOP is not one single way; it is a continuum of ideas. In its object philosophy, Turbo Pascal 5.5 is more like C++ than Smalltalk. Smalltalk is an interpreter, while from the beginning, Turbo

Pascal has been a pure native code compiler. Native code compilers do things differently (and far more quickly) than interpreters. Turbo Pascal was designed to be a production development tool, not a research tool.

And a note to you who haven't any notion at all what OOP is about: That's just as well. Too much hype, too much confusion, and too many people talking about something they don't understand have greatly muddied the waters in the last year or so. Strive to forget what people have told you about OOP. The best way (in fact, the only way) to learn anything useful about OOP is to do what you're about to do: Sit down and try it yourself.

Objects Objects keep all their characteristics and behavior together - photo 2 Objects?


Objects keep all their characteristics and behavior

together.


Yes, objects. Look around you ... there's one: the apple you brought in for lunch. Suppose you were going to describe an apple in soft ware terms. The first thing you might be tempted to do is pull it apart: Let S represent the area of the skin; let J represent the fluid

volume of juice it contains; let F represent the weight of fruit inside; let D represent the number of seeds ....

Don't think that way. Think like a painter. You see an apple, and you paint an apple. The picture of an apple is not an apple; it's just a symbol on a flat surface. But it hasn't been abstracted into seven numbers, all standing alone and independent in a data segment somewhere. Its components remain together, in their essential relationships to one another.

Objects model the characteristics and behavior of the elements of the world we live in. They are the ultimate data abstraction (so far).

An apple can be pulled apart, but once it's been pulled apart it's not an apple anymore. The relationships of the parts to the whole and to one another are plainer when everything is kept together

in one wrapper. This is called encapsulation, and it's very important. We'll return to encapsulation in a little while.

Of equal importance is the fact that objects can inherit characteristics and behavior from what we call ancestor objects. This is an intuitive leap; inheritance is perhaps the single biggest difference between object-oriented Pascal and Turbo Pascal pro gramming today.

Inheritance Figure 11 A partial taxonomy chart of insects The goal - photo 3 Inheritance


Figure 1.1

A partial taxonomy chart of

insects


The goal of science is to describe the workings of the universe. Much of the work of science, in furthering that goal, is simply the creation of family trees. When entomologists return from the Amazon with a previously unknown insect in a jar, their funda mental concern is working out where that insect fits into the giant chart upon which the scientific names of all other insects are gathered. There are similar charts of plants, fish, mammals, rep tiles, chemical elements, subatomic particles, and external galaxies. They all look like family trees: a single overall category

at the top, with an increasing number of categories beneath that

single category, fanning out to the limits of diversity.

Within the category insect for example there are two divisions insects with - photo 4 Within the category insect, for example, there are two divisions: insects with visible wings, and insects with hidden wings or no wings at all. Under winged insects is a larger number of cat e gories: moths, butterflies, flies, and so on. Each category has numerous subcategories, and beneath those subcategories are even more subcategories (see Figure 1.1).

This classification process is called taxonomy. It's a good starting metaphor for the inheritance mechanism of object-oriented programming.

The questions that a scientist asks in trying to classify some new animal or object are these: How is it similar to the others of its general class? How is it different? Each different class has a set of behaviors and characteristics that define it. A scientist begins at the top of a specimen's family tree and starts descending the branches, asking those questions along the way. The highest levels are the most general, and the questions the simplest: Wings or no wings? Each level is more specific than the one before it, and less general. Eventually the scientist gets to the point of counting hairs on the third segment of the insect's hind legs-specific indeed. (And a good reason, perhaps, not to be an entomologist.)

The important point to remember is that once a characteristic is defined, all the categories beneath that definition include that char acteristic. So once you identify an insect as a member of the order diptera (flies) , you needn't make the point again that a fly has one pair of wings. The species of insect we call flies inherits that characteristic from its order.

As you'll learn shortly, object-oriented programming is very

much the process of building family trees for data structures. One

of the important things object-oriented programming adds to traditional languages like Pascal is a mechanism for data types to inherit characteristics from simpler, more general types. This mechanism is inheritance.

Objects record s that inherit In Pascal terms an object is very much like a - photo 5 Objects: record s that inherit

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Turbo Pascal: object oriented programming guide»

Look at similar books to Turbo Pascal: object oriented programming guide. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Turbo Pascal: object oriented programming guide»

Discussion, reviews of the book Turbo Pascal: object oriented programming guide and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.