Technical condition of the object. Object-oriented programming (OOP) and design


In addition to the name in a message about an object, a person can list it in detail signs: properties, actions, behavior, state.

Properties objects answers the questions: “How can one object differ from another?”, “What can change for an object when performing an action?” For example, dogs may differ from each other in color, cities – in population, rivers – in length; When editing a document, its size may decrease; when water is heated, its temperature increases.

Each property is determined by some size and so meaning which she accepts. Examples of quantities: color, material, shape, length. Examples of values: red, iron, rectangular, 2m.

In table 1.1 shows objects, their properties, as well as quantities and values ​​of quantities corresponding to these properties.

An object's capabilities are indicated by names actions, answering the questions “What can he do?” (active action) or “What can be done with it?” (passive action). In other words, action names denote processes that can occur with an object. For example, a Dalmatian runs, the operating system controls the operation of the computer, a balloon can be inflated, a file can be renamed, modified, deleted, etc.

To describe the behavior of an object, you need not just name the names of the actions, but create a step-by-step description of each action characteristic of this object. Without this, information about the object will be incomplete. After all, different objects can perform an action with the same name in different ways. For example, birds, balloons and helicopters fly differently, and people perform the action of “building” differently with houses, bridges and tunnels.

Table 1.1

Talking about condition object, a person names or implies a certain combination of values ​​of all or some properties of this object. For example, by good weather a person can understand a certain air temperature (warm), the absence of strong wind (quiet) and precipitation (sunny). When an action is performed on an object, its state changes. For example, with a balloon you can associate the following values: “volume” (in liters), “height” (in meters above the ground) and “damage” (presence of holes). When a balloon is inflated, its volume changes. During the flight of the ball, the height at which it is located will increase. And when the ball bursts and falls, the values ​​of all three quantities will change at once.

All objects that the computer works with (programs, documents, folders, disks, etc.) are displayed on the screen small pictures- icons. Descriptions of these objects can be easily obtained using context menu(open it by right-clicking on the object icon). The context menu lists all the actions that can be performed with an object. For example, a document can be opened, scanned for viruses, renamed, copied, sent by mail, or deleted. The last item in the context menu of any object is called Properties. With its help, you can not only find out the properties of an object, but also change some of them.

i Briefly about the main thing

In a message about an object, a person can describe its characteristics - properties, actions, behavior, state.

Properties of objects answer the questions: “How can one object differ from another?”, “What can change for an object when performing an action?” Each property is determined by a quantity and the value it takes. Values ​​of quantities are expressed in numbers or words.

An object's capabilities are indicated by action names that answer the questions "What can it do?" (active action) or “What can be done with it?” (passive action).

To describe the behavior of an object, you need not just name the names of the actions, but create a step-by-step description of each action characteristic of this object.

Speaking about the state of an object, a person names or implies a certain combination of values ​​of all or some properties of this object.

Questions and tasks

1. Should all properties of an object be given in each specific situation? Give examples.

2. What properties can be given when describing a set of objects? Is it possible to give values ​​of quantities for many objects? Give examples.

3. How can you find out the properties of the objects you are interested in?

4. Name the properties operating system Windows "Desktop".

5. For the properties of each of the listed objects, specify the value and value.

6. What actions can be performed with the “file” and “folder” objects?

7. One of the actions in the context menu of the operating room object Windows systems always in bold. What action is this? Why was it chosen? How can I perform this action without a context menu?

8. As you know, actions on the main objects of the Windows operating system can be performed in several ways:

1) using menu bar commands;

2) using toolbar buttons that duplicate menu commands;

3) using context menu commands;

4) using the “Drag&Drop” technology.

Why do you think so many methods are needed? Why didn't the developers give preference to one of them?

9. For each of the given actions, name two objects with which a person performs the specified action differently:

a) collect;

b) fill out;

c) open;

d) tie;

e) turn on;

f) fold;

g) measure;

h) catch.

10. Give examples of possible active and passive actions for the objects “bird”, “ball”, “bicycle”.

11. Give examples step-by-step descriptions human actions. What are they called?

