notReact patterns
by Kostiantyn Synyshyn
Front-end Developer at Levi Nine

Table of contents

What is a 'design pattern'?

Object oriented programming

Object relationships

Principles of good design & SOLID

Design pattern

“Each pattern describes a problem which occurs over and over again in our environment, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice”

Excerpt From
Design Patterns: Elements of Reusable Object-Oriented Software
Gamma, Erich
 

  1. Pattern name

  2. Problem

  3. Solution

  4. Consequences

Object oriented programming

- you have to rely on OOP if you can't solve an issue properly with a function
  1. Abstraction

  2. Encapsulation

  3. Polymorphism

  4. Inheritance

Pillars of OOP

Abstraction

Different models of the same real-world object.

Encapsulation

Encapsulation is an ability of an object to hide its parts (state and behaviour) from other objects and only expose a limited interface to the outside world.

Polymorphism

Polymorphism is the ability of a program to detect the real class of an object and call its implementation even when its real type is unknown in the current context.

Inheritance

Inheritance is the ability to build new classes on top of exist- ing ones.  

How do we describe object interactions?

  1. Association

  2. Dependency

  3. Composition

  4. Aggregation

Object relations

So, patterns or principles?

Patterns

  1. Creational

  2. Structural

  3. Behavioural

Principles

  1. SOLID

  2. KISS

  3. DRY

  4. YAGNI

  5. 2-3

Links

Summary

Thank you!

Q&A

notReact patterns

By Kostiantyn Synyshyn

notReact patterns

Introduction Lecture

  • 30