/gof-app

Primary LanguageTypeScript

Gang of Four Book Ecommerce πŸš€

πŸš€ Get Started

# install expo cli
npm install -g expo-cli
# install dependencies
npm install

Or use yarn

yarn install
# run project
expo start
Change the API in config.ts to the server that you're running. 

πŸš€ Gang of Four Design Patterns

Design Patterns: Elements of Reusable Object-Oriented Software is a book on software engineering highlighting the capabilities and pitfalls of object-oriented programming. They have listed down 23 classic software design patterns which are influential even in the current software development environment. The authors are often referred to as the Gang of Four (GoF).

  1. Creational Patterns
  • Singleton
  • Factory
  • Abstract Factory
  • Builder
  • Prototype
  1. Structural Patterns
  • Adapter
  • Composite
  • Proxy
  • Flyweight
  • Facade
  • Bridge
  • Decorator
  1. Behavioral Patterns
  • Template Method
  • Mediator
  • Chain of Responsibility
  • Observer
  • Strategy
  • Command
  • State
  • Visitor
  • Iterator
  • Interpreter
  • Memento

The project applys these patterns :

  • Singleton : In core/Singleton
  • Factory : In core/Factory
  • Template Method : In core/TemplateComposition
  • Composition : In core/TemplateComposition
  • Iterator : In core/Iterator
  • Proxy: In core/Proxy
  • Strategy : In core/Strategy
  • Command : In core/Command

The libraries/frameworks apply GOF patterns:

  • Chain of Responsibility : Using Redux for state management
  • State : Dispatch -> Update new state
  • Composition: React Native follow React's strategy In React using Composition and Props gives you all the flexibility that you would need. React does not say Composition is better than Inheritance. Composition just fits better within the React’s component structure.