12. Answer the following questions.

a) What value determines the transition of the kettle to the “boiling” state?

B) what state is the water in if it cannot be poured out of the kettle?

c) What condition is the pencil in if you cannot write or draw anything with it?

d) What state is an apple slice in if it can be bent without breaking?

1. Objects. Names. Signs of objects.(7 grades)

Objects are usually called everything that a person’s attention is drawn to. In other words, an object- this is any part of the surrounding reality (object, process, phenomenon), perceived by a person as a single whole.

So, telephone, table, book, cat - examples objects-subjects. Vacations, study, reading, travel - examples process objects. Thunderstorm, solar eclipse, snowfall - examples objects-phenomena.

Each object has a name that allows it to be distinguished from other objects. The person names the object when answering the question “What is it?” or “Who is this?”

For example, a dog is an object real world, pet. In our consciousness it is reflected in the form concepts"dog". A concept is an expressed as a separate word or a phrase, the idea of ​​the main and distinctive features of one object or many similar objects.

When communicating, people convey to each other a wide variety of information about real and imaginary objects using concepts, designating objects with names - words of language. But in different situations the same object can receive different names. For example, a dog can be called Kashtanka, a doggie, or simply an animal. How do these names differ and what determines the choice of one name or another?

Object names can be general, specific and personal (personal). Common names represent many objects. Own (personal) names designate one specific object in a certain set. For example, “Kashtanka” is a proper name, and “dog” is a common name. Specific and proper names can consist of several words. For example, “tree” is a general name, “birch tree” is a specific name, “a young birch tree under my window” is a proper name.

In addition to the name in a message about an object, a person can list it in detail signs: properties, actions, behavior, states.

Properties objects answer the questions: “How can one object differ from another?”, “What can change for an object when performing an action?” For example, dogs may differ from each other in color, cities - in population, rivers - in length; When editing a document, its size may decrease; when water is heated, its temperature increases.

Each property is determined by some size and so meaning, which she accepts. Examples of quantities: color, material, shape, length. Examples of values: red, iron, rectangular, 2m.

Object capabilities are indicated by action names that answer the questions “What can it do?” (active action) or “What can you do with it?” (passive action). In other words, names actions processes that can occur with an object are indicated. For example, the operating system controls the operation of the computer, a balloon can be inflated, a file can be renamed, modified, deleted, etc.

To describe behavior object, you need not just name the names of the actions, but create a step-by-step description of each action characteristic of this object. Without this, information about the object will be incomplete. After all, different objects can perform an action with the same name in different ways. For example, birds, hot air balloons and helicopters fly differently, and a person performs the action of “building” differently with houses, bridges and tunnels.

Talking about condition object, a person names or implies a certain combination of values ​​of all or some properties of this object. For example, by good weather a person can understand a certain air temperature (warm), the absence of strong wind (quiet) and precipitation (sunny). When an action is performed on an object, its state changes. For example, with a balloon you can associate the following values: “volume” (in liters), “height” (in meters above the ground) and “damage” (presence of holes). When a balloon is inflated, its volume changes. During the flight of the ball, the height at which it is located will increase. And when the ball bursts and falls, the values ​​of all three quantities will change at once.

Signs may be significant And insignificant. Essential - that is, important in a given situation, main. By essential features one can distinguish one object from another. For example, in order to distinguish a triangle from other geometric figures, the essential features are that it has three angles, three vertices and three sides connecting these vertices, while color and size are unimportant. The definition of an object is based on its essential properties. For example, “A triangle is geometric figure, consisting of three points(the vertices of the triangle) and three segments connecting these points in pairs (the sides of the triangle).

If several objects have the same property, then it is called general. Common properties help group objects together. Distinctive the same properties help to distinguish one object from another. Only one object in the group in question has them.

Thus, in order to describe (characterize) an object, it is necessary to name its name, purpose and properties.

