You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
By the way, I am surprised that such fundamental paradigms are not covered in the description of OOP in the help.
1 Nah, it's not, it's the use of inheritance.
2 is warmer, it's Composition, which is one of the three binding options, along with Association and Aggregation.
By the way, I'm surprised that such fundamental paradigms are not covered in the description of OOP in the help.
These are programming tricks rather than direct OOP features.
Regarding aggregation:
In object-oriented programming, aggregation (also called composition or inclusion) refers to the technique of creating a new class from existing classes by nesting. Aggregation is also often spoken of as a "membership relation" along the lines of "a car has a body, wheels, and engine".
The nested objects of a new class are usually declared private, making them inaccessible to application programmers working with the class. On the other hand, the class creator can modify these objects without disturbing existing client code. In addition, replacing nested objects at runtime allows you to dynamically change the behaviour of the program. The inheritance mechanism does not have such flexibility, because restrictions are set for derived classes, which are checked at the compilation stage.
On the basis of aggregation the method of delegation is implemented, when a task assigned to an external object is delegated to an internal object specialised in solving tasks of this kind.
http://ru.wikipedia.org/wiki/Агрегирование_( programming)
Open the help on structures. and also read type conversion, about structures.
The members of methods were available from the very beginning. Why do you want to remove them?
Association and other ways of linking classes.
One point:
m_size.
The prefix m_ in common naming conventions is prefixed to class data-members. It is intended mostly for explicitly distinguishing local variables from class data in methods.
Is it possible to write functions in a structure? Probably pointers to a class - I've seen it, tried it, it's better not to know about it.
Why are the codes not run through the styler?
It will be difficult for a newcomer to read, he sees one style in ME and another in the article.
ZY The article doesn't reveal the issues of class connection.
In general, of course, OOP is a complex topic, it is not easy to describe it in simple language, but you have to start somewhere.
Well, what is it for? Patterns are yes, but this is not the level of beginners.
One moment:
m_size.
The prefix m_ in common naming conventions is attached to class data-members. It is intended mostly for explicitly distinguishing local variables from class data in methods.
The m_ prefix was used when programming under MFC, applied to private and protected variables, there are no other "generally accepted" conventions. After MFC left the scene, everyone forgot about all these stupid m_, thank God )). If you don't believe - download the examples and see for yourself (there is a section on MFC too) http://archive.msdn.microsoft.com/vcsamples.
The prefix m_ was used when programming under MFC, applied to private and protected variables, there are no other "generally accepted" conventions. After MFC left the scene, all these stupid m_ have been forgotten, thank God )) Those who don't believe - download the examples and see for yourself (there is a section on MFC too) http://archive.msdn.microsoft.com/vcsamples.
No. При чем тут MFC? https://ru.wikipedia.org/wiki/%D0%92%D0%B5%D0%BD%D0%B3%D0%B5%D1%80%D1%81%D0%BA%D0%B0%D1%8F_%D0%BD%D0%BE%D1%82%D0%B0%D1%86%D0%B8%D1%8F
is convenience and nothing more. Every programming company may have its own rules.
Very necessary article!
I suggest developers to create a new category for articles. Something like "Fundamentals (theory) of programming"....