feat: add educational OOP concepts following TypeScript Handbook (#290)#306
Open
MOHD-TAHA-KHAN wants to merge 1 commit intoTheAlgorithms:masterfrom
Open
feat: add educational OOP concepts following TypeScript Handbook (#290)#306MOHD-TAHA-KHAN wants to merge 1 commit intoTheAlgorithms:masterfrom
MOHD-TAHA-KHAN wants to merge 1 commit intoTheAlgorithms:masterfrom
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
[FEATURE]: OOP Educational Guide - Abstraction, Inheritance, Encapsulation, and Polymorphism
📝 Description
This PR resolves #290 by introducing a structured set of educational examples focused on Object-Oriented Programming (OOP) in TypeScript. Following the guidelines from the TypeScript Handbook, these examples are designed to help contributors and students understand how to architect clean, reusable, and maintainable code.
🚀 Key Educational Concepts
To provide a clear learning path, the code is organized into concept-specific files:
oop/Abstraction.ts: Demonstrates the use ofabstractclasses and methods to define blueprints.oop/Inheritance.ts: Shows how to extend classes using theextendsandsuperkeywords.oop/Encapsulation.ts: Illustrates data protection usingprivateandprotectedaccess modifiers along withgetters.oop/Polymorphism.ts: Provides examples of usinginterfacesto treat different concrete implementations as a single type.📚 Documentation References
Each file is heavily commented and refers to the following official documentation for deeper understanding:
🧪 Testing
Comprehensive unit tests have been added in
oop/__tests__/OOP.test.tsto verify the mathematical and logical correctness of the examples.Rectanglearea calculation.BankAccount.Loggerimplementations.By structuring these as separate files, this contribution serves as a living syllabus for the repository's OOP standards.