All objects that the computer works with (programs, documents, folders, disks, etc.) are depicted on the screen with small pictures - icons (pictograms, icons). Descriptions of these objects can be easily obtained using the context menu (open it by clicking right click mouse on the object icon). The context menu lists all the actions that can be performed with an object. For example, a document can be opened, scanned for viruses, renamed, copied, sent by mail, deleted. The last item in the context menu of any object is called Properties. With its help, you can not only find out the properties of an object, but also change some of them.

Control questions:

1. What is an object? Give examples of objects, phenomena, processes.

2. What is a concept? Give examples of concepts.

3. Give your own examples of common and proper names.

4. What do you know about the characteristics of objects?

5. How are the properties of objects characterized?

6. How to describe the state of an object?

7. Which features are called essential and which are unimportant and what are they used for?

8. Which properties are called common and which are distinctive?

9. What do you know about computer objects?

10. Is it possible to get an idea of ​​its capabilities by the name of an object?

11. Should all properties be given in each specific situation?

>> Features of objects

§ 1.2. Features of objects

In addition to the name in a message about an object, a person can list in detail its characteristics: properties, actions, behavior, states.

Object Properties answer the questions: “How can one object differ from another?”, “What can change for an object when performing an action?” For example, dogs may differ from each other in color, cities - in population, rivers - in length; When editing a document, its size may decrease; when water is heated, its temperature increases.

Each property is determined by a certain quantity and the value it takes. Examples of quantities: color, material, shape, length. Examples of values: red, iron, rectangular, 2 m.

In table 1.1 shows objects, their properties, as well as quantities and values ​​of quantities corresponding to these properties.

Table 1.1

An object's capabilities are indicated by action names that answer the questions "What can it do?" (active action) or “What can you do with it?” (passive action). In other words, action names denote processes that can occur with an object. For example, a Dalmatian runs, the operating system controls the work computer, the balloon can be inflated, the file can be renamed, modified, deleted, etc.

To describe behavior an object Well, you need to not just name the names of the actions, but create a step-by-step description of each action characteristic of this object.

Without this, the information about the object will be incomplete. After all, different objects can perform an action with the same name in different ways. For example, birds, hot air balloons and helicopters fly differently, and a person performs the action of “building” differently with houses, bridges and tunnels.

Speaking about the state of an object, a person names or implies a certain combination of meanings of all or some properties of this object. For example, by good weather a person can understand a certain air temperature (warm), the absence of strong wind (quiet) and precipitation (sunny). When an action is performed on an object, its state changes. For example, with a balloon you can associate the following values: “volume” (in liters), “height” (in meters above the ground) and “damage” (presence of holes). When a balloon is inflated, its volume changes. During the flight of the ball, the height at which it is located will increase. And when the ball bursts and falls, the values ​​of all three quantities will change at once.

All objects that the computer works with ( programs, documents, folders, disks, etc.) are displayed on the screen with small pictures - icons. Descriptions of these objects can be easily obtained using the context menu (open by right-clicking mice on the object icon). The context menu lists all the actions that can be performed with an object. For example, a document can be opened, scanned for viruses, renamed, copied, sent by mail, or deleted. The last item in the context menu of any object is called Properties. With its help, you can not only find out the properties of an object, but also change some of them.

Briefly about the main thing

In a message about an object, a person can describe its characteristics - properties, actions, behavior, states.

Properties of objects answer the questions: “How can one object differ from another?”, “What can change for an object when performing an action?” Each property is determined by a quantity and the value it takes. Values ​​of quantities are expressed in numbers or words.

An object's capabilities are indicated by action names that answer the questions "What can it do?" (active action) or “What can you do with it?” (passive action).

To describe the behavior of an object, you need not just name the names of the actions, but create a step-by-step description of each action characteristic of this object.

Speaking about the state of an object, a person names or implies a certain combination of meanings of all or some properties of this object.

Questions and tasks

1. Should all properties of an object be given in each specific situation? Give examples.
2. What properties can be given when describing a set of objects? Is it possible to give values ​​of quantities for many objects? Give examples.
3. How can you find out the properties of the objects you are interested in?
4. Name the properties of the Windows operating system object “Desktop”.
5. For the properties of each of the given objects, specify the value and value.

6. What actions can be performed with the “file” and “folder” objects?

