course update of 2023-11-30 09:36:57

This commit is contained in:
Louis Gallet 2023-11-30 09:36:57 +01:00
parent 9409d1dad5
commit 725ca8d4ce
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY
2 changed files with 73 additions and 7 deletions

View File

@ -13,7 +13,7 @@
"state": {
"type": "markdown",
"state": {
"file": "Algo/B2/Exercises/String exercise.md",
"file": "Prog/OOP.md",
"mode": "source",
"source": false
}
@ -85,7 +85,7 @@
"state": {
"type": "backlink",
"state": {
"file": "Algo/B2/Exercises/String exercise.md",
"file": "Prog/OOP.md",
"collapseAll": false,
"extraContext": false,
"sortOrder": "alphabetical",
@ -102,7 +102,7 @@
"state": {
"type": "outgoing-link",
"state": {
"file": "Algo/B2/Exercises/String exercise.md",
"file": "Prog/OOP.md",
"linksCollapsed": false,
"unlinkedCollapsed": true
}
@ -125,7 +125,7 @@
"state": {
"type": "outline",
"state": {
"file": "Algo/B2/Exercises/String exercise.md"
"file": "Prog/OOP.md"
}
}
},
@ -158,8 +158,10 @@
},
"active": "41ec48cdc3af71a1",
"lastOpenFiles": [
"Algo/B2/Exercises/Repetitive tutorial.md",
"Prog/Loops.md",
"Prog/OOP.md",
"Algo/B2/Exercises/String exercise.md",
"Algo/B2/Exercises/Repetitive tutorial.md",
"Algo/B2/Exercises/Imperative exercise.md",
"Prog/Collections.md",
"Prog/Array.md",
@ -177,7 +179,6 @@
"Algo/B1/CM/CM du 27 septembre.md",
"Algo/B1/Séminaire/Chapter 3 - Case analysis.md",
"Algo/B1/Séminaire/Chapter 2 - Functions.md",
"Prog/Loops.md",
"Algo/B1/Séminaire/Chapter 4 - A bit of imperative.md",
"Algo/B1/CM/Lists.md",
"Algo/B1/Séminaire/Exercices seminaire.md",
@ -189,7 +190,6 @@
"Algo/B1/Courses",
"COM-ADMR/Séjour international EPITA.md",
"Algo/B1/CM",
"Electronic/Lecture 1.md",
"Electronic",
"Architecture",
"English",

66
Prog/OOP.md Normal file
View File

@ -0,0 +1,66 @@
# Object Oriented Programming
<img src="https://i.imgur.com/qPsUYyd.jpg" alt="meme" style="zoom:50%;" />
## Introduction
- A programming paradigm
- Allows:
- Model objects
- Make objects interact with each other
- Objcts refer to complex variables
## Benefits and motivation
- Modularity
- Abstraction
- Productivity and reusability
- Security and encapsulation
## Concrete example
- When we develop a game with cars inside
- We develop the car one time and all other games can re-use the base of the car that we created
- We have access to characteristics
- Model
- Color
- Fuel type
- ...
- We also have the behavior of the car
- Start
- Accelerate
- Stop
## Object
- Data part: object characteristcs
- Attributes
- Properties
- Fields
- ...
- Code part = oject behavior
- Methods
- Procedure
## Class
- Object = classs instance
- Class
- New data type
- Collection of objects
- Figuratively
- Class = mold
- Object = cake
- Class at compilation VS object at runtime
```csharp
public class MyFirstClass {
public MyFirstClass() {} //constructor
}
MyFirstClass c = new MyFirstClass(); //new object
```
## Modelization
- First mandatory step
-