-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tłumaczenie #85
Open
dawidbil
wants to merge
8
commits into
coders-school:main
Choose a base branch
from
dawidbil:tlumaczenie
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Tłumaczenie #85
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
541ba77
module1 + updated README
dawidbil d25f5af
update README again
dawidbil cc91c93
module2 finished + README updated
dawidbil 777f9c6
module1 fix
dawidbil 5a4e806
finished module3 + README updated
dawidbil 67156e1
small fix
dawidbil 04d8280
finished module4 + README updated
dawidbil 2ea9640
fixes from code review
dawidbil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,117 @@ | ||
# Object Oriented Programming | ||
|
||
<a href="https://coders.school"> | ||
<img width="500" data-src="coders_school_logo.png" src="coders_school_logo.png" alt="Coders School" class="plain"> | ||
</a> | ||
|
||
# Programowanie obiektowe | ||
|
||
## [Moduł 1](module1/) | ||
|
||
### [Wprowadzenie do programowania obiektowego](module1/presentation_oop_intro.md) | ||
### [Wprowadzenie](module1/00_intro.pl.md) | ||
|
||
### [Modyfikatory dostępu](module1/presentation_access_modifiers.md) | ||
### [Modyfikatory dostępu](module1/01_access_modifiers.pl.md) | ||
|
||
### [Konstruktory i destruktory](module1/presentation_ctor_dtor.md) | ||
### [Konstruktory i destruktory](module1/02_ctor_dtor.pl.md) | ||
|
||
### [Hermetyzacja](module1/presentation_hermetization.md) | ||
### [Hermetyzacja](module1/03_hermetization.pl.md) | ||
|
||
### [Zadania](module1/presentation_tasks.md) | ||
### [Zadania](module1/04_tasks.pl.md) | ||
|
||
### [Projekt grupowy](module1/presentation_homework.md) | ||
### [Zadanie domowe](module1/05_homework.pl.md) | ||
|
||
## [Moduł 2](module2/) | ||
|
||
### [Dziedziczenie](module2/presentation_inheritance.md) | ||
### [Dziedziczenie](module2/00_inheritance.pl.md) | ||
|
||
### [Metody wirtualne, interfejsy, klasy abstrakcyjne](module2/presentation_virtual.md) | ||
### [Metody wirtualne, interfejsy, klasy abstrakcyjne](module2/01_virtual.pl.md) | ||
|
||
### [Polimorfizm](module2/presentation_polymorphism.md) | ||
### [Polimorfizm](module2/02_polymorphism.pl.md) | ||
|
||
### [Zmienne i funkcje statyczne](module2/presentation_static.md) | ||
### [Zmienne i funkcje statyczne](module2/03_static.pl.md) | ||
|
||
### [Projekt grupowy](module2/presentation_homework.md) | ||
### [Zadanie domowe](module2/04_homework.pl.md) | ||
|
||
### [Przykładowe rozwiązania](module2/05_solutions.pl.md) | ||
|
||
## [Moduł 3](module3/) | ||
|
||
### [Przykładowe rozwiązania](module3/presentation_solutions.md) | ||
### [Przykładowe rozwiązania](module3/00_solutions.pl.md) | ||
|
||
### [Polimorfizm](module3/presentation_polymorphism.md) | ||
### [Polimorfizm](module3/01_polymorphism.pl.md) | ||
|
||
### [Zmienne i funkcje statyczne](module3/presentation_static.md) | ||
### [Zmienne i funkcje statyczne](module3/02_static.pl.md) | ||
|
||
### [Projekt grupowy](module3/presentation_homework.md) | ||
### [Zadanie domowe](module3/03_homework.pl.md) | ||
|
||
## [Moduł 4](module4/) | ||
|
||
### [Cztery filary obiektowości](module4/pillars.md) | ||
### [Cztery filary obiektowości](module4/00_pillars.pl.md) | ||
|
||
### [Abstrakcja](module4/01_abstraction.pl.md) | ||
|
||
### [Enkapsulacja](module4/02_encapsulation.pl.md) | ||
|
||
### [Dziedziczenie](module4/03_inheritance.pl.md) | ||
|
||
### [Polimorfizm](module4/04_polymorphism.pl.md) | ||
|
||
### [Zadanie](module4/05_exercise_cars.pl.md) | ||
|
||
### [Post-work](module4/06_post_work.pl.md) | ||
|
||
___ | ||
|
||
# Object Oriented Programming | ||
|
||
## [Module 1](module1/) | ||
|
||
### [Introduction](module1/00_intro.en.md) | ||
|
||
### [Access modifiers](module1/01_access_modifiers.en.md) | ||
|
||
### [Constructors and destructors](module1/02_ctor_dtor.en.md) | ||
|
||
### [Hermetization](module1/03_hermetization.en.md) | ||
|
||
### [Exercises](module1/04_tasks.en.md) | ||
|
||
### [Homework](module1/05_homework.en.md) | ||
|
||
## [Module 2](module2/) | ||
|
||
### [Inheritance](module2/00_inheritance.en.md) | ||
|
||
### [Virtual methods, interfaces, abstract classes](module2/01_virtual.en.md) | ||
|
||
### [Polymorphism](module2/02_polymorphism.en.md) | ||
|
||
### [Static variables and functions](module2/03_static.en.md) | ||
|
||
### [Homework](module2/04_homework.en.md) | ||
|
||
### [Examples of solutions](module2/05_solutions.en.md) | ||
|
||
## [Module 3](module3/) | ||
|
||
### [Examples of solutions](module3/00_solutions.en.md) | ||
|
||
### [Polymorphism](module3/01_polymorphism.en.md) | ||
|
||
### [Static variables and functions](module3/02_static.en.md) | ||
|
||
### [Homework](module3/03_homework.en.md) | ||
|
||
## [Module 4](module4/) | ||
|
||
### [The four pillars of objectivity](module4/00_pillars.en.md) | ||
|
||
### [Abstrakcja](module4/abstraction.md) | ||
### [Abstraction](module4/01_abstraction.en.md) | ||
|
||
### [Enkapsulacja](module4/encapsulation.md) | ||
### [Encapsulation](module4/02_encapsulation.en.md) | ||
|
||
### [Dziedziczenie](module4/inheritance.md) | ||
### [Inheritance](module4/03_inheritance.en.md) | ||
|
||
### [Polimorfizm](module4/polymorphism.md) | ||
### [Polymorphism](module4/04_polymorphism.en.md) | ||
|
||
### [Zadanie](module4/exercise_cars.md) | ||
### [Exercise](module4/05_exercise_cars.en.md) | ||
|
||
### [Post-work](module4/post_work.md) | ||
### [Post-work](module4/06_post_work.en.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
<!-- .slide: data-background="#111111" --> | ||
|
||
# Object oriented programming | ||
|
||
<a href="https://coders.school"> | ||
<img width="500" data-src="../coders_school_logo.png" alt="Coders School" class="plain"> | ||
</a> | ||
|
||
___ | ||
|
||
## SHM (pol. Symulator Handlu Morskiego) - Sea Trade Simulator | ||
|
||
<img height="500" data-src="img/statek.png" src="https://github.com/coders-school/object-oriented-programming/raw/master/module1/img/statek.png" alt="Statek" class="plain"> | ||
|
||
___ | ||
<!-- .slide: data-background="#eeeeee" --> | ||
|
||
## SHM - UML diagram | ||
|
||
<a href="https://raw.githubusercontent.com/coders-school/object-oriented-programming/master/shm-uml.svg"> | ||
<img height="500" data-src="../shm-uml.svg" src="https://raw.githubusercontent.com/coders-school/object-oriented-programming/master/shm-uml.svg" alt="Diagram klas - SHM" class="plain"> | ||
</a> | ||
|
||
___ | ||
|
||
## Introduction to object oriented programming | ||
|
||
___ | ||
|
||
### What is an Object? | ||
|
||
An object in C++ is no different from an actual object in real life. An object is a "specific" object. We can have many identical objects. Some of them can be distinguished by names. In C++ we can have objects such as: | ||
|
||
* <!-- .element: class="fragment fade-in" --> HP computer, Lenovo computer, MacBook computer | ||
* <!-- .element: class="fragment fade-in" --> HP printer, Epson printer | ||
* <!-- .element: class="fragment fade-in" --> Stabilo Schwan 306 HB pencil = 2 1/2 | ||
* <!-- .element: class="fragment fade-in" --> Casio calculator | ||
* <!-- .element: class="fragment fade-in" --> ... | ||
|
||
The object exists in computer memory while the program is running. We can have many objects of the same type. | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
* <!-- .element: class="fragment fade-in" --> Type: <code>Dog</code> | ||
* <!-- .element: class="fragment fade-in" --> Objects of type <code>Dog</code>: <code>Max</code>, <code>Milo</code>, <code>Coco</code>, ... | ||
|
||
___ | ||
|
||
### What is a class? | ||
|
||
A class is a type. | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
A class in C++ is slightly different from an actual class 🙂 In C++ (or object-oriented programming in general) a class defines the characteristics of an object: | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
* <!-- .element: class="fragment fade-in" --> what properties will this object have (fields) | ||
* <!-- .element: class="fragment fade-in" --> what methods of operation will it have (methods, functions) | ||
|
||
___ | ||
|
||
### Questions | ||
|
||
* <!-- .element: class="fragment fade-in" --> what properties could a <code>computer</code> object have? | ||
* <!-- .element: class="fragment fade-in" --> what methods could the <code>computer</code> have? | ||
|
||
```cpp | ||
class Computer { | ||
// fields | ||
Processor processor_; | ||
Drive drive_; | ||
Motherboard motherboard_; | ||
GraphicsCard graphics_card_; | ||
Memory memory_; | ||
|
||
// methods | ||
void run(); | ||
void restart(); | ||
void shutdown(); | ||
}; | ||
``` | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
___ | ||
|
||
## Composition, aggregation | ||
|
||
Nothing prevents one object from being composed of other objects. In this way, we make the structure of our code more understandable. | ||
|
||
Containing one object within another is called composition or aggregation. These are not synonyms, they are two slightly different types of object containment, but that doesn't matter at the moment. For example with a computer: | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
```cpp | ||
class Computer { | ||
Processor processor_; | ||
Drive drive_; | ||
Motherboard motherboard_; | ||
GraphicsCard graphics_card_; | ||
Memory memory_; | ||
// ... | ||
}; | ||
``` | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
A computer consists (is composed of) of a processor, drive, motherboard, graphics card, memory. | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
___ | ||
<!-- .slide: data-background="#eeeeee" --> | ||
|
||
## Class diagram - composition, aggregation | ||
|
||
<img height="250" data-src="img/composition_aggregation.png" src="https://github.com/coders-school/object-oriented-programming/raw/master/module1/img/composition_aggregation.png" alt="Kompozycja i agregacja" class="plain"> | ||
|
||
* <!-- .element: class="fragment fade-in" --> Composition: A car contains exactly 1 Carburetor. The carburetor is part of exactly one car. Without a car, the carburetor does nothing, so it cannot function without it. | ||
* <!-- .element: class="fragment fade-in" --> Aggregation: Pond can contain any number (0 .. *) of Ducks. The duck may be in only one pond at a time or in none (0..1). The duck can live outside the pond. | ||
|
||
[Class diagram - wikipedia](https://en.wikipedia.org/wiki/Class_diagram) | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
___ | ||
|
||
## Q&A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<!-- .slide: data-background="#111111" --> | ||
|
||
# Object oriented programming | ||
|
||
## Access modifiers | ||
|
||
<a href="https://coders.school"> | ||
<img width="500" data-src="../coders_school_logo.png" alt="Coders School" class="plain"> | ||
</a> | ||
|
||
___ | ||
|
||
## `class` vs `struct` | ||
|
||
To represent types outside classes (`class`) we still have structures (`struct`). | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
The main difference is that all structure elements - its methods and variables - are public by default. By contrast, in the class they are private by default. | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
Word `private` means that we only have access to these fields inside the class. We cannot appeal to them outside of this class. Word `public` means that we have external access to the data. | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
___ | ||
|
||
## Access modifiers | ||
|
||
### `private` vs `public` | ||
|
||
```cpp | ||
class Computer { | ||
private: | ||
void restart(); | ||
}; | ||
|
||
Computer computer; | ||
computer.restart(); // Forbidden, restart is a private member | ||
``` | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
```cpp | ||
class Computer { | ||
public: | ||
void restart(); | ||
}; | ||
|
||
Computer computer; | ||
computer.restart(); // Ok | ||
``` | ||
<!-- .element: class="fragment fade-in" --> | ||
|
||
___ | ||
|
||
### Access modifier `protected` | ||
|
||
There is one more access modifier in C++ - `protected`. | ||
|
||
We will tell about it when we explain what inheritance is. | ||
|
||
___ | ||
|
||
## Q&A |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that either abbrevation should be changed to STS or there should explanation something like |SHM(pol. Symulator handlu morskiego) - Sea Trade Simulator"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, putting polish version should clear things out. Thanks 🙂