7. One of the actions in the context menu of a Windows operating system object is always highlighted in bold. What action is this? Why was it chosen? How can I perform this action without a context menu?

8. As you know, actions on the main objects of the Windows operating system can be performed in several ways:

1) using menu bar commands;
2) using toolbar buttons that duplicate menu commands;
3) using context menu commands;
4) using the “Drag&Drop” technology.

Why do you think so many methods are needed? Why didn't the developers give preference to one of them?

9. For each of the given actions, name two objects with which a person performs the specified action differently:

a) collect;
b) fill out;
c) open;
d) tie;
e) turn on;
f) fold;
g) measure;
h) catch.

10. Give examples of possible active and passive actions for the objects “bird”, “ball”, “bicycle”.

11. Give examples of step-by-step descriptions of human actions. What are they called?

12. Answer the following questions.

a) What value determines the transition of the kettle to the “boiling” state?
b) What state is the water in if it cannot be poured out of the cup?
c) What state is the pencil in when it is impossible to write or draw anything with it?
d) What state is an apple slice in if it can be bent without breaking?

Bosova L. L., Computer Science and ICT: textbook for grade 7 by L. L. Bosova. M.: BINOM. Knowledge Laboratory, 2010. 229 p. : ill.

Lesson content lesson notes supporting frame lesson presentation acceleration methods interactive technologies Practice tasks and exercises self-test workshops, trainings, cases, quests homework discussion questions rhetorical questions from students Illustrations audio, video clips and multimedia photographs, pictures, graphics, tables, diagrams, humor, anecdotes, jokes, comics, parables, sayings, crosswords, quotes Add-ons abstracts articles tricks for the curious cribs textbooks basic and additional dictionary of terms other Improving textbooks and lessonscorrecting errors in the textbook updating a fragment in a textbook, elements of innovation in the lesson, replacing outdated knowledge with new ones Only for teachers perfect lessons calendar plan for the year guidelines discussion programs Integrated Lessons
Object-oriented programming and design.

Using OOM (Object Oriented Methodology) to create complex software systems implies the presence of basic blocks in the form of classes and objects. An object has a state, a behavior, and a personality. Structure and behavior complex objects defines a common class for them. The terms "class instance" and "object" are used interchangeably.


State of the object.

The state of an object is characterized by a list of all possible (usually static) properties of this object and the current values ​​(usually dynamic) of each of these properties. The properties of objects include inherent or acquired characteristics, traits, qualities or abilities that make this object yourself. For example, a typical lift is that it is designed for ascent and descent, but not for horizontal movement. The list of object properties is, as a rule, static. All properties of an object are characterized by the values ​​of their parameters; they can be simple quantitative characteristics. The difference between objects and simple quantities is as follows: simple quantitative characteristics (for example, numbers) are constant, unchanging and imperishable, while objects exist in time, change, have an internal state, can be created, destroyed and divided. Every object is characterized by a state, which means that it occupies a certain space physically or in computer memory.


Object behavior.

Objects do not exist in isolation, but are influenced or themselves influence other objects. Behavior characterizes how an object affects or is affected by other objects in terms of changing the state of these objects and transmitting messages. In other words, the behavior of an object is completely determined by its actions.

As a rule, in object and object-oriented languages ​​(OOL), operations performed on a given object are called methods (the methodological part of the object) and are included integral part in the class definition. Five main types of operations on objects are known from practice:

1). A modifier is an operation that changes the state of an object by writing or accessing it.

2). Selector is an operation that gives access to determine the state of an object without changing it (read operation).

3). Iterator is an operation of accessing the contents of an object in parts (in a certain sequence).

4). Constructor is the operation of creating and (or) initializing an object.

5). Destructor is the operation of destroying an object and (or) freeing the memory it occupies.


Constructor.

The format for defining a constructor in the body of a C++ class can be as follows:


class_name(list_of_formal_parameters)

(constructor body statements);


The main purpose of a constructor is to initialize an object. According to the language syntax, the return type for a constructor is not defined, not even the type void not allowed. Using parameters, the constructor can be passed any data necessary to create and initialize objects of the class.

