16. INVERSION OF CONTROL
INTENT:
Inversion of control is a style
of software construction where
reusable code controls the execution
of problem-specific code
18. “ Inversion of control is a common
characteristic of frameworks,
so saying that these lightweight containers
are special because they use inversion of
control is like saying my car is special
because it has wheels.”
21. PICO CONTAINER DEFINITION:
"Dependency Injection is where
components are given their
dependencies through their
constructors, methods, or directly
into fields."
22. Dependency injection allows the
removal of hard-coded dependencies
and makes it possible to change
them, whether at run-time or compiletime.
26. DEPENDENCY INJECTION AND FRAMEWORKS
DI
??
Grafico con spaghetti, infermiera che fa la
puntura, lista della spesa per l'antipattern
service locator, qualcosa di galattico per
l'enhanced injection (tipo pulp fiction)
http://www.loosecouplings.com/2011/01/dependency-injection-using-di-container.html
DIC
27. FACTORY METHOD
INTENT:
Define an interface for creating an object,
but let subclasses decide which class
to instantiate.
Factory Method lets a class defer instantiation to
subclasses.
36. MEDIATOR
INTENT:
Define an object that encapsulates how a set
of objects interact. Mediator promotes loose
coupling by keeping objects from referring to
each other explicitly, and it lets you vary their
interaction independently.
38. STRATEGY aka POLICY
INTENT:
Defines a family of algorithms, encapsulate
each one, and make them interchangeable.
Strategy lets the algorithm vary independently
from clients that use it.
41. DATA MAPPER
INTENT:
A layer of Mappers that moves data between
objects and a database while keeping them
independent of each other and the mapper
itself.
42. VISITOR
INTENT:
Represent an operation to be performed on
the elements of an object structure.
Visitor lets you define a new operation without
changing the classes of the elements on which
it operates.