Giter VIP home page Giter VIP logo

ricofritzsche / decorator-pattern-typescript Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5 KB

Decorator Design Pattern through a relatable car assembly analogy, realized in TypeScript. This repo provides a step-by-step implementation, showcasing how we can dynamically enhance objects with additional functionalities.

Home Page: https://ricofritzsche.me

License: MIT License

TypeScript 100.00%
decorator-pattern decorators javascript oop-principles patterns typescript

decorator-pattern-typescript's Introduction

๐Ÿš— Decorator Pattern Car Assembly with TypeScript in Deno

This repository showcases the Decorator Design Pattern using a real-world analogy of a car assembly. The code is written in TypeScript and designed to run in the Deno runtime.

Read the article here

About

The Decorator Pattern is a structural design pattern that allows you to dynamically attach new behaviors to objects. Using the analogy of customizing a car with various features, we walk through this pattern, making it easier to grasp and implement.

Prerequisites

  • Deno: Make sure you have Deno installed. If not, you can download and install from here.

How to Run

  1. Clone this repository:
git clone https://github.com/ricofritzsche/decorator-pattern-typescript.git
cd decorator-pattern-typescript
  1. Run the TypeScript file using Deno:
deno run --allow-read main.ts

Note: The --allow-read flag is only necessary if the code reads files, which is common in many Deno projects. Adjust the permissions according to your code's requirements. Exploring the Code

main.ts: The entry point where we bring everything together.
car.ts: Defines the basic car.
decorators.ts: Contains car decorators.

Feedback & Contributions

Feedback, issues, and pull requests are more than welcome! This repo is meant to be a community-driven learning resource.

License

This project is under the MIT License. See LICENSE for details.

Checkout the authors homepage

decorator-pattern-typescript's People

Contributors

ricofritzsche avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.