From 725ca8d4ced9110cdb717d999445199b1fd42c5d Mon Sep 17 00:00:00 2001 From: Louis Date: Thu, 30 Nov 2023 09:36:57 +0100 Subject: [PATCH] course update of 2023-11-30 09:36:57 --- .obsidian/workspace.json | 14 ++++----- Prog/OOP.md | 66 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 Prog/OOP.md diff --git a/.obsidian/workspace.json b/.obsidian/workspace.json index 9830092..4b7ee17 100644 --- a/.obsidian/workspace.json +++ b/.obsidian/workspace.json @@ -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", diff --git a/Prog/OOP.md b/Prog/OOP.md new file mode 100644 index 0000000..b5a47a3 --- /dev/null +++ b/Prog/OOP.md @@ -0,0 +1,66 @@ +# Object Oriented Programming + +meme + +## 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 +- \ No newline at end of file