Partenaire Premium

Software Construction: Design Patterns 1

Cards to learn the design patterns

Cards to learn the design patterns


Fichier Détails

Cartes-fiches 14
Langue Deutsch
Catégorie Informatique
Niveau Université
Crée / Actualisé 28.12.2019 / 11.01.2020
Attribution de licence Non précisé
Lien de web
https://card2brain.ch/box/20191228_software_construction_design_patterns_1
Intégrer
<iframe src="https://card2brain.ch/box/20191228_software_construction_design_patterns_1/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>

The Singleton Pattern (Definition)

The Singleton Pattern ensures a class has only one instance, and provides a global point of access to it.

Class Diagram of Singleton Pattern

Singleton Pattern Implementation Example (Eagerly created instance)

Eagerly created instance

The Adapter Pattern (Definition)

The Adapter Pattern converts the interface of a class into another interface the clients expect. Adapter lets classes work together that could not otherwise because of incompatible interfaces.

Class Diagram of Adapter Pattern

Adapter Pattern Implementation Example (Ducks & Turkeys)

The Observer Pattern (Definition)

The Observer Pattern defines a one-to-many dependency between objects so that when one object changes state, all of its dependents are notified and updated automatically.

Design Principle (Observer Pattern?)

Strive for loosely coupled designs between objects that interact.