The document provides an introduction to object-oriented programming (OOP) principles and design patterns. It discusses the four pillars of OOP - abstraction, encapsulation, modularity, and hierarchy. It then defines what an object is in terms of its properties of state, behavior, and identity. The document outlines several OOP principles like least astonishment, command query separation, tell don't ask, and the law of Demeter. It concludes by briefly introducing some common design patterns like decorator, strategy, chain of responsibility, composite, template method, and facade.
11. “If a precondition is violated, this means
that a client has not satisfied its part of
the bargain, and hence the server
cannot proceed reliably. Similarly, if a
postcondition is violated, this means
that a server has not carried out its part
of the contract, and so its clients can no
longer trust the behavior of the server.”
Grady Booch
19. “The overall goal of the decomposition
into modules is the reduction of
software cost by allowing modules to be
designed and revised independently....
Each module's structure should be
simple enough that it can be
understood fully;”
Britton and Parnas
23. “Inheritance makes it possible to define
new software in the same way we
introduce any concept to a newcomer,
by comparing it with something that is
already familiar”
Cox, B.
27. “The state of an object encompasses all
of the (usually static) properties of the
object plus the current (usually dynamic)
values of each of these properties.”
Grady Booch
28. “The state of an object represents the
cumulative results of its behavior.”
Grady Booch
29. “Assim como átomos podem existir
repetidas vezes, a identidade possibilita
que múltiplas instâncias possam
coexistir.”
Um troxa aí