Premium Partner

Design Pattern

Zusammenfassung von Design Pattern in JAVA

Zusammenfassung von Design Pattern in JAVA


Kartei Details

Karten 33
Lernende 12
Sprache English
Kategorie Informatik
Stufe Universität
Erstellt / Aktualisiert 29.05.2013 / 28.01.2023
Lizenzierung Kein Urheberrechtsschutz (CC0)
Weblink
https://card2brain.ch/box/design_pattern
Einbinden
<iframe src="https://card2brain.ch/box/design_pattern/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>

Basics

  • abstraction
  • encapsulation
  • polymorphism
  • inheritance

Principles

  • Encapsulate what varies
  • Favor composition over inheritance
  • Program to interface, not implementations
  • Strive for loosely coupled designs between objects that interact
  • Classes should be open for extension but closed for modification

Strategy Pattern

Stragety - defines a family of algorthms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

Good OO desings are:

  • reusable
  • extensible
  • maintainable

Patterns -generic

  • show you how to buld systems with good OO design qualities
  • are proven object-oriented experience
  • don't give xou code, they give you general solutions to design problems. You apply them to your specific application.
  • aren't invented they are discovered
  • provide a shared language that can maximize the value of your communication with other developers

Observer

Observer - defines a onte-to-many dependency between objects so that when one object change state, all its dependents are notified and updated automatically

Subjects

Subjects, or as we also know them, Observables, update Observers using a common interface

Observers

Observers are loosely coupled in that the Observable knows nothing about them, other than that they implement the Observer Interface