Professional Documents
Culture Documents
• Scrum
• Flaccid Scrum,
Martin Fowler, January 29, 2009
martinfowler.com/bliki/FlaccidScrum.html
• “What's happened [with quite a few Scrum
projects recently] is that they haven't paid
enough attention to the internal quality of their
software. If you make that mistake you'll soon
find your productivity dragged down because
it's much harder to add new features than
you'd like….
• recommended reading
• cohesion
• coupling
• abstraction
• encapsulation
• inheritance
• polymorphism
• cohesion
• en.wikipedia.org/wiki/Cohesion_(computer_science)
• “…a measure of how strongly-related and focused the various
responsibilities of a software module are.”
•
• coupling
• en.wikipedia.org/wiki/Coupling_(computer_science)
• “… the degree to which each program module relies on
each one of the other modules.”
•
• coupling, continued
• “Low coupling refers to a relationship in which one module
interacts with another module through a stable interface and does not
need to be concerned with the other module's internal implementation….
With low coupling, a change in one module will not require a change
in the implementation of another module. Low coupling is often a sign of a
well-structured computer system, and when combined with high cohesion,
supports the general goals of high readability and maintainability.”
• abstraction
• en.wikipedia.org/wiki/Abstraction_(computer_science)
• “…a mechanism and practice to reduce and factor out details
so that one can focus on a few concepts at a time.”
•
• encapsulation
• en.wikipedia.org/wiki/Encapsulation_(computer_science)
• “…the hiding of the internal mechanisms and data structures of a
software component behind a defined interface, in such a way that
users of the component (other pieces of software) only need to know
what the component does, and cannot make themselves dependent
on the details of how it does it.”
•
// Reference System.Speech
new SpeechSynthesizer()
.Speak(
"Hello, " +
"Regina .NET User Group!"
);
• inheritance
• en.wikipedia.org/wiki/Inheritance_(computer_science)
• “…a way to form new classes (instances of which are called objects)
using classes that have already been defined.”
•
• polymorphism
• en.wikipedia.org/wiki/Polymorphism_in_object-oriented_programming
• “…the ability of one type, A, to appear as and be used like
another type, B. In strongly typed languages, this usually means that
type A somehow derives from type B, or type A implements
an interface that represents type B.”
•
catch (ArgumentException) {
...
}
• connection management
• data transfer
• operating system features
• benefits
• code is smaller
• easier to read
• easier to understand
• easier to maintain
• code is potentially easier to test
• change is easier to manage
• code is easier to replace
• contention may be reduced for source code files
among multiple developers
• deployment may be reduced
• call to action
• recognize the class as the software building block
• make classes which
• do one thing or change for only one reason
• are small
• are easy to read and understand
• are easy to maintain
• are potentially easy to test
• are easy to replace
• ensure high cohesion
• each member should directly relate to the class name
• remember that it’s a principle, not a rule;
use your professional skills and experience
• customer
• “Please log all errors to a file.”
• demonstration
• SolidDemonstration
• customer
• “On the other hand, please log all errors to the event log.”
• “Actually, I’d like all errors logged to….”
• abstractions
•
Client <<interface>> abstraction (interface)
Server
•
Client ServerBase abstraction (abstract class)
Server
• demonstration
•
Logger LogWriter abstraction (abstract class)
FileLogWriter
• demonstration
•
Logger LogWriter
• benefits
• design is more stable
• existing (working) code does not change
• changes are made by adding, not modifying, code
• changes are isolated and do not cascade throughout the code
• code is potentially easier to test
• change is easier to manage
• code is easier to replace
• design is extensible
• code is potentially reusable
• deployment may be reduced
• call to action
• implement potentially volatile code as abstractions
• use short iterations and frequent demonstrations
• develop features before infrastructure
• develop the most important features first
• remember that it’s a principle, not a rule;
use your professional skills and experience
If it looks like a duck, quacks like a duck, but needs batteries, you
probably have the wrong abstraction.
• benefits
• design is more flexible
• a base type can be confidently substituted for a derived type
• code is potentially easier to test
• required to support the Open/Closed Principle
• call to action
• ensure that
• the base type can be substituted for a derived type
• derived types are substitutable for their base type
• avoid runtime type checking
• remember that it’s a principle, not a rule;
use your professional skills and experience
• demonstration
• benefits
• cohesion is increased
• clients can demand cohesive interfaces
• design is more stable
• changes are isolated and do not cascade throughout the code
• supports the Liskov Substitution Principle
• call to action
• consider the needs of the client when designing the interface
• create client-specific interfaces
abstraction
low-level module
abstraction
details
Would you solder a lamp directly to the electrical wiring in the wall?
• benefits
• change is easier to manage
• code is easier to replace
• design is extensible
• code is potentially easier to test
• required to support the Open/Closed Principle
• call to action
• create abstractions
• depend on abstractions
• declare parameters and variables as an interface or abstract class
• derive only from abstract classes
• override only abstract members
• demonstration
• container configuration
• imperative
• declarative
• object creation
• call to action
• make small classes
• create and depend on abstractions
• avoid runtime type checking
• ensure substitutability
• create client-specific interfaces
• evaluate the Microsoft Unity Application Block
(or alternate dependency injection container)
• remember that these are principles, not rules;
use your professional skills and experience
• have fun!
• Uwe Schmitz
Technical Architect
uschmitz@protegra.com
(204) 272-2293
• Protegra
67 Scurfield Boulevard
Winnipeg, MB
www.protegra.com