Overloaded constructors must meet the same requirements as other overloaded functions.

Initial values ​​for any element (not just constructor arguments) can be specified in the constructor element initialization list. In a constructor definition, the element initialization list is separated from the constructor argument list by a colon. The initialization list contains a list of element names, each followed by a parenthesized list of constructor arguments or an initial value.


Node (int c, char *s):

code(c), str(s) ( )

Destructor.

Dynamic selection memory for an object of any class creates the need to free this memory when the object is destroyed. It is desirable that memory freeing occurs automatically and does not require programmer intervention. The destructor provides this option:


~class_name()

(destructor body operators);


A destructor has no return value. Every method is an operation, but not every operation is a method, since there can be public procedures.

The collection of all methods and public procedures related to a specific object forms the protocol of that object. An object protocol thus defines an object's behavior envelope, covering its internal static and external dynamic behavior.

Objects can be active or passive. An active object can implement its behavior without being influenced by other objects. A passive object, on the contrary, can change its state only under the influence of other objects.

Last update:

IN school curriculum very much attention is paid to studying the topic “Object and its characteristics” already in the 6th grade. Children gradually learn to characterize most of the phenomena, objects and events around them.

This skill is also important because this concept is one of the basic ones in modern information technology. Schoolchildren must learn not only to name objects, but also to identify the main, most important features of an object; computer science provides clear, structured knowledge.

Definition

Any element of the world around us (living and inanimate objects, natural phenomena, any processes) that can be perceived holistically is usually called an object.

Accordingly, objects have names by which they are distinguished and remembered. The world is structured in such a way that every detail in it has a name, otherwise it would be difficult for a person to navigate the surrounding reality.

Kinds

Computer science divides objects into three main groups:

  1. Objects (book, pencil case, tree, car).
  2. Processes (singing, walking, drawing).
  3. Phenomena (earthquakes, snowfall, dawn).

Separately, I would like to mention objects - elements of the operating system interface. These are files, folders, icons or shortcuts - all of them are designed graphically and individually. That is, everyone has their own icon (image). It is customary to study their properties through the context menu, which can be called up by right-clicking on the icon.

Name

Whatever the main and most important characteristics of an object, the name is always given at the beginning. Any object is endowed with its own “name”. It usually answers the questions “who is this” or “what is this”. The variety of forms and capabilities of language sometimes allows objects to be given many names. For example, a house is a building, structure, structure, structure, etc.

Further. Names exist in a general form and in a specific form (personal or proper). For example, the object "tree" is a fairly generic name. There are a huge number of trees on the planet. But the name “larch” is specific, belonging to only one species.

Signs

It is mandatory for any element of the surrounding world to have its own characteristics. These are the main and most important features of an object. Let's take a closer look at them.

  1. Properties are characteristics, which significantly distinguishes it from all the others. The main parameters of a property are a certain existing quantity and its possible values ​​or states. For example, an apple is round, red, sweet.
  2. Actions are an important feature; they show what an object can do and what possibilities there are for manipulating it. For example, candy, you can unwrap it, eat it, give it as a gift, etc.
  3. Behavior is a characteristic characteristic of many objects, characterized by discrete actions, an algorithmic set of certain operations performed by it. Let's take flight as an example. Many birds can fly, but so can airplanes, rockets, and insects. They do this in a unique way for themselves, according to their own algorithm.
  4. State is a set of specific values ​​that collectively describe an object in this moment time. That is, with a different symbiosis of input data, the object will be characterized differently. Example: weather - windy (or sunny, rainy). A combination of conditions will constantly “switch” here: air temperature, humidity, precipitation, Atmosphere pressure and others.

Conclusion

You can practice and independently name the main, most important features of an object from the surrounding world. It could be anything - a bridge, a river, an ocean, a city, an eclipse or a flood.

Such practice in computer science lessons in high school will help to master the material and enable students to learn to structure any phenomena in their minds. In further training they will have to deal with programming, where an object and its properties will be basic concepts when working in certain environments.







2024 gtavrl.ru.