12: Wiring Flashcards
what is wiring?
two stages: discovery and binding
Discovery – which component will provide which
interfaces required, from the population available
o Binding – erforming the binding to connect the chosen
components together as decided
the process of matching each components interface to each other components
can be considered part of the
What is an interface?
The “bit that sits between” two functional components
what are the benefits of DI?
Late binding - services can be swapped with other services
Extensibility
parallel development - code can be developed in parallel
maintainability - classes with clearly defined responsibility are easier to maintain
what are the options for when to wire? advs and disadvs
at installation - clear what the behaviour will be, whats needed and whats
at start up - Find issues before any user touches the system
o Clear behaviour
o Extensible when re-started, just bind to new components as
they become available
o Subject to binding failures
dynamically - A component performs re-wiring as conditions
change
o Arbitrary logic in the re-wiring – it’s just another component
o More complex
o More flexible and extensible
o When does re-wiring occur? How is the need for it
detected? How it is accomplished by a component?
how is wiring specified? advs and disadvs?
Implicitly, by the distribution of endpoints. Bindings are made according to the way components acquire endpoints. Requires discipline to make sure there’s an overview somewhere. Potentially fragile and hard to change.
Explicitly, as a workflow. Make into a structured process. Change partners as required. Requires another process to select partners and check for available components.
o Explicitly, as code. May repidly become unstable or uncomprehensible.
what are the interface compatibilityt options?
name based - they have the smae name
structual type - interfaces respond to the same operations of messages (put: int -> int)
sub-typing and other - allow more operations, variant type signatures