Похожие чаты

Hello humans 😁 let me share my simples, OOP Concepts

in simple terms...

— Class —
Class is a #blueprint for creating paticular #data_structures, providing initial values for #state, & inplementations of #behavior

— Object —
Objects is an #instance of a class which has the #structure of its blueprint, but also owns unique state and #behavior

— Encapsulation —
Encapsulation is achieved when each object keeps its state #private, inside a class. Other objects don't have direct #access to this state

—Abstraction —
Abstraction means that each object should only expose a #high-level mechanism for using it. This mechanism should #hide internal #implementation details

— Inheritance —
Objects are often #similar. They share common #logic. With inheritance, the child class #reuses all fields & methods the parent class & can implement its own

— Polymorphism —
Polymorphism means #"many_shapes". It gives a way to use a class exactly like its #parent, but each #child class keeps its own methods as they are.

Do You Use OOP? Can You Explain These Concepts In a Better Way? 😋 let me change my mind or put a ur commit

Thank you 😃
📝 snishalaka with ❤️
https://www.linkedin.com/in/suranjith-nishalaka/

3 ответов

10 просмотров

Starting with inheritance on you introduced “fields” and “methods” never describing what they are. A bit sketchy. Otherwise, the concepts ate laid out pretty neatly.

Encapsulation is not limited to OOP, you can also achieve it with closures and modules

Continuing from devs chat :) Let me try :) Class => Grimoire, Object => Magic Spell, Encapsulation => Mana, Abstraction => Spell invocation, Inheritance => (-_-) welp Polymorphism => Higher tier magic spells :)

Похожие вопросы

Обсуждают сегодня

Карта сайта