Skip to content

I made this repo just to help me learn design patterns in Dart, so this repo no one needs to learn design patterns in Dart language. This repo also helped developers use Dart programming language by providing some examples for each pattern with many UML class diagrams.

License

Notifications You must be signed in to change notification settings

AdelDaniel/learn-design-patterns-in-dart

Repository files navigation

Dart Programming Language

OOP

Design Patterns

reusable solution to a commonly occurring problem within a given context in software design.

  • It is not a finished design that can be transformed directly into source or machine code.

    • Rather, it is a description or template
    • for how to solve a problem that can be used in many different situations.
  • Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.

  • Object-oriented design patterns

    1. show relationships and interactions
    2. between classes or objects,
    3. without specifying the final application classes or objects that are involved.

Patterns that imply mutable state may be unsuited for functional programming languages.

Some patterns can be rendered unnecessary in languages that have built-in support for solving the problem they are trying to solve, and object-oriented patterns are not necessarily suitable for non-object-oriented languages.


Creational Design Patterns

  • Wikipedia

    • Are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation.
    • The basic form of object creation could result in design problems or in added complexity to the design.
    • Creational design patterns solve this problem by somehow controlling this object creation.
    • Creational design patterns are composed of two dominant ideas.
    • One is encapsulating knowledge about which concrete classes the system uses.
    • Another is hiding how instances of these concrete classes are created and combined
  • Tutorial point

    • a way to create objects.
    • while hiding the creation logic, rather than instantiating objects directly using new operator.
    • This gives program more flexibility in deciding which objects need to be created for a given use case.
  • Factory Method

  • Builder


Structural Design Patterns

  • Wikipedia

    • Structural patterns are concerned with how classes and objects are composed to form larger structures.
    • Structural class patterns use inheritance to compose interfaces or implementations. - As a simple example, consider how multiple inheritance mixes two or more chasses into one. The result is a class that 3 combines the properties of its parent chasses.
  • tutorial point

    • These design patterns concern class and object composition.
    • Concept of inheritance is used to compose interfaces and define ways to compose objects to obtain new functionalities.
  • Adapter

  • Bridge

  • Decorator

  • Facade

  • Proxy


Behavioral Design Patterns

refactoring.guru: Behavioral design patterns are concerned with algorithms and the assignment of responsibilities between objects.

  • Wikipedia

    • behavioral design patterns are design patterns that identify common communication patterns among objects.
  • tutorial point

    • These design patterns are specifically concerned with communication between objects.
  • Chain Of Responsibility

  • Observer

  • Command


Other Patterns Not Exist In GOF

About

I made this repo just to help me learn design patterns in Dart, so this repo no one needs to learn design patterns in Dart language. This repo also helped developers use Dart programming language by providing some examples for each pattern with many UML class diagrams.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published