- vừa được xem lúc

Blog#68: The Top 10 Design Patterns in JavaScript 😊 (Series: Master English with Technical Doc)

0 0 21

Người đăng: NGUYỄN ANH TUẤN

Theo Viblo Asia

Để giúp các bạn có thể nâng cao trình độ tiếng Anh, Blog này mình sẽ viết bằng tiếng Anh.

Mục tiêu sẽ là, sử dụng các kiến thức cở bản về các kỹ thuật phổ biến trong ngành IT để học tiếng Anh, thay vì phải có trình độ tiếng Anh tốt trước khi bắt tay vào học kỹ thuật.

Mình sẽ cố gắng sử dụng ngữ pháp và từ vựng đơn giản nhất (level~A1) để giúp các bạn dễ dàng đọc nó.

Cuối mỗi bài sẽ có phần tổng hợp cách Từ mới xuất hiện trong bài. Các Từ mới của mỗi bài mình sẽ cố gắng không trùng lặp với những bài trước đó. Mục tiêu của ae mình là sau tầm 100 bài sẽ có được một số vốn từ vựng kha khá.

Hãy theo dõi Blog của mình để không bỏ lỡ những bài viết hữu ích và thú vị trong tương lai nhé.

Nếu bạn nào đang học Tiếng Nhật thì mình cũng có series tương tự bằng Tiếng Nhật nhé: IT技術書を読解してマスター日本語


Hi, I'm Tuan, a Full-stack Web Developer from Tokyo 😊. Follow my blog to not miss out on useful and interesting articles in the future.

Today I will give an overview of the popular design patterns that I have used in my work. I will have a series of specific articles about each design pattern in future.

1. Singleton pattern

This pattern involves creating a single instance of a class, and providing a global point of access to it. This is useful when you want to ensure that there is only one instance of a particular object in your application.

2. Factory pattern

This pattern involves creating objects based on a common interface, without specifying the exact class of object that will be created. This is useful when you need to create objects that belong to a certain family, but you don't want to specify the exact type of object until runtime.

3. Observer pattern

This pattern involves an object (the subject) being observed by one or more other objects (the observers). When the subject's state changes, it notifies the observers, who can then take some action in response. This is useful when you want to decouple the logic of different parts of your application, so that they can each respond to changes in the subject's state.

4. Prototype pattern

This pattern involves creating new objects by copying existing objects (the prototypes). This is useful when you want to create new objects that are similar to existing ones, but you don't want to have to specify the entire object structure from scratch.

5. Builder pattern

This pattern involves creating an object (the builder) that can be used to build other objects (the products). This is useful when you want to create complex objects that require multiple steps or involve lots of customization options.

6. Adapter pattern

This pattern involves creating an adapter object that can be used to adapt one interface to another. This is useful when you have an existing object with a particular interface, but you need to use it in a context that expects a different interface.

7. Decorator pattern

This pattern involves adding new behavior to an existing object by wrapping it in a decorator object. This is useful when you want to add new behavior to an object without changing its existing code.

8. Facade pattern

This pattern involves creating a simple interface that hides the complexity of a larger system. This is useful when you want to provide a simplified interface to a complex system, so that users don't have to worry about the underlying details.

9. Command pattern

This pattern involves creating objects that represent actions or operations. This is useful when you want to be able to specify, queue, and execute operations in a flexible way.

10. Template method pattern

This pattern involves defining the skeleton of an algorithm in a base class, and allowing subclasses to provide the implementation for certain steps. This is useful when you want to define the overall structure of an algorithm, but allow subclasses to customize certain parts of it.

Roundup

In the following articles, I will explain in detail each of the Design Patterns introduced in the article.

As always, I hope you enjoyed this article and learned something new. Thank you and see you in the next articles!

If you liked this article, please give me a like and subscribe to support me. Thank you. 😊

Ref


10 từ mới trong bài hôm nay:

LINK Quizlet để ôn tập những từ đã học được ở bài trước:

  1. Overview: tổng quan
  2. Popular: phổ biến
  3. Series: loạt
  4. Specific: cụ thể
  5. Article: bài viết
  6. State: trạng thái
  7. Decouple: tách rời
  8. Context: ngữ cảnh
  9. Skeleton: khuôn
  10. Subclass: lớp con

Bình luận

Bài viết tương tự

- vừa được xem lúc

Giới thiệu Typescript - Sự khác nhau giữa Typescript và Javascript

Typescript là gì. TypeScript là một ngôn ngữ giúp cung cấp quy mô lớn hơn so với JavaScript.

0 0 500

- vừa được xem lúc

Bạn đã biết các tips này khi làm việc với chuỗi trong JavaScript chưa ?

Hi xin chào các bạn, tiếp tục chuỗi chủ đề về cái thằng JavaScript này, hôm nay mình sẽ giới thiệu cho các bạn một số thủ thuật hay ho khi làm việc với chuỗi trong JavaScript có thể bạn đã hoặc chưa từng dùng. Cụ thể như nào thì hãy cùng mình tìm hiểu trong bài viết này nhé (go).

0 0 414

- vừa được xem lúc

Một số phương thức với object trong Javascript

Trong Javascript có hỗ trợ các loại dữ liệu cơ bản là giống với hầu hết những ngôn ngữ lập trình khác. Bài viết này mình sẽ giới thiệu về Object và một số phương thức thường dùng với nó.

0 0 136

- vừa được xem lúc

Tìm hiểu về thư viện axios

Giới thiệu. Axios là gì? Axios là một thư viện HTTP Client dựa trên Promise.

0 0 117

- vừa được xem lúc

Imports và Exports trong JavaScript ES6

. Giới thiệu. ES6 cung cấp cho chúng ta import (nhập), export (xuất) các functions, biến từ module này sang module khác và sử dụng nó trong các file khác.

0 0 93

- vừa được xem lúc

Bài toán đọc số thành chữ (phần 2) - Hoàn chỉnh chương trình dưới 100 dòng code

Tiếp tục bài viết còn dang dở ở phần trước Phân tích bài toán đọc số thành chữ (phần 1) - Phân tích đề và những mảnh ghép đầu tiên. Bạn nào chưa đọc thì có thể xem ở link trên trước nhé.

0